2using System.Collections.Generic;
26 [TypeConverter(typeof(ExpandableObjectConverter))]
32 float m_fDropoutRatio = 0.05f;
33 int? m_nContextDim =
null;
34 bool m_bBatchFirst =
true;
64 [Description(
"Specifies the activation type to use (default=ELU)")]
67 get {
return m_activaiton; }
68 set { m_activaiton = value; }
74 [Description(
"Specifies the input dimension.")]
77 get {
return m_nInputDim; }
78 set { m_nInputDim = value; }
84 [Description(
"Specifies the hidden dimension.")]
87 get {
return m_nHiddenDim; }
88 set { m_nHiddenDim = value; }
94 [Description(
"Specifies the output dimension.")]
97 get {
return m_nOutputDim; }
98 set { m_nOutputDim = value; }
104 [Description(
"Specifies the context dimension, or null to ignore.")]
107 get {
return m_nContextDim; }
108 set { m_nContextDim = value; }
114 [Description(
"Specifies the dropout ratio (default = 0.05 or 5%).")]
117 get {
return m_fDropoutRatio; }
118 set { m_fDropoutRatio = value; }
124 [Description(
"Specifies the batch_first setting.")]
127 get {
return m_bBatchFirst; }
128 set { m_bBatchFirst = value; }
134 [Category(
"Fillers")]
135 [Description(
"The filler for the weights.")]
138 get {
return m_fillerParam_weights; }
139 set { m_fillerParam_weights = value; }
145 [Category(
"Fillers")]
146 [Description(
"The filler for the bias.")]
149 get {
return m_fillerParam_bias; }
150 set { m_fillerParam_bias = value; }
158 [Description(
"Specifies the first axis to be lumped into a single inner product computation; all preceding axes are retained in the output.")]
161 get {
return m_nAxis; }
162 set { m_nAxis = value; }
166 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
191 if (p.m_fillerParam_bias !=
null)
192 m_fillerParam_bias = p.m_fillerParam_bias.
Clone();
194 if (p.m_fillerParam_weights !=
null)
195 m_fillerParam_weights = p.m_fillerParam_weights.
Clone();
229 rgChildren.
Add(
"axis",
axis.ToString());
232 return new RawProto(strName,
"", rgChildren);
245 if ((strVal = rp.
FindValue(
"input_dim")) !=
null)
248 if ((strVal = rp.
FindValue(
"hidden_dim")) !=
null)
251 if ((strVal = rp.
FindValue(
"output_dim")) !=
null)
254 if ((strVal = rp.
FindValue(
"context_dim")) !=
null)
257 if ((strVal = rp.
FindValue(
"dropout_ratio")) !=
null)
260 if ((strVal = rp.
FindValue(
"batch_first")) !=
null)
264 if (rpWeightFiller !=
null)
268 if (rpBiasFiller !=
null)
271 if ((strVal = rp.
FindValue(
"axis")) !=
null)
272 p.
axis =
int.Parse(strVal);
274 if ((strVal = rp.
FindValue(
"activation")) !=
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.
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 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.
Specifies the parameters for the GluLayer (Gated Linear Unit).
Specifies the parameters for the GrnLayer (Gated Response Network).
int? context_dim
Specifies the context dimension, or null to ignore.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
FillerParameter weight_filler
The filler for the weights.
int output_dim
Specifies the output dimension.
bool batch_first
Specifies the batch_first setting.
static GrnParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
int input_dim
Specifies the input dimension.
ACTIVATION
Defines the activation type.
FillerParameter bias_filler
The filler for the bias.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
float dropout_ratio
Specifies the dropout ratio (default = 0.05 or 5%).
int hidden_dim
Specifies the input dimension.
ACTIVATION activation
Specifies the activation type to use (default=ELU)
int axis
Specifies the first axis to be lumped into a single inner product computation; all preceding axes are...
GrnParameter()
Constructor for 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-...