2using System.Collections.Generic;
14 [TypeConverter(typeof(ExpandableObjectConverter))]
116 public FillerParameter(
string strType =
"gaussian",
double dfVal = 0.0,
double dfMean = 0.0,
double dfStd = 1.0)
129 [Description(
"Specifies the type of filler to use.")]
133 get {
return m_strType; }
134 set { m_strType =
value; }
137#pragma warning disable 1591
139 [DisplayName(
"type")]
140 [Description(
"Specifies the type of filler type to use.")]
165 case "positive_unitball":
172 throw new Exception(
"Unknown filler type '" + m_strType +
"'");
179#pragma warning restore 1591
209 return "positive_unitball";
215 throw new Exception(
"Unknown filler type '" +
type.ToString() +
"'");
222 [Description(
"Specifies the value used by 'constant' filler.")]
225 get {
return m_fVal; }
226 set { m_fVal =
value; }
232 [Description(
"Specifies the minimum value to use with the 'uniform' filler.")]
235 get {
return m_fMin; }
236 set { m_fMin =
value; }
242 [Description(
"Specifies the maximum value to use with the 'uniform' filler.")]
245 get {
return m_fMax; }
246 set { m_fMax =
value; }
252 [Description(
"Specifies the mean value to use with the 'gaussian' filler.")]
255 get {
return m_fMean; }
256 set { m_fMean =
value; }
262 [Description(
"Specifies the standard deviation value to use with the 'gaussian' filler.")]
265 get {
return m_fStd; }
266 set { m_fStd =
value; }
272 [Description(
"Specifies the sparcity value to use with the 'guassian' filler.")]
275 get {
return m_nSparse; }
276 set { m_nSparse =
value; }
282 [Description(
"Specifies the variance normalization method to use with the 'xavier' and 'mrsa' fillers.")]
285 get {
return m_varianceNorm; }
286 set { m_varianceNorm =
value; }
297 p.m_strType = m_strType;
303 p.m_nSparse = m_nSparse;
304 p.m_varianceNorm = m_varianceNorm;
320 if (
type.ToLower() ==
"constant")
323 if (
type.ToLower() ==
"uniform")
329 if (
type.ToLower() ==
"gaussian")
338 if (
type.ToLower() ==
"xavier" ||
339 type.ToLower() ==
"mrsa")
342 return new RawProto(strName,
"", rgChildren);
354 if ((strVal = rp.
FindValue(
"type")) ==
null)
355 throw new Exception(
"Could not find 'type'");
359 if ((strVal = rp.
FindValue(
"value")) !=
null)
362 if ((strVal = rp.
FindValue(
"min")) !=
null)
365 if ((strVal = rp.
FindValue(
"max")) !=
null)
368 if ((strVal = rp.
FindValue(
"mean")) !=
null)
371 if ((strVal = rp.
FindValue(
"std")) !=
null)
374 if ((strVal = rp.
FindValue(
"sparse")) !=
null)
375 p.
sparse =
int.Parse(strVal);
377 if ((strVal = rp.
FindValue(
"variance_norm")) !=
null)
394 throw new Exception(
"Unknown 'variance_norm' value: " + strVal);
401 object ICloneable.
Clone()
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.
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
Specifies the filler parameters used to create each Filler.
double min
Specifies the minimum value to use with the 'uniform' filler.
double max
Specifies the maximum value to use with the 'uniform' filler.
double value
Specifies the value used by 'constant' filler.
int sparse
Specifies the sparcity value to use with the 'guassian' filler.
VarianceNorm
Defines the variance normalization.
double mean
Specifies the mean value to use with the 'gaussian' 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.
VarianceNorm variance_norm
Specifies the variance normalization method to use with the 'xavier' and 'mrsa' fillers.
string type
Specifies the type of filler to use.
double std
Specifies the standard deviation value to use with the 'gaussian' filler.
static string GetFillerName(FillerType type)
Queries the filler text name corresponding to the FillerType.
FillerType
Defines the type of filler.
FillerParameter(string strType="gaussian", double dfVal=0.0, double dfMean=0.0, double dfStd=1.0)
Filler parameter constructor
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-...