2using System.Collections.Generic;
17 [TypeConverter(typeof(ExpandableObjectConverter))]
20 uint m_nNumOutput = 0;
21 bool m_bBiasTerm =
true;
25 int m_nMinTopAxes = -1;
26 bool m_bTranspose =
false;
27 bool m_bEnableNoise =
false;
28 double m_dfSigmaInit = 0.017;
29 double m_dfBiasGradScale = 1.0;
30 bool m_bOutputContainsPredictions =
false;
40 [Description(
"Specifies that the output contains predictions and that the output blob is marked as BLOB_TYPE.PREDICTION.")]
43 get {
return m_bOutputContainsPredictions; }
44 set { m_bOutputContainsPredictions = value; }
50 [Description(
"Specifies a scaling value applied to the bias mutliplier and then unapplied after calculating the bias - used to help improve float accuracy (default = 1.0). A value of 1.0 is ignored.")]
53 get {
return m_dfBiasGradScale; }
54 set { m_dfBiasGradScale = value;}
63 [Description(
"Enable/disable noise in the inner-product layer (default = false).")]
66 get {
return m_bEnableNoise; }
67 set { m_bEnableNoise = value; }
73 [Description(
"Specifies the initialization value for the sigma weight and sigma bias used when 'enable_noise' = true.")]
76 get {
return m_dfSigmaInit; }
77 set { m_dfSigmaInit = value; }
83 [Description(
"The number of outputs for the layer.")]
86 get {
return m_nNumOutput; }
87 set { m_nNumOutput = value; }
96 [Description(
"Optionally, specifies the minimum top axes (default = -1, which ignores this setting). NOTE: Deconvolution requies 'min_top_axes' = 4.")]
99 get {
return m_nMinTopAxes; }
100 set { m_nMinTopAxes = value; }
106 [Description(
"Whether to have bias terms or not.")]
109 get {
return m_bBiasTerm; }
110 set { m_bBiasTerm = value; }
116 [Category(
"Fillers")]
117 [Description(
"The filler for the weights.")]
120 get {
return m_fillerParam_weights; }
121 set { m_fillerParam_weights = value; }
127 [Category(
"Fillers")]
128 [Description(
"The filler for the bias.")]
131 get {
return m_fillerParam_bias; }
132 set { m_fillerParam_bias = value; }
140 [Description(
"Specifies the first axis to be lumped into a single inner product computation; all preceding axes are retained in the output.")]
143 get {
return m_nAxis; }
144 set { m_nAxis = value; }
153 [Description(
"Specifies whether to transpose the weight matrix or not.")]
156 get {
return m_bTranspose; }
157 set { m_bTranspose = value; }
161 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
177 m_nNumOutput = p.m_nNumOutput;
178 m_bBiasTerm = p.m_bBiasTerm;
180 if (p.m_fillerParam_bias !=
null)
181 m_fillerParam_bias = p.m_fillerParam_bias.
Clone();
183 if (p.m_fillerParam_weights !=
null)
184 m_fillerParam_weights = p.m_fillerParam_weights.
Clone();
187 m_bTranspose = p.m_bTranspose;
188 m_nMinTopAxes = p.m_nMinTopAxes;
189 m_bEnableNoise = p.m_bEnableNoise;
190 m_dfSigmaInit = p.m_dfSigmaInit;
191 m_dfBiasGradScale = p.m_dfBiasGradScale;
192 m_bOutputContainsPredictions = p.m_bOutputContainsPredictions;
224 rgChildren.
Add(
"axis",
axis.ToString());
234 rgChildren.
Add(
"enable_noise", m_bEnableNoise.ToString());
235 rgChildren.
Add(
"sigma_init", m_dfSigmaInit.ToString());
239 rgChildren.
Add(
"bias_grad_scale", m_dfBiasGradScale.ToString());
241 return new RawProto(strName,
"", rgChildren);
254 if ((strVal = rp.
FindValue(
"output_contains_predictions")) !=
null)
257 if ((strVal = rp.
FindValue(
"num_output")) !=
null)
260 if ((strVal = rp.
FindValue(
"bias_term")) !=
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(
"transpose")) !=
null)
277 if ((strVal = rp.
FindValue(
"min_top_axes")) !=
null)
280 if ((strVal = rp.
FindValue(
"enable_noise")) !=
null)
283 if ((strVal = rp.
FindValue(
"sigma_init")) !=
null)
286 if ((strVal = rp.
FindValue(
"bias_grad_scale")) !=
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.
Specifies the parameters for the InnerProductLayer.
double sigma_init
Specifies the initialization value for the sigma weight and sigma bias used when 'enable_noise' = tru...
FillerParameter weight_filler
The filler for the weights.
int axis
Specifies the first axis to be lumped into a single inner product computation; all preceding axes are...
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
bool enable_noise
Enable/disable noise in the inner-product layer (default = false).
double bias_grad_scale
Specifies a scaling value applied to the bias mutliplier and then unapplied after calculating the bia...
int min_top_axes
Optionally, specifies the minimum top axes (default = -1, which ignores this setting).
bool transpose
Specifies whether to transpose the weight matrix or not. If transpose == true, any operations will be...
FillerParameter bias_filler
The filler for the bias.
uint num_output
The number of outputs for the layer.
InnerProductParameter()
Constructor for the parameter.
bool output_contains_predictions
Specifies that the output contains predictions and that the output blob is marked as BLOB_TYPE....
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
bool bias_term
Whether to have bias terms or not.
static InnerProductParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
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-...