3using System.Collections.Generic;
7using System.Threading.Tasks;
15 [TypeConverter(typeof(ExpandableObjectConverter))]
18 int m_nNoiseDataLabel = -1;
19 bool m_bUseNoisyMean =
true;
20 string m_strNoisyDataSavePath =
null;
33 [Description(
"Specifies to multipy the noisy data by the mean to produce the final noisy data (default = true). NOTE: When using this setting, the filler should be configured to produce values in the range [0,1].")]
36 get {
return m_bUseNoisyMean; }
37 set { m_bUseNoisyMean = value; }
43 [Description(
"Specifies the label used with each noise filled data used when 'use_noise_for_match' = True (default = -1).")]
46 get {
return m_nNoiseDataLabel; }
47 set { m_nNoiseDataLabel = value; }
53 [Description(
"Specifies the noise filler used when 'use_noise_for_nonmatch' = True. By default the 'noise_filler' is set to CONSTANT(1) which, when used with the 'use_noisy_mean' = True, uses the mean image as the data noise.")]
56 get {
return m_noiseFiller; }
57 set { m_noiseFiller = value; }
63 [Description(
"Optionally, specifies the path where the noisy data image is saved for debugging (default = null, which ignores this setting).")]
66 get {
return m_strNoisyDataSavePath; }
67 set { m_strNoisyDataSavePath = value; }
70 private string noisy_save_path_persist
74 string strPath =
Utility.
Replace(m_strNoisyDataSavePath,
':',
';');
94 m_bUseNoisyMean = pSrc.m_bUseNoisyMean;
95 m_nNoiseDataLabel = pSrc.m_nNoiseDataLabel;
96 m_strNoisyDataSavePath = pSrc.m_strNoisyDataSavePath;
98 if (pSrc.m_noiseFiller !=
null)
99 m_noiseFiller = pSrc.m_noiseFiller.
Clone();
111 rgChildren.
Add(
"use_noisy_mean", m_bUseNoisyMean.ToString());
112 rgChildren.
Add(
"noise_data_label", m_nNoiseDataLabel.ToString());
113 rgChildren.
Add(
"noisy_data_path", noisy_save_path_persist);
118 return new RawProto(strName,
"", rgChildren);
135 if ((strVal = rp.
FindValue(
"use_noisy_mean")) !=
null)
136 p.use_noisy_mean =
bool.Parse(strVal);
138 if ((strVal = rp.
FindValue(
"noise_data_label")) !=
null)
139 p.noise_data_label =
int.Parse(strVal);
141 if ((strVal = rp.
FindValue(
"noisy_data_path")) !=
null)
142 p.noisy_save_path_persist = strVal;
145 if (rpNoiseFiller !=
null)
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.
string FindValue(string strName)
Searches for a falue of a node within this nodes 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.
The DataNoiseParameter is used by the DataParameter when the 'enable_noise_for_nonmatch' = True,...
string noisy_save_path
(/b optional, default = null) Specifies the path where the noisy data image is saved,...
RawProto ToProto(string strName)
Convert the DataNoiseParameter into a RawProto.
static DataNoiseParameter FromProto(RawProto rp, DataNoiseParameter p=null)
Parses the parameter from a RawProto.
bool use_noisy_mean
(optional, default = true) When true the noise is applied to the mean and used as the noisy data....
int noise_data_label
(optional, default = -1) Specifies the label used with each noise filled data used when 'use_noise_fo...
DataNoiseParameter()
The constructor.
FillerParameter noise_filler
Specifies the noise filler used when 'use_noise_for_nonmatch' = true. By default the 'noise_filter' i...
void Copy(DataNoiseParameter pSrc)
Copies the specified source data noise parameter to this one.
Specifies the filler parameters used to create each Filler.
static FillerParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
FillerParameter Clone()
Creates a new copy of this instance of the parameter.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
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-...