2using System.Collections.Generic;
19 [TypeConverter(typeof(ExpandableObjectConverter))]
22 bool? m_bUseGlobalStats =
null;
23 double m_dfMovingAverageFraction = 0.999;
24 double m_dfEps = 1e-5;
25 bool m_bScaleBias =
false;
41 return "The engine setting is set on CAFFE.";
65 [Description(
"Specifies to use the scale and bias terms, otherwise the scale = 1 and bias = 0 which performs an identity operation.")]
68 get {
return m_bScaleBias; }
69 set { m_bScaleBias = value; }
78 [Description(
"Specifies the scale filler used, when null 'constant(1)' is used.")]
81 get {
return m_scaleFiller; }
82 set { m_scaleFiller = value; }
91 [Description(
"Specifies the bias filler used, when null 'constant(0)' is used.")]
94 get {
return m_biasFiller; }
95 set { m_biasFiller = value; }
107 [Description(
"If false, accumulate global mean/variance values via a moving average. If true, use those accumulated values instead of computing mean/variance accross the batch.")]
110 get {
return m_bUseGlobalStats; }
111 set { m_bUseGlobalStats = value; }
123 [Description(
"Specifies how much the moving average decays each iteration.")]
126 get {
return m_dfMovingAverageFraction; }
127 set { m_dfMovingAverageFraction = value; }
134 [Description(
"Specifies a small value to add to the variance estimate so that we don't divide by zero.")]
137 get {
return m_dfEps; }
138 set { m_dfEps = value; }
142 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
161 m_bUseGlobalStats = p.m_bUseGlobalStats;
163 m_dfMovingAverageFraction = p.m_dfMovingAverageFraction;
164 m_bScaleBias = p.m_bScaleBias;
165 m_biasFiller = p.m_biasFiller;
167 if (p.m_scaleFiller !=
null)
168 m_scaleFiller = p.m_scaleFiller.
Clone();
170 m_scaleFiller =
null;
172 if (p.m_biasFiller !=
null)
173 m_biasFiller = p.m_biasFiller.
Clone();
194 RawProto rpBase = base.ToProto(
"engine");
206 rgChildren.
Add(
"eps",
eps.ToString());
219 return new RawProto(strName,
"", rgChildren);
234 if ((strVal = rp.
FindValue(
"use_global_stats")) !=
null)
237 if ((strVal = rp.
FindValue(
"moving_average_fraction")) !=
null)
240 if ((strVal = rp.
FindValue(
"eps")) !=
null)
243 if ((strVal = rp.
FindValue(
"scale_bias")) !=
null)
249 if ((rp1 = rp.
FindChild(
"scale_filler")) !=
null)
252 if ((rp1 = rp.
FindChild(
"bias_filler")) !=
null)
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.
RawProtoCollection Children
Returns a collection of this nodes child nodes.
RawProto FindChild(string strName)
Searches for a given node.
static RawProto Parse(string str)
Parses a prototxt and places it in a new RawProto.
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
Specifies the parameters for the BatchNormLayer.
FillerParameter bias_filler
Specifies the bias filler used to file the bias value. If null, a constant(0) filler is used.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
bool scale_bias
Specifies to use the scale and bias terms, otherwise the scale = 1 and bias = 0 are used to form an i...
double eps
Specifies a small value to add to the variance estimate so that we don't divide by zero.
BatchNormParameter()
Constructor for the parameter.
double moving_average_fraction
Specifies how much the moving average decays each iteration. Smaller values make the moving average d...
string useCaffeReason()
Returns the reason that Caffe version was used instead of NVIDIA's cuDnn.
FillerParameter scale_filler
Specifies the scale filler used to fill the scale value. If null, a constant(1) filler is used.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
bool useCudnn()
Queries whether or not to use NVIDIA's cuDnn.
static new BatchNormParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
bool? use_global_stats
If false, normalization is performed over the current mini-batch and global statistics are accumulate...
Specifies whether to use the NVIDIA cuDnn version or Caffe version of a given forward/backward operat...
Engine engine
Specifies the Engine in use.
EngineParameter()
Constructor for the parameter.
static EngineParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
Engine
Defines the type of engine to use.
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 LayerParameterBase is the base class for all other layer specific parameters.
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-...