2using System.Collections.Generic;
20 [TypeConverter(typeof(ExpandableObjectConverter))]
55 List<double> m_rgdfCoeff =
new List<double>();
56 bool m_bStableProdGrad =
true;
57 bool m_bCoeffBlob =
false;
58 bool m_bAllowSingleBatchInput =
false;
68 [Description(
"Specifies the element-wise operation to perform.")]
71 get {
return m_operation; }
72 set { m_operation = value; }
78 [Description(
"Specifies whether to allow single batch input for the second input (default = false).")]
81 get {
return m_bAllowSingleBatchInput; }
82 set { m_bAllowSingleBatchInput = value; }
88 [Description(
"Specifies the blob-wise coefficient for SUM operation.")]
91 get {
return m_rgdfCoeff; }
92 set { m_rgdfCoeff = value; }
99 [Description(
"Specifies whether or not to use an asymtotically slower (for > 2 inputs) but stabler method for computing the gradient for PROD operation (No effect for SUM operation).")]
102 get {
return m_bStableProdGrad; }
103 set { m_bStableProdGrad = value; }
110 [Description(
"If true and EltwiseOp is SUM, the last bottom blob is a singleton coefficient for the first N-1 bottom blobs, with shape (N-1, 1, 1, 1).")]
113 get {
return m_bCoeffBlob; }
114 set { m_bCoeffBlob = value; }
118 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
133 m_operation = p.m_operation;
134 m_rgdfCoeff =
Utility.Clone<
double>(p.m_rgdfCoeff);
135 m_bStableProdGrad = p.m_bStableProdGrad;
136 m_bCoeffBlob = p.m_bCoeffBlob;
158 rgChildren.
Add<
double>(
"coeff",
coeff);
169 return new RawProto(strName,
"", rgChildren);
182 if ((strVal = rp.
FindValue(
"operation")) !=
null)
211 throw new Exception(
"Unknown 'operation' value: " + strVal);
215 p.
coeff = rp.FindArray<
double>(
"coeff");
217 if ((strVal = rp.
FindValue(
"stable_prod_grad")) !=
null)
220 if ((strVal = rp.
FindValue(
"coeff_blob")) !=
null)
223 if ((strVal = rp.
FindValue(
"allow_single_batch_input")) !=
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.
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.
The Utility class provides general utility funtions.
Specifies the parameters for the EltwiseLayer.
EltwiseOp
Defines the operation to perform.
bool allow_single_batch_input
Specifies whether to allow single batch input for the second input (default = false).
EltwiseParameter()
Constructor for the parameter.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
List< double > coeff
Specifies the blob-wise coefficient for SUM operation.
bool stable_prod_grad
Specifies whether or not to use an asymptotically slower (for > 2 inputs) but stabler method of compu...
EltwiseOp operation
Specifies the element-wise operation.
static EltwiseParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
bool coeff_blob
If true and the EltwiseOp is SUM, the last bottom blob is a singleton coefficient for the first N-1 b...
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
The LayerParameterBase is the base class for all other layer specific parameters.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
@ SUB
Specifies to perform a subtraction operation.
@ DIV
Specifies to perform a division operation.
@ PROD
Multiply the values.
@ MIN
Return the minimum value.
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-...