2using System.Collections.Generic;
30 [TypeConverter(typeof(ExpandableObjectConverter))]
35 List<NetParameter> m_rgTestNets =
new List<NetParameter>();
37 List<NetState> m_rgStateTest =
new List<NetState>();
38 List<int> m_rgTestIter =
new List<int>() { 300 };
39 int m_nTestInterval = 1000;
40 bool m_bTestComputeLoss =
false;
41 bool m_bTestInitialization =
true;
42 double m_dfBaseLR = 0.01;
44 int m_nAverageLoss = 1;
45 int m_nMaxIter = 500000;
47 string m_strLrPolicy =
"step";
48 double m_dfGamma = 0.1;
50 double m_dfMomentum = 0.0;
51 double m_dfWeightDecay = 0.0005;
52 string m_strRegularizationType =
"L2";
53 int m_nStepSize = 100000;
54 List<int> m_rgnStepValue =
new List<int>();
55 double m_dfClipGradients = -1;
56 int m_nSnapshot = 10000;
57 string m_strSnapshotPrefix =
"";
58 bool m_bSnapshotDiff =
false;
61 long m_lRandomSeed = -1;
63 int m_lbfgs_corrections = 100;
64 double m_dfDelta = 1e-8;
65 double m_dfMomentum2 = 0.999;
66 double m_dfRmsDecay = 0.95;
67 double m_dfAdamWDecay = 0.1;
68 bool m_bDebugInfo =
false;
69 bool m_bSnapshotAfterTrain =
false;
70 string m_strCustomTrainer =
null;
71 string m_strCustomTrainerProperties =
null;
72 bool m_bOutputAverageResults =
false;
73 bool m_bSnapshotIncludeWeights =
true;
74 bool m_bSnapshotIncludeState =
true;
75 int m_nAverageAccuracyWindow = 0;
76 bool m_bEnableClipGradientOutput =
false;
81 bool m_bShowPerClassResult =
false;
173#pragma warning disable 1591
175#pragma warning restore 1591
254 [Description(
"Specifies to average loss results before they are output - this can be faster when there are a lot of results in a cycle.")]
257 get {
return m_bOutputAverageResults; }
258 set { m_bOutputAverageResults = value; }
267 [Description(
"Specifies the custom trainer (if any) used by an external process to provide customized training.")]
270 get {
return m_strCustomTrainer; }
271 set { m_strCustomTrainer = value; }
280 [Description(
"Specifies the custom trainer properties (if any) used by an external process to provide the properties for a customized training.")]
285 get {
return m_strCustomTrainerProperties; }
286 set { m_strCustomTrainerProperties =
Utility.
Replace(value,
' ',
"[sp]"); }
295 get {
return m_paramNet; }
296 set { m_paramNet = value; }
305 get {
return m_paramTrainNet; }
306 set { m_paramTrainNet = value; }
315 get {
return m_rgTestNets; }
316 set { m_rgTestNets = value; }
332 get {
return m_stateTrain; }
333 set { m_stateTrain = value; }
349 get {
return m_rgStateTest; }
350 set { m_rgStateTest = value; }
356 [Category(
"Iterations")]
357 [Description(
"Specifies the number of iterations for each test.")]
360 get {
return m_rgTestIter; }
361 set { m_rgTestIter = value; }
367 [Category(
"Iterations")]
368 [Description(
"Specifies the number of iterations between two testing phases.")]
371 get {
return m_nTestInterval; }
372 set { m_nTestInterval = value; }
378 [Description(
"Specifies whether or not to test the compute loss.")]
381 get {
return m_bTestComputeLoss; }
382 set { m_bTestComputeLoss = value; }
389 [Category(
"Iterations")]
390 [Description(
"If true, run an initial test pass before the first iteration, ensuring memory availability and printing the starting value of the loss.")]
393 get {
return m_bTestInitialization; }
394 set { m_bTestInitialization = value; }
400 [Description(
"Specifies the base learning rate (default = 0.01).")]
403 get {
return m_dfBaseLR; }
404 set { m_dfBaseLR = value; }
411 [Category(
"Iterations")]
412 [Description(
"Specifies the number of iterations between displaying information. If display == 0, no information will be displayed.")]
415 get {
return m_nDisplay; }
416 set { m_nDisplay = value; }
422 [Description(
"Specifies the loss averaged over the last 'average_loss' iterations.")]
425 get {
return m_nAverageLoss; }
426 set { m_nAverageLoss = value; }
432 [Category(
"Iterations")]
433 [Description(
"Specifies the maximum number of iterations.")]
436 get {
return m_nMaxIter; }
437 set { m_nMaxIter = value; }
443 [Category(
"Iterations")]
444 [Description(
"Specifies to accumulate gradients over 'iter_size' x 'batch_size' instances.")]
447 get {
return m_nIterSize; }
448 set { m_nIterSize = value; }
469 [Category(
"Learning Policy")]
470 [DisplayName(
"lr_policy")]
471 [Description(
"Specifies the learning rate decay policy. \n 'fixed' - always return base_lr. \n 'step' - return base_lr * gamma ^ (floor(iter/step)). \n 'exp' - return base_lr * gamma ^ iter. \n 'inv' - return base_lr * (1 + gamma * iter) ^ (-power)." +
472 "\n 'multistep' - similar to 'step' but allows non-uniform steps defined by stepvalue. \n 'poly' - the effective learning rate follows a polynomial decay, to be zero by the max_iter, returns base_lr * (1 - iter/max_iter) ^ (power)." +
473 "\n 'sigmoid' - the effective learning rate follows a sigmoid decay, returns base_lr * (1/(1 + exp(-gamma * (iter - stepsize)))).")]
478 switch (m_strLrPolicy)
502 throw new Exception(
"Unknown learning rate policy '" + m_strLrPolicy +
"'");
510 m_strLrPolicy =
"fixed";
514 m_strLrPolicy =
"step";
518 m_strLrPolicy =
"exp";
522 m_strLrPolicy =
"inv";
526 m_strLrPolicy =
"multistep";
530 m_strLrPolicy =
"sigmoid";
534 m_strLrPolicy =
"poly";
538 throw new Exception(
"Unknown learning rate policy '" + value.ToString() +
"'.");
566 get {
return m_strLrPolicy; }
567 set { m_strLrPolicy = value; }
573 [Category(
"Learning Policy")]
574 [Description(
"Specifies the 'gamma' parameter to compute the 'step', 'exp', 'inv', and 'sigmoid' learning policy (default = 0.1).")]
577 get {
return m_dfGamma; }
578 set { m_dfGamma = value; }
584 [Category(
"Learning Policy")]
585 [Description(
"Specifies the 'power' parameter to compute the 'inv' and 'poly' learning policy.")]
588 get {
return m_dfPower; }
589 set { m_dfPower = value; }
596 [Category(
"Solver - Not AdaGrad or RMSProp")]
597 [Description(
"Specifies the momentum value - used by all solvers EXCEPT the 'AdaGrad' and 'RMSProp' solvers. For these latter solvers, momentum should = 0.")]
600 get {
return m_dfMomentum; }
601 set { m_dfMomentum = value; }
607 [Description(
"Specifies the weight decay (default = 0.0005).")]
610 get {
return m_dfWeightDecay; }
611 set { m_dfWeightDecay = value; }
621 [DisplayName(
"regularization_type")]
622 [Description(
"Specifies the regularization type (default = L2). The regulation types supported are 'L1' and 'L2' controlled by weight decay.")]
627 switch (m_strRegularizationType)
639 throw new Exception(
"Unknown regularization type '" + m_strRegularizationType +
"'");
647 m_strRegularizationType =
"NONE";
651 m_strRegularizationType =
"L1";
655 m_strRegularizationType =
"L2";
659 throw new Exception(
"Unknown regularization type '" + value.ToString() +
"'");
671 [Description(
"Specifies the regularization type (default = 'L2'). The regulation types supported are 'L1' and 'L2' controlled by weight decay.")]
675 get {
return m_strRegularizationType; }
676 set { m_strRegularizationType = value; }
682 [Category(
"Learning Policy")]
683 [Description(
"Specifies the stepsize for the learning rate policy 'step'.")]
686 get {
return m_nStepSize; }
687 set { m_nStepSize = value; }
693 [Category(
"Learning Policy")]
694 [Description(
"Specifies the step values for the learning rate policy 'multistep'.")]
697 get {
return m_rgnStepValue; }
698 set { m_rgnStepValue = value; }
705 [Description(
"Set 'clip_gradients' to >= 0 to clip parameter gradients to that L2 norm, whenever their actual LT norm is larger.")]
708 get {
return m_dfClipGradients; }
709 set { m_dfClipGradients = value; }
715 [Description(
"Optionally, enable/disable output status when gradients are clipped (default = true).")]
718 get {
return m_bEnableClipGradientOutput; }
719 set { m_bEnableClipGradientOutput = value; }
725 [Category(
"Snapshot")]
726 [Description(
"Sepcifies the snapshot interval.")]
729 get {
return m_nSnapshot; }
730 set { m_nSnapshot = value; }
736 [Description(
"Specifies the snapshot prefix.")]
740 get {
return m_strSnapshotPrefix; }
741 set { m_strSnapshotPrefix = value; }
748 [Category(
"Snapshot")]
749 [Description(
"Specifies whether ot snapshot diff in the results or not. Snapshotting diff may help debugging but the final snapshot data size will be much larger.")]
752 get {
return m_bSnapshotDiff; }
753 set { m_bSnapshotDiff = value; }
762 [Description(
"Specifies the snapshot format.")]
766 get {
return m_snapshotFormat; }
767 set { m_snapshotFormat = value; }
773 [Category(
"Snapshot")]
774 [Description(
"Specifies whether or not the snapshot includes the trained weights. The default = 'true'.")]
777 get {
return m_bSnapshotIncludeWeights; }
778 set { m_bSnapshotIncludeWeights = value; }
784 [Category(
"Snapshot")]
785 [Description(
"Specifies whether or not the snapshot includes the solver state. The default = 'false'. Including the solver state will slow down the time of each snapshot.")]
788 get {
return m_bSnapshotIncludeState; }
789 set { m_bSnapshotIncludeState = value; }
795 [Description(
"Specifies the device ID that will be used when run on the GPU.")]
799 get {
return m_nDeviceID; }
800 set { m_nDeviceID = value; }
808 [Description(
"If non-negative, the seed with which the Solver will initialize the caffe random number generator -- useful for reproducible results. Otherwise (and by default), initialize using a seed derived from the system clock.")]
811 get {
return m_lRandomSeed; }
812 set { m_lRandomSeed = value; }
819 [Description(
"Specifies the solver type. \n" +
820 " SGD - stochastic gradient descent with momentum updates weights by a linear combination of the negative gradient and the previous weight update. \n" +
821 " NESTEROV - Nesterov's accelerated gradient, similar to SGD, but error gradient is computed on the weights with added momentum. \n" +
822 " ADADELTA - Gradient based optimization like SGD, see M. Zeiler 'Adadelta, An adaptive learning rate method', arXiv preprint, 2012. \n" +
823 " ADAGRAD - Gradient based optimization like SGD that tries to find rarely seen features, see Duchi, E, and Y. Singer, 'Adaptive subgradient methods for online learning and stochastic optimization', The Journal of Machine Learning Research, 2011. \n" +
824 " ADAM - Gradient based optimization like SGD that includes 'adaptive momentum estimation' and can be thougth of as a generalization of AdaGrad, see D. Kingma, J. Ba, 'Adam: A method for stochastic optimization', Intl' Conference for Learning Representations, 2015. \n" +
825 " RMSPROP - Gradient based optimization like SGD, see T. Tieleman, and G. Hinton, 'RMSProp: Divide the gradient by a runnign average of its recent magnitude', COURSERA: Neural Networks for Machine Learning. Technical Report, 2012. \n" +
826 " LBGFS - Gradient based on minFunc, see Marc Schmidt 'minFunc'")]
829 get {
return m_solverType; }
830 set { m_solverType = value; }
836 [Category(
"Solver - Ada, Adam and RMSProp")]
837 [Description(
"Specifies the numerical stability for 'RMSProp', 'AdaGrad', 'AdaDelta' and 'Adam' solvers (default = 1e-08).")]
840 get {
return m_dfDelta; }
841 set { m_dfDelta = value; }
847 [Category(
"Solver - Adam")]
848 [Description(
"Specifies an additional momentum property used by the 'Adam' and 'AdamW' solvers (default = 0.999).")]
851 get {
return m_dfMomentum2; }
852 set { m_dfMomentum2 = value; }
861 [Category(
"Solver - RMSProp")]
862 [Description(
"Specifies the 'RMSProp' decay value used by the 'RMSProp' solver (default = 0.95). MeanSquare(t) = 'rms_decay' * MeanSquare(t-1) + (1 - 'rms_decay') * SquareGradient(t). The 'rms_decay' is only used by the 'RMSProp' solver.")]
865 get {
return m_dfRmsDecay; }
866 set { m_dfRmsDecay = value; }
875 [Category(
"Solver - AdamW")]
876 [Description(
"Specifies the 'AdamW' detached weight decay value used by the 'AdamW' solver (default = 0.1).")]
879 get {
return m_dfAdamWDecay; }
880 set { m_dfAdamWDecay = value; }
888 [Description(
"If true, print information about the sate of the net that may help with debugging learning problems.")]
891 get {
return m_bDebugInfo; }
892 set { m_bDebugInfo = value; }
898 [Category(
"Solver - L-BGFS")]
899 [Description(
"Specifies the 'L-BGFS' corrections.")]
902 get {
return m_lbfgs_corrections; }
903 set { m_lbfgs_corrections = value; }
909 [Category(
"Snapshot")]
910 [Description(
"If false, don't save a snapshot after training finishes.")]
913 get {
return m_bSnapshotAfterTrain; }
914 set { m_bSnapshotAfterTrain = value; }
921 [Description(
"Specifies the evaluation type to use when using Single-Shot Detection (SSD) - (default = NONE, SSD not used).")]
924 get {
return m_evalType; }
925 set { m_evalType = value; }
932 [Description(
"Specifies the AP Version to use for average precision when using Single-Shot Detection (SSD) - (default = INTEGRAL).")]
935 get {
return m_apVersion; }
936 set { m_apVersion = value; }
943 [Description(
"Specifies whether or not to display results per class when using Single-Shot Detection (SSD) - (default = false).")]
946 get {
return m_bShowPerClassResult; }
947 set { m_bShowPerClassResult = value; }
953 [Description(
"Specifies the window over which to average the accuracies (default = 0, which ignores the averaging).")]
956 get {
return m_nAverageAccuracyWindow; }
957 set { m_nAverageAccuracyWindow = value; }
977 rgChildren.Add(np.
ToProto(
"test_net_param"));
985 rgChildren.Add(ns.
ToProto(
"test_state"));
988 rgChildren.Add<
int>(
"test_iter",
test_iter);
992 rgChildren.Add(
"base_lr",
base_lr.ToString());
993 rgChildren.Add(
"display",
display.ToString());
994 rgChildren.Add(
"average_loss",
average_loss.ToString());
995 rgChildren.Add(
"max_iter",
max_iter.ToString());
998 rgChildren.Add(
"iter_size",
iter_size.ToString());
1003 rgChildren.Add(
"gamma",
gamma.ToString());
1006 rgChildren.Add(
"power",
power.ToString());
1008 rgChildren.Add(
"momentum",
momentum.ToString());
1009 rgChildren.Add(
"weight_decay",
weight_decay.ToString());
1013 rgChildren.Add(
"stepsize",
stepsize.ToString());
1016 rgChildren.Add<
int>(
"stepvalue",
stepvalue);
1024 rgChildren.Add(
"snapshot",
snapshot.ToString());
1033 rgChildren.Add(
"device_id",
device_id.ToString());
1036 rgChildren.Add(
"ransom_seed",
random_seed.ToString());
1038 rgChildren.Add(
"type",
type.ToString());
1041 rgChildren.Add(
"delta",
delta.ToString());
1044 rgChildren.Add(
"momentum2",
momentum2.ToString());
1047 rgChildren.Add(
"rms_decay",
rms_decay.ToString());
1050 rgChildren.Add(
"adamw_decay",
adamw_decay.ToString());
1056 rgChildren.Add(
"debug_info",
debug_info.ToString());
1074 rgChildren.Add(
"eval_type",
eval_type.ToString().ToLower());
1077 rgChildren.Add(
"ap_version",
"11point");
1079 rgChildren.Add(
"ap_version",
ap_version.ToString().ToLower());
1084 return new RawProto(strName,
"", rgChildren);
1098 if (rpNetParam !=
null)
1102 if (rpTrainNetParam !=
null)
1112 if (rpTrainState !=
null)
1121 p.test_iter = rp.FindArray<
int>(
"test_iter");
1123 if ((strVal = rp.FindValue(
"test_interval")) !=
null)
1124 p.test_interval =
int.Parse(strVal);
1126 if ((strVal = rp.FindValue(
"test_compute_loss")) !=
null)
1127 p.test_compute_loss =
bool.Parse(strVal);
1129 if ((strVal = rp.FindValue(
"test_initialization")) !=
null)
1130 p.test_initialization =
bool.Parse(strVal);
1132 if ((strVal = rp.FindValue(
"base_lr")) !=
null)
1135 if ((strVal = rp.FindValue(
"display")) !=
null)
1136 p.display =
int.Parse(strVal);
1138 if ((strVal = rp.FindValue(
"average_loss")) !=
null)
1139 p.average_loss =
int.Parse(strVal);
1141 if ((strVal = rp.FindValue(
"max_iter")) !=
null)
1142 p.max_iter =
int.Parse(strVal);
1144 if ((strVal = rp.FindValue(
"iter_size")) !=
null)
1145 p.iter_size =
int.Parse(strVal);
1147 if ((strVal = rp.FindValue(
"lr_policy")) !=
null)
1148 p.lr_policy = strVal;
1150 if ((strVal = rp.FindValue(
"gamma")) !=
null)
1153 if ((strVal = rp.FindValue(
"power")) !=
null)
1156 if ((strVal = rp.FindValue(
"momentum")) !=
null)
1159 if ((strVal = rp.FindValue(
"weight_decay")) !=
null)
1162 if ((strVal = rp.FindValue(
"regularization_type")) !=
null)
1163 p.regularization_type = strVal;
1165 if ((strVal = rp.FindValue(
"stepsize")) !=
null)
1166 p.stepsize =
int.Parse(strVal);
1168 p.stepvalue = rp.FindArray<
int>(
"stepvalue");
1170 if ((strVal = rp.FindValue(
"clip_gradients")) !=
null)
1173 if ((strVal = rp.FindValue(
"enable_clip_gradient_status")) !=
null)
1174 p.enable_clip_gradient_status =
bool.Parse(strVal);
1176 if ((strVal = rp.FindValue(
"snapshot")) !=
null)
1177 p.snapshot =
int.Parse(strVal);
1179 if ((strVal = rp.FindValue(
"snapshot_prefix")) !=
null)
1180 p.snapshot_prefix = strVal;
1182 if ((strVal = rp.FindValue(
"snapshot_diff")) !=
null)
1183 p.snapshot_diff =
bool.Parse(strVal);
1185 if ((strVal = rp.FindValue(
"snapshot_format")) !=
null)
1198 throw new Exception(
"Unknown 'snapshot_format' value: " + strVal);
1202 if ((strVal = rp.FindValue(
"device_id")) !=
null)
1203 p.device_id =
int.Parse(strVal);
1205 if ((strVal = rp.FindValue(
"random_seed")) !=
null)
1206 p.random_seed =
long.Parse(strVal);
1208 if ((strVal = rp.FindValue(
"type")) !=
null)
1210 string strVal1 = strVal.ToLower();
1247 throw new Exception(
"Unknown solver 'type' value: " + strVal);
1251 if ((strVal = rp.FindValue(
"delta")) !=
null)
1254 if ((strVal = rp.FindValue(
"momentum2")) !=
null)
1257 if ((strVal = rp.FindValue(
"rms_decay")) !=
null)
1260 if ((strVal = rp.FindValue(
"adamw_decay")) !=
null)
1263 if ((strVal = rp.FindValue(
"debug_info")) !=
null)
1264 p.debug_info =
bool.Parse(strVal);
1266 if ((strVal = rp.FindValue(
"lbgfs_corrections")) !=
null)
1267 p.lbgfs_corrections =
int.Parse(strVal);
1269 if ((strVal = rp.FindValue(
"snapshot_after_train")) !=
null)
1270 p.snapshot_after_train =
bool.Parse(strVal);
1272 if ((strVal = rp.FindValue(
"custom_trainer")) !=
null)
1273 p.custom_trainer = strVal;
1275 if ((strVal = rp.FindValue(
"custom_trainer_properties")) !=
null)
1276 p.custom_trainer_properties = strVal;
1278 if ((strVal = rp.FindValue(
"output_average_results")) !=
null)
1279 p.output_average_results =
bool.Parse(strVal);
1281 if ((strVal = rp.FindValue(
"snapshot_include_weights")) !=
null)
1282 p.snapshot_include_weights =
bool.Parse(strVal);
1284 if ((strVal = rp.FindValue(
"snapshot_include_state")) !=
null)
1285 p.snapshot_include_state =
bool.Parse(strVal);
1287 if ((strVal = rp.FindValue(
"eval_type")) !=
null)
1289 strVal = strVal.ToLower();
1293 case "classification":
1302 throw new Exception(
"Unknown eval_type '" + strVal +
"'!");
1306 if ((strVal = rp.FindValue(
"ap_version")) !=
null)
1308 strVal = strVal.ToLower();
1325 throw new Exception(
"Unknown ap_type '" + strVal +
"'!");
1329 if ((strVal = rp.FindValue(
"show_per_class_result")) !=
null)
1330 p.show_per_class_result =
bool.Parse(strVal);
1332 if ((strVal = rp.FindValue(
"accuracy_average_window")) !=
null)
1333 p.accuracy_average_window =
int.Parse(strVal);
1344 return m_solverType.ToString();
The BaseParameter class is the base class for all other parameter classes.
static double ParseDouble(string strVal)
Parse double values using the US culture if the decimal separator = '.', then using the native cultur...
The RawProtoCollection class is a list of RawProto objects.
void Add(RawProto p)
Adds a RawProto to the collection.
The RawProto class is used to parse and output Google prototxt file data.
RawProto FindChild(string strName)
Searches for a given node.
RawProtoCollection FindChildren(params string[] rgstrName)
Searches for all children with a given name in this node's children.
The Utility class provides general utility funtions.
static string Replace(string str, char ch1, char ch2)
Replaces each instance of one character with another character in a given string.
Specifies the parameters use to create a Net
static NetParameter FromProto(RawProto rp)
Parse a RawProto into a new instance of the parameter.
override RawProto ToProto(string strName)
Constructor for the parameter.
Specifies the NetState which includes the phase, level and stage for which a given Net is to run unde...
static NetState FromProto(RawProto rp)
Parses a RawProto representing a NetState into a NetState instance.
override RawProto ToProto(string strName)
Converts this NetState to a RawProto.
The SolverParameter is a parameter for the solver, specifying the train and test networks.
int stepsize
The stepsize for learning rate policy 'step'.
RegularizationType Regularization
Specifies the regularization type (default = L2).
int max_iter
The maximum number of iterations.
int lbgfs_corrections
Specifies the number of lbgfs corrections used with the L-BGFS solver.
SnapshotFormat
Defines the format of each snapshot.
List< int > test_iter
The number of iterations for each test.
string regularization_type
Specifies the regularization type (default = 'L2').
SolverParameter Clone()
Creates a new copy of the SolverParameter.
NetParameter net_param
Inline train net param, possibly combined with one or more test nets.
bool debug_info
If true, print information about the state of the net that may help with debugging learning problems.
NetParameter train_net_param
Inline train net param, possibly combined with one or more test nets.
LearningRatePolicyType
Defines the learning rate policy to use.
List< NetState > test_state
The states for the train/test nets. Must be unspecified or specified once per net.
SolverType
Defines the type of solver.
string snapshot_prefix
The prefix for the snapshot.
string lr_policy
The learning rate decay policy.
double delta
Numerical stability for RMSProp, AdaGrad, AdaDelta, Adam and AdamW solvers (default = 1e-08).
static SolverParameter FromProto(RawProto rp)
Parses a new SolverParameter from a RawProto.
LearningRatePolicyType LearningRatePolicy
The learning rate decay policy.
int device_id
The device id that will be used when run on the GPU.
ApVersion ap_version
Specifies the AP Version to use for average precision when using Single-Shot Detection (SSD) - (defau...
double power
The 'power' parameter to compute the learning rate.
long random_seed
If non-negative, the seed with which the Solver will initialize the caffe random number generator – u...
int average_loss
Display the loss averaged over the last average_loss iterations.
bool enable_clip_gradient_status
Optionally, enable status output when gradients are clipped (default = true)
double momentum2
An additional momentum property for the Adam and AdamW solvers (default = 0.999).
int test_interval
The number of iterations between two testing phases.
bool output_average_results
Specifies to average loss results before they are output - this can be faster when there are a lot of...
int iter_size
Accumulate gradients over 'iter_size' x 'batch_size' instances.
override RawProto ToProto(string strName)
Converts the SolverParameter into a RawProto.
string DebugString()
Returns a debug string for the SolverParameter.
RegularizationType
Defines the regularization type. When enabled, weight_decay is used.
EvaluationType
Defines the evaluation method used in the SSD algorithm.
double gamma
Specifies the 'gamma' parameter to compute the 'step', 'exp', 'inv', and 'sigmoid' learning policy (d...
bool snapshot_after_train
If false, don't save a snapshot after training finishes.
string custom_trainer_properties
Specifies the custom trainer properties (if any) - this is an optional setting used by exteral softwa...
SnapshotFormat snapshot_format
The snapshot format.
bool snapshot_include_weights
Specifies whether or not the snapshot includes the trained weights. The default = true.
bool test_compute_loss
Test the compute loss.
SolverParameter()
The SolverParameter constructor.
string custom_trainer
Specifies the Name of the custom trainer (if any) - this is an optional setting used by exteral softw...
EvaluationType eval_type
Specifies the evaluation type to use when using Single-Shot Detection (SSD) - (default = NONE,...
bool test_initialization
If true, run an initial test pass before the first iteration, ensuring memory availability and printi...
List< NetParameter > test_net_param
Inline test net params.
int display
The number of iterations between displaying info. If display = 0, no info will be displayed.
double adamw_decay
Specifies the 'AdamW' detached weight decay value used by the 'AdamW' solver (default = 0....
bool snapshot_diff
Whether to snapshot diff in the results or not. Snapshotting diff will help debugging but the final p...
double weight_decay
Specifies the weight decay (default = 0.0005).
bool snapshot_include_state
Specifies whether or not the snapshot includes the solver state. The default = false....
List< int > stepvalue
The step values for learning rate policy 'multistep'.
double momentum
Specifies the momentum value - used by all solvers EXCEPT the 'AdaGrad' and 'RMSProp' solvers....
bool show_per_class_result
Specifies whether or not to display results per class when using Single-Shot Detection (SSD) - (defau...
int accuracy_average_window
Specifies the window over which to average the accuracies (default = 0 which ignores averaging).
int snapshot
Specifies the snapshot interval.
double base_lr
The base learning rate (default = 0.01).
SolverType type
Specifies the solver type.
double rms_decay
Specifies the 'RMSProp' decay value used by the 'RMSProp' solver (default = 0.95).
NetState train_state
The states for the train/test nets. Must be unspecified or specified once per net.
double clip_gradients
Set clip_gradients to >= 0 to clip parameter gradients to that L2 norm, whenever their actual L2 norm...
The DictionaryParamEditor is used to visually edit dictionary based parameters that are stored as a k...
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
@ NONE
No training category specified.
ApVersion
Defines the different way of computing average precision.
The MyCaffe.common namespace contains common MyCaffe classes.
@ L2
Specifies to use L2 loss.
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...