2using System.Collections.Generic;
20 [TypeConverter(typeof(ExpandableObjectConverter))]
24 bool m_bBalanceMatches =
true;
25 int m_nCacheSize = 256;
26 bool m_bOutputLabels =
true;
27 int m_nLabelCount = 0;
28 int m_nLabelStart = 0;
44 [Description(
"Specifies the cache size used for each labeled image cache, which should be at least 4 x the batch size used (default = 256).")]
47 get {
return m_nCacheSize; }
48 set { m_nCacheSize = value; }
57 [Description(
"Specifies the 'k' number of negatively matched labled images (default = 0, maximum = 10). When specifying 0, the output is just the anchor and a negatively matched image.")]
67 [Description(
"Specifies to balance the matching image between negative and positive matches. This setting only applies when k=0 (default = true).")]
70 get {
return m_bBalanceMatches; }
71 set { m_bBalanceMatches = value; }
85 [Description(
"Specifies whether or not to output the labels in an additional top output where labels are organized in the same batch order and listed by tuplet order (e.g. when k = 0, balance_matches = true; anchor, positive, anchor, negative; when k = 1, anchor, positive, negative, etc")]
88 get {
return m_bOutputLabels; }
89 set { m_bOutputLabels = value; }
95 [Description(
"Specifies the number of labels in the data set, or 0 to use dynamic label discovery (requires large enough batch sizes to cover all labels within first batch) - (default = 0).")]
98 get {
return m_nLabelCount; }
99 set { m_nLabelCount = value; }
105 [Description(
"Specifies the first label in the label set (default = 0).")]
108 get {
return m_nLabelStart; }
109 set { m_nLabelStart = value; }
118 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
136 m_nCacheSize = p.m_nCacheSize;
138 m_bOutputLabels = p.m_bOutputLabels;
139 m_nLabelStart = p.m_nLabelStart;
140 m_nLabelCount = p.m_nLabelCount;
141 m_bBalanceMatches = p.m_bBalanceMatches;
165 rgChildren.
Add(
"k",
k.ToString());
171 return new RawProto(strName,
"", rgChildren);
184 if ((strVal = rp.
FindValue(
"cache_size")) !=
null)
187 if ((strVal = rp.
FindValue(
"k")) !=
null)
188 p.
k =
int.Parse(strVal);
190 if ((strVal = rp.
FindValue(
"output_labels")) !=
null)
193 if ((strVal = rp.
FindValue(
"label_count")) !=
null)
196 if ((strVal = rp.
FindValue(
"label_start")) !=
null)
199 if ((strVal = rp.
FindValue(
"balance_matches")) !=
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 LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the DataSequenceLayer.
int label_count
Specifies the number of labels in the data set, or 0 to use dynamic label discovery (requires large e...
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
int cache_size
Specifies the cache size used for each labeled image cache, which should be at least 4 x the batch si...
int k
Specifies the 'k' number of negatively matched labled images (default = 0, maximum = 10)....
static DataSequenceParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
bool balance_matches
Specifies to balance the matching image between negative and positive matches. This setting only appl...
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
int label_start
Specifies the first label in the label set (default = 0).
DataSequenceParameter()
Constructor for the parameter.
bool output_labels
Specifies whether or not to output the labels in an additional top output. (default = true).
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.param.beta parameters are used by the MyCaffe.layer.beta layers.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...