2using System.Collections.Generic;
18 [TypeConverter(typeof(ExpandableObjectConverter))]
21 double m_dfDropoutRatio = 0.5;
23 bool m_bActive =
true;
38 return "The engine setting is set on CAFFE.";
41 return "The engine setting is set to DEFAULT and, unlike other layers, the DropoutLayer defaults to use CAFFE.";
61 [Description(
"Specifies the dropout ratio. (e.g. the probability that values will be dropped out and set to zero. A value of 0.25 = 25% chance that a value is set to 0, and dropped out.)")]
64 get {
return m_dfDropoutRatio; }
65 set { m_dfDropoutRatio = value; }
71 [Description(
"Specifies the random number generator seed used with the cuDnn dropout - the default value of '0' uses a random seed.")]
74 get {
return m_lSeed; }
75 set { m_lSeed = value; }
81 [Description(
"Specifies whether or not the dropout is active or not. When inactive and training, the dropout acts the same as it does during testing and is ignored.")]
84 get {
return m_bActive; }
85 set { m_bActive = value; }
89 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
108 m_dfDropoutRatio = p.m_dfDropoutRatio;
110 m_bActive = p.m_bActive;
125 RawProto rpBase = base.ToProto(
"engine");
134 rgChildren.
Add(
"seed",
seed.ToString());
137 rgChildren.
Add(
"active",
active.ToString());
139 return new RawProto(strName,
"", rgChildren);
150 if ((strVal = rp.
FindValue(
"dropout_ratio")) !=
null)
153 if ((strVal = rp.
FindValue(
"seed")) !=
null)
154 p.
seed =
long.Parse(strVal);
156 if ((strVal = rp.
FindValue(
"active")) !=
null)
157 p.
active =
bool.Parse(strVal);
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.
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 of the DropoutLayer.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
string useCaffeReason()
Returns the reason that Caffe version was used instead of NVIDIA's cuDnn.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
DropoutParameter()
Constructor for the parameter.
double dropout_ratio
Specifies the dropout ratio. (e.g. the probability that values will be dropped out and set to zero....
static new DropoutParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
long seed
Specifies the seed used by cuDnn for random number generation.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
bool active
Specifies whether or not the dropout is active or not. When inactive and training,...
bool useCudnn()
Queries whether or not to use NVIDIA's cuDnn.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
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.
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-...