2using System.Collections.Generic;
5using System.Runtime.Serialization;
16 bool m_bEnableLabelBalancing =
false;
17 bool m_bEnableLabelBoosting =
false;
18 bool m_bEnableRandomInputSelection =
true;
19 bool m_bEnablePairInputSelection =
false;
20 bool m_bUseTrainingSourceForTesting =
false;
21 bool m_bVerifyDatasetOnLoad =
false;
22 double m_dfSuperBoostProbability = 0.0;
23 int m_nMaximumIterationOverride = -1;
24 int m_nTestingIterationOverride = -1;
25 string m_strDefaultModelGroup =
"";
26 string m_strGpuIds =
"0";
28 int m_nDbLoadLimit = 0;
29 int m_nAutoRefreshScheduledUpdateInMs = 0;
30 double m_dfAutoRefreshScheduledReplacementPct = 0;
31 bool m_bItemDbLoadDataCriteria =
false;
32 bool m_bItemDbLoadDebugData =
false;
35 bool m_bSkipMeanCheck =
false;
49 m_imgDbVersion = s.m_imgDbVersion;
50 m_bEnableLabelBalancing = s.m_bEnableLabelBalancing;
51 m_bEnableLabelBoosting = s.m_bEnableLabelBoosting;
52 m_bEnableRandomInputSelection = s.m_bEnableRandomInputSelection;
53 m_bEnablePairInputSelection = s.m_bEnablePairInputSelection;
54 m_bUseTrainingSourceForTesting = s.m_bUseTrainingSourceForTesting;
55 m_bVerifyDatasetOnLoad = s.m_bVerifyDatasetOnLoad;
56 m_dfSuperBoostProbability = s.m_dfSuperBoostProbability;
57 m_nMaximumIterationOverride = s.m_nMaximumIterationOverride;
58 m_nTestingIterationOverride = s.m_nTestingIterationOverride;
59 m_strDefaultModelGroup = s.m_strDefaultModelGroup;
60 m_strGpuIds = s.m_strGpuIds;
61 m_dbLoadMethod = s.m_dbLoadMethod;
62 m_nDbLoadLimit = s.m_nDbLoadLimit;
63 m_nAutoRefreshScheduledUpdateInMs = s.m_nAutoRefreshScheduledUpdateInMs;
64 m_dfAutoRefreshScheduledReplacementPct = s.m_dfAutoRefreshScheduledReplacementPct;
65 m_bItemDbLoadDataCriteria = s.m_bItemDbLoadDataCriteria;
66 m_bItemDbLoadDebugData = s.m_bItemDbLoadDebugData;
67 m_snapshotWeightUpdateMethod = s.m_snapshotWeightUpdateMethod;
68 m_snapshotLoadMethod = s.m_snapshotLoadMethod;
69 m_bSkipMeanCheck = s.m_bSkipMeanCheck;
79 m_imgDbVersion = (
DB_VERSION)getInt(info,
"ImageDbVersion", (
int)m_imgDbVersion);
80 m_bEnableLabelBalancing = getBool(info,
"bEnableLabelBalancing", m_bEnableLabelBalancing);
81 m_bEnableLabelBoosting = getBool(info,
"bEnableLabelBoosting", m_bEnableLabelBoosting);
82 m_bEnableRandomInputSelection = getBool(info,
"bEnableRandomInputSelection", m_bEnableRandomInputSelection);
83 m_bEnablePairInputSelection = getBool(info,
"bEnablePairInputSelection", m_bEnablePairInputSelection);
84 m_bUseTrainingSourceForTesting = getBool(info,
"bUseTrainingSourceForTesting", m_bUseTrainingSourceForTesting);
85 m_bVerifyDatasetOnLoad = getBool(info,
"bVerifyDatasetOnLoad", m_bVerifyDatasetOnLoad);
86 m_dfSuperBoostProbability = getDouble(info,
"dfSuperBoostProbability", m_dfSuperBoostProbability);
87 m_nMaximumIterationOverride = getInt(info,
"nMaximumIterationOverride", m_nMaximumIterationOverride);
88 m_nTestingIterationOverride = getInt(info,
"nTestingIterationOverride", m_nTestingIterationOverride);
89 m_strDefaultModelGroup = info.GetString(
"strDefaultModelGroup");
90 m_strGpuIds = getString(info,
"strGpuIds", m_strGpuIds);
91 m_dbLoadMethod = (
DB_LOAD_METHOD)getInt(info,
"ImageDbLoadMethod", (
int)m_dbLoadMethod);
92 m_nDbLoadLimit = getInt(info,
"ImageDbLoadLimit", m_nDbLoadLimit);
93 m_nAutoRefreshScheduledUpdateInMs = getInt(info,
"ImageDbAutoRefreshScheduledUpdateInMs", m_nAutoRefreshScheduledUpdateInMs);
94 m_dfAutoRefreshScheduledReplacementPct = getDouble(info,
"ImageDbAutoRefreshReplacementPct", m_dfAutoRefreshScheduledReplacementPct);
95 m_bItemDbLoadDataCriteria = getBool(info,
"ImageDbLoadDataCriteria", m_bItemDbLoadDataCriteria);
96 m_bItemDbLoadDebugData = getBool(info,
"ImageDbLoadDebugData", m_bItemDbLoadDebugData);
98 m_snapshotLoadMethod = (
SNAPSHOT_LOAD_METHOD)getInt(info,
"SnapshotLoadMethod", (
int)m_snapshotLoadMethod);
99 m_bSkipMeanCheck = getBool(info,
"SkipMeanCheck", m_bSkipMeanCheck);
102 private bool getBool(SerializationInfo info,
string str,
bool bDefault)
106 return info.GetBoolean(str);
114 private double getDouble(SerializationInfo info,
string str,
double dfDefault)
118 return info.GetDouble(str);
126 private string getString(SerializationInfo info,
string str,
string strDefault)
130 return info.GetString(str);
138 private int getInt(SerializationInfo info,
string str,
int nDefault)
142 return info.GetInt32(str);
157 info.AddValue(
"ImageDbVersion", (
int)m_imgDbVersion);
158 info.AddValue(
"bEnableLabelBalancing", m_bEnableLabelBalancing);
159 info.AddValue(
"bEnableLabelBoosting", m_bEnableLabelBoosting);
160 info.AddValue(
"bEnableRandomInputSelection", m_bEnableRandomInputSelection);
161 info.AddValue(
"bEnablePairInputSelection", m_bEnablePairInputSelection);
162 info.AddValue(
"bUseTrainingSourceForTesting", m_bUseTrainingSourceForTesting);
163 info.AddValue(
"bVerifyDatasetOnLoad", m_bVerifyDatasetOnLoad);
164 info.AddValue(
"dfSuperBoostProbability", m_dfSuperBoostProbability);
165 info.AddValue(
"nMaximumIterationOverride", m_nMaximumIterationOverride);
166 info.AddValue(
"nTestingIterationOverride", m_nTestingIterationOverride);
167 info.AddValue(
"strDefaultModelGroup", m_strDefaultModelGroup);
168 info.AddValue(
"strGpuIds", m_strGpuIds);
169 info.AddValue(
"ImageDbLoadMethod", (
int)m_dbLoadMethod);
170 info.AddValue(
"ImageDbLoadLimit", m_nDbLoadLimit);
171 info.AddValue(
"ImageDbAutoRefreshScheduledUpdateInMs", m_nAutoRefreshScheduledUpdateInMs);
172 info.AddValue(
"ImageDbAutoRefreshReplacementPct", m_dfAutoRefreshScheduledReplacementPct);
173 info.AddValue(
"ImageDbLoadDataCriteria", m_bItemDbLoadDataCriteria);
174 info.AddValue(
"ImageDbLoadDebugData", m_bItemDbLoadDebugData);
175 info.AddValue(
"SnapshotWeightUpdateMethod", (
int)m_snapshotWeightUpdateMethod);
176 info.AddValue(
"SnapshotLoadMethod", (
int)m_snapshotLoadMethod);
177 info.AddValue(
"SkipMeanCheck", m_bSkipMeanCheck);
188 s.m_imgDbVersion = m_imgDbVersion;
189 s.m_bEnableLabelBalancing = m_bEnableLabelBalancing;
190 s.m_bEnableLabelBoosting = m_bEnableLabelBoosting;
191 s.m_bEnableRandomInputSelection = m_bEnableRandomInputSelection;
192 s.m_bEnablePairInputSelection = m_bEnablePairInputSelection;
193 s.m_bUseTrainingSourceForTesting = m_bUseTrainingSourceForTesting;
194 s.m_bVerifyDatasetOnLoad = m_bVerifyDatasetOnLoad;
195 s.m_dfSuperBoostProbability = m_dfSuperBoostProbability;
196 s.m_nMaximumIterationOverride = m_nMaximumIterationOverride;
197 s.m_nTestingIterationOverride = m_nTestingIterationOverride;
198 s.m_strDefaultModelGroup = m_strDefaultModelGroup;
199 s.m_strGpuIds = m_strGpuIds;
200 s.m_dbLoadMethod = m_dbLoadMethod;
201 s.m_nDbLoadLimit = m_nDbLoadLimit;
202 s.m_nAutoRefreshScheduledUpdateInMs = m_nAutoRefreshScheduledUpdateInMs;
203 s.m_dfAutoRefreshScheduledReplacementPct = m_dfAutoRefreshScheduledReplacementPct;
204 s.m_bItemDbLoadDataCriteria = m_bItemDbLoadDataCriteria;
205 s.m_bItemDbLoadDebugData = m_bItemDbLoadDebugData;
206 s.m_snapshotWeightUpdateMethod = m_snapshotWeightUpdateMethod;
207 s.m_snapshotLoadMethod = m_snapshotLoadMethod;
208 s.m_bSkipMeanCheck = m_bSkipMeanCheck;
218 get {
return m_bVerifyDatasetOnLoad; }
219 set { m_bVerifyDatasetOnLoad = value; }
227 get {
return m_imgDbVersion; }
228 set { m_imgDbVersion = value; }
237 get {
return m_bEnableLabelBalancing; }
238 set { m_bEnableLabelBalancing = value; }
247 get {
return m_bEnableLabelBoosting; }
248 set { m_bEnableLabelBoosting = value; }
257 get {
return m_bEnableRandomInputSelection; }
258 set { m_bEnableRandomInputSelection = value; }
268 get {
return m_bEnablePairInputSelection; }
269 set { m_bEnablePairInputSelection = value; }
277 get {
return m_bUseTrainingSourceForTesting; }
278 set { m_bUseTrainingSourceForTesting = value; }
286 get {
return m_dfSuperBoostProbability; }
287 set { m_dfSuperBoostProbability = value; }
295 get {
return m_nMaximumIterationOverride; }
296 set { m_nMaximumIterationOverride = value; }
304 get {
return m_nTestingIterationOverride; }
305 set { m_nTestingIterationOverride = value; }
313 get {
return m_strDefaultModelGroup; }
314 set { m_strDefaultModelGroup = value; }
326 get {
return m_strGpuIds; }
327 set { m_strGpuIds = value; }
335 get {
return m_dbLoadMethod; }
336 set { m_dbLoadMethod = value; }
344 get {
return m_nDbLoadLimit; }
347 if (value == 0 && m_nDbLoadLimit != 0)
349 m_nAutoRefreshScheduledUpdateInMs = 0;
350 m_dfAutoRefreshScheduledReplacementPct = 0;
352 else if (value != 0 && m_nDbLoadLimit == 0)
354 m_nAutoRefreshScheduledUpdateInMs = 10000;
355 m_dfAutoRefreshScheduledReplacementPct = 0.3;
358 m_nDbLoadLimit = value;
367 get {
return m_nAutoRefreshScheduledUpdateInMs; }
368 set { m_nAutoRefreshScheduledUpdateInMs = value; }
376 get {
return m_dfAutoRefreshScheduledReplacementPct; }
377 set { m_dfAutoRefreshScheduledReplacementPct = value; }
385 get {
return m_bItemDbLoadDataCriteria; }
386 set { m_bItemDbLoadDataCriteria = value; }
394 get {
return m_bItemDbLoadDebugData; }
395 set { m_bItemDbLoadDebugData = value; }
403 get {
return m_snapshotWeightUpdateMethod; }
404 set { m_snapshotWeightUpdateMethod = value; }
412 get {
return m_snapshotLoadMethod; }
413 set { m_snapshotLoadMethod = value; }
421 get {
return m_bSkipMeanCheck; }
422 set { m_bSkipMeanCheck = value; }
The SettingsCaffe defines the settings used by the MyCaffe CaffeControl.
SNAPSHOT_WEIGHT_UPDATE_METHOD SnapshotWeightUpdateMethod
Get/set the snapshot update method.
bool EnableRandomInputSelection
Get/set random image selection. When enabled, images are randomly selected from the entire set,...
SNAPSHOT_LOAD_METHOD SnapshotLoadMethod
Get/set the snapshot load method.
double DbAutoRefreshScheduledReplacementPercent
Get/set the automatic refresh scheduled update replacement percentage used on refresh (default = 0....
int DbLoadLimit
Get/set the image database load limit.
SettingsCaffe Clone()
Returns a copy of the SettingsCaffe object.
bool EnableLabelBoosting
DEPRECIATED: Get/set label boosting. When using Label boosting, images are selected from boosted labe...
double SuperBoostProbability
Get/set the superboost probability used when selecting boosted images.
SettingsCaffe(SettingsCaffe s)
The SettingsCaffe constructor that copies another SettingsCaffe instance.
DB_LOAD_METHOD DbLoadMethod
Get/set the image database loading method.
bool UseTrainingSourceForTesting
Get/set whether or not to use the training datasource when testing.
bool EnablePairInputSelection
Get/set pair image selection. When using pair selection, images are queried in pairs where the first ...
bool ItemDbLoadDebugData
Specifies whether or not to load the debug data from file (default = false).
string GpuIds
Get/set the default GPU ID's to use when training.
int MaximumIterationOverride
Get/set the maximum iteration override. When set, this overrides the training iterations specified in...
int DbAutoRefreshScheduledUpdateInMs
Get/set the automatic refresh scheduled udpate period (default = 10000, only applies when ImageDbLoad...
DB_VERSION DbVersion
Get/set the version of the MyCaffeImageDatabase to use.
bool ItemDbLoadDataCriteria
Specifies whether or not to load the image criteria data from file (default = false).
string DefaultModelGroup
Get/set the default model group to use.
int TestingIterationOverride
Get/set the testing iteration override. When set, this overrides the testing iterations specified in ...
bool SkipMeanCheck
Skip checking for the mean of the dataset - this is not recommended for if the mean does not exist,...
SettingsCaffe()
The SettingsCaffe constructor.
SettingsCaffe(SerializationInfo info, StreamingContext context)
The SettingsCaffe constructor used during deserialization.
bool VeriyDatasetOnLoad
Get/set whether or not to verify the dataset on load (only applies when using the LOAD_ALL loading me...
bool EnableLabelBalancing
Get/set label balancing. When enabled, first the label set is randomly selected and then the image is...
void GetObjectData(SerializationInfo info, StreamingContext context)
The GetObjectData is used during serialization.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
DB_LOAD_METHOD
Defines how to laod the items into the in-memory database.
DB_VERSION
Defines the image database version to use.
SNAPSHOT_LOAD_METHOD
Defines the snapshot load method.
SNAPSHOT_WEIGHT_UPDATE_METHOD
Defines the snapshot weight update method.