2using System.Collections.Generic;
17 [TypeConverter(typeof(ExpandableObjectConverter))]
20 bool m_bOutMaxVal =
false;
24 bool m_bEnableCudaImplementation =
false;
54 get {
return m_bEnableCudaImplementation; }
55 set { m_bEnableCudaImplementation = value; }
61 [Description(
"Specifies the operation to use (default = MAX).")]
71 [Description(
"If true, produce pairs (argmax, maxval -or- argmin, minval when using 'op' = MIN).")]
74 get {
return m_bOutMaxVal; }
75 set { m_bOutMaxVal = value; }
83 [Description(
"When computing accuracy, count as correct by comparing the true label to the 'top_k' scoring classes. By default, only compare the top scoring classes (i.e. argmax).")]
86 get {
return m_nTopK; }
87 set { m_nTopK = value; }
96 [Description(
"Specifies the axis along which to maximize -- may be negative to index from end (e.g., -1 for the last axis). By default the ArgMaxLayer maximizes over the flattened trailing dimensions for each index of the first / num dimension.")]
99 get {
return m_nAxis; }
100 set { m_nAxis = value; }
104 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
119 m_bOutMaxVal = p.m_bOutMaxVal;
147 rgChildren.
Add(
"top_k",
top_k.ToString());
150 rgChildren.
Add(
"axis",
axis.Value.ToString());
155 rgChildren.
Add(
"enable_cuda_impl", m_bEnableCudaImplementation.ToString());
157 return new RawProto(strName,
"", rgChildren);
170 if ((strVal = rp.
FindValue(
"out_max_val")) !=
null)
173 if ((strVal = rp.
FindValue(
"top_k")) !=
null)
174 p.
top_k = uint.Parse(strVal);
176 if ((strVal = rp.
FindValue(
"axis")) !=
null)
177 p.
axis =
int.Parse(strVal);
179 if ((strVal = rp.
FindValue(
"operation")) !=
null)
187 if ((strVal = rp.
FindValue(
"enable_cuda_impl")) !=
null)
188 p.m_bEnableCudaImplementation =
bool.Parse(strVal);
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.
Specifies the parameters for the ArgMaxLayer
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
bool enable_cuda_impl
Specifies to use the low-level full cuda implementation of LayerNorm (default = false).
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
uint top_k
When computing accuracy, count as correct by comparing the true label to the top_k scoring classes....
override void Copy(LayerParameterBase src)
Copy on parameter to another.
static ArgMaxParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
COMPARE_OPERATOR operation
Specifies the operation to use (default = MAX).
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
bool out_max_val
If true produce pairs (argmax, maxval)
COMPARE_OPERATOR
Defines the compare operator to use (max or min, default = max).
int? axis
The axis along which to maximize – may be negative to index from the end (e.g., -1 for the last axis)...
ArgMaxParameter()
Constructor for the parameter.
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-...