2using System.Collections.Generic;
24 [TypeConverter(typeof(ExpandableObjectConverter))]
28 double m_dfClippingThreshold = 0;
31 uint m_nBatchSize = 1;
32 bool m_bEnableClockworkForgetGateBias =
false;
42 [Description(
"Specifies the number of outputs for the layer.")]
45 get {
return m_nNumOutput; }
46 set { m_nNumOutput = value; }
52 [Description(
"Specifies the gradient clipping threshold, default = 0.0 (i.e. no clipping).")]
55 get {
return m_dfClippingThreshold; }
56 set { m_dfClippingThreshold = value; }
62 [Description(
"Specifies the filler parameters for the weight filler.")]
63 [TypeConverter(typeof(ExpandableObjectConverter))]
66 get {
return m_fillerWeights; }
67 set { m_fillerWeights = value; }
73 [Description(
"Specifies the filler parameters for the bias filler.")]
74 [TypeConverter(typeof(ExpandableObjectConverter))]
77 get {
return m_fillerBias; }
78 set { m_fillerBias = value; }
84 [Description(
"Specifies the batch size, default = 1.")]
87 get {
return m_nBatchSize; }
88 set { m_nBatchSize = value; }
97 [Description(
"When true, the forget gate bias is set to 5.0 as recommended by [1] Koutnik, J., Greff, K., Gomez, F., Schmidhuber, J., 'A Clockwork RNN', 2014")]
100 get {
return m_bEnableClockworkForgetGateBias; }
101 set { m_bEnableClockworkForgetGateBias = value; }
105 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
121 m_nNumOutput = p.m_nNumOutput;
122 m_dfClippingThreshold = p.m_dfClippingThreshold;
123 m_fillerWeights = p.m_fillerWeights.
Clone();
124 m_fillerBias = p.m_fillerBias.
Clone();
125 m_nBatchSize = p.m_nBatchSize;
145 rgChildren.
Add(
"num_output", m_nNumOutput.ToString());
147 if (m_dfClippingThreshold != 0)
148 rgChildren.
Add(
"clipping_threshold", m_dfClippingThreshold.ToString());
150 rgChildren.
Add(m_fillerWeights.
ToProto(
"weight_filler"));
151 rgChildren.
Add(m_fillerBias.
ToProto(
"bias_filler"));
153 if (m_nBatchSize != 1)
154 rgChildren.
Add(
"batch_size", m_nBatchSize.ToString());
156 if (m_bEnableClockworkForgetGateBias !=
false)
157 rgChildren.
Add(
"enable_clockwork_forgetgate_bias", m_bEnableClockworkForgetGateBias.ToString());
159 return new RawProto(strName,
"", rgChildren);
172 if ((strVal = rp.
FindValue(
"num_output")) !=
null)
175 if ((strVal = rp.
FindValue(
"clipping_threshold")) !=
null)
179 if (rpWeightFiller !=
null)
183 if (rpBiasFiller !=
null)
186 if ((strVal = rp.
FindValue(
"batch_size")) !=
null)
189 if ((strVal = rp.
FindValue(
"enable_clockwork_forgetgate_bias")) !=
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.
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.
[DEPRECIATED - use LSTMAttentionParameter instead with enable_attention = false] Specifies the parame...
LSTMSimpleParameter()
Constructor for the parameter.
double clipping_threshold
Specifies the gradient clipping threshold, default = 0.0 (i.e. no clipping).
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
FillerParameter weight_filler
Specifies the filler parameters for the weight filler.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
static LSTMSimpleParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
uint num_output
Specifies the number of outputs for the layer.
FillerParameter bias_filler
Specifies the filler parameters for the bias filler.
uint batch_size
Specifies the batch size, default = 1.
bool enable_clockwork_forgetgate_bias
When enabled, the forget gate bias is set to 5.0.
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-...