2using System.Collections.Generic;
14 [TypeConverter(typeof(ExpandableObjectConverter))]
21 uint m_nLabelChannels = 1;
22 uint m_nLabelHeight = 1;
23 uint m_nLabelWidth = 1;
24 uint m_nClipLength1 = 0;
25 uint m_nClipLength2 = 0;
27 bool m_bPrimaryData =
true;
37 [Category(
"Data Selection"), Description(
"Specifies whether or not this data is the primary dataset as opposed to the target dataset. By default, this is set to 'true'.")]
40 get {
return m_bPrimaryData; }
41 set { m_bPrimaryData = value; }
47 [Category(
"Labels"), Description(
"Specifies the label type: SINGLE - the default which uses the 'Label' field, or MULTIPLE - which uses the 'DataCriteria' field.")]
50 get {
return m_labelType; }
51 set { m_labelType = value; }
57 [Description(
"Batch size.")]
60 get {
return m_nBatchSize; }
61 set { m_nBatchSize = value; }
67 [Description(
"The number of channels in the data.")]
70 get {
return m_nDataChannels; }
71 set { m_nDataChannels = value; }
77 [Description(
"Specifies the height of the data.")]
80 get {
return m_nDataHeight; }
81 set { m_nDataHeight = value; }
87 [Description(
"Specifies the width of the data.")]
90 get {
return m_nDataWidth; }
91 set { m_nDataWidth = value; }
97 [Description(
"The number of channels in the label (default = 1).")]
100 get {
return m_nLabelChannels; }
101 set { m_nLabelChannels = value; }
107 [Description(
"Specifies the height of the label (default = 1).")]
110 get {
return m_nLabelHeight; }
111 set { m_nLabelHeight = value; }
117 [Description(
"Specifies the width of the label (default = 1).")]
120 get {
return m_nLabelWidth; }
121 set { m_nLabelWidth = value; }
131 [Description(
"Specifies the first clip length used with LSTM layers (default = 0, which means unused)")]
134 get {
return m_nClipLength1; }
135 set { m_nClipLength1 = value; }
145 [Description(
"Specifies the second clip length used with LSTM layers (default = 0, which means unused)")]
148 get {
return m_nClipLength2; }
149 set { m_nClipLength2 = value; }
153 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
168 m_nBatchSize = p.m_nBatchSize;
169 m_nDataChannels = p.m_nDataChannels;
170 m_nDataHeight = p.m_nDataHeight;
171 m_nDataWidth = p.m_nDataWidth;
172 m_nLabelChannels = p.m_nLabelChannels;
173 m_nLabelHeight = p.m_nLabelHeight;
174 m_nLabelWidth = p.m_nLabelWidth;
175 m_labelType = p.m_labelType;
176 m_bPrimaryData = p.m_bPrimaryData;
177 m_nClipLength1 = p.m_nClipLength1;
178 m_nClipLength2 = p.m_nClipLength2;
200 rgChildren.
Add(
"height",
height.ToString());
201 rgChildren.
Add(
"width",
width.ToString());
212 if (m_nClipLength1> 0)
213 rgChildren.
Add(
"clip_length1", m_nClipLength1.ToString());
215 if (m_nClipLength2 > 0)
216 rgChildren.
Add(
"clip_length2", m_nClipLength2.ToString());
218 return new RawProto(strName,
"", rgChildren);
231 if ((strVal = rp.
FindValue(
"batch_size")) !=
null)
232 p.m_nBatchSize = uint.Parse(strVal);
234 if ((strVal = rp.
FindValue(
"channels")) !=
null)
237 if ((strVal = rp.
FindValue(
"height")) !=
null)
238 p.
height = uint.Parse(strVal);
240 if ((strVal = rp.
FindValue(
"width")) !=
null)
241 p.
width = uint.Parse(strVal);
243 if ((strVal = rp.
FindValue(
"label_channels")) !=
null)
246 if ((strVal = rp.
FindValue(
"label_height")) !=
null)
249 if ((strVal = rp.
FindValue(
"label_width")) !=
null)
252 if ((strVal = rp.
FindValue(
"label_type")) !=
null)
269 throw new Exception(
"Unknown 'label_type' value " + strVal);
273 if ((strVal = rp.
FindValue(
"primary_data")) !=
null)
276 if ((strVal = rp.
FindValue(
"clip_length1")) !=
null)
278 int nVal =
int.Parse(strVal);
285 if ((strVal = rp.
FindValue(
"clip_length2")) !=
null)
287 int nVal =
int.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.
The LayerParameterBase is the base class for all other layer specific parameters.
LABEL_TYPE
Defines the label type.
Specifies the parameters used by the MemoryDataLayer.
uint batch_size
Batch size.
uint clip_length1
Specifies the clip length 1 (default = 0, which means unused).
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
uint clip_length2
Specifies the clip length 2 (default = 0, which means unused).
bool primary_data
(optional, default = true) Specifies whether or not the data is the primary datset as opposed to a se...
uint width
The width of the data.
LABEL_TYPE label_type
(optional, default = SINGLE) Specifies the label type: SINGLE - the default which uses the 'Label' fi...
MemoryDataParameter()
Constructor for the parameter.
uint label_height
The height of the label.
uint label_width
The width of the label.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
static MemoryDataParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
uint channels
The number of channels in the data.
uint label_channels
The number of channels in the label.
uint height
The height of the data.
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-...