2using System.Collections.Generic;
14 [TypeConverter(typeof(ExpandableObjectConverter))]
17 uint m_nRandomSkip = 0;
18 bool m_bShuffle =
false;
19 uint m_nNewHeight = 0;
21 bool m_bIsColor =
true;
22 string m_strRootFolder =
"";
33 [Description(
"Specifies the amount for the image data layer to skip a few points to avoid all asynchronous sgd clients to start at the same point. The skip point should be set as rand_skip * rand(0,1). Note that the rand_skip should not be larger than the number of keys in the database.")]
36 get {
return m_nRandomSkip; }
37 set { m_nRandomSkip = value; }
43 [Description(
"Specifies whether or not the ImageLayer should shuffle the list of files at each epoch.")]
46 get {
return m_bShuffle; }
47 set { m_bShuffle = value; }
53 [Description(
"When > 0, specifies the new height of the images fed into the network (default = 0).")]
56 get {
return m_nNewHeight; }
57 set { m_nNewHeight = value; }
63 [Description(
"When > 0, specifies the new width of the images fed into the network (default = 0).")]
66 get {
return m_nNewWidth; }
67 set { m_nNewWidth = value; }
73 [Description(
"Specifies whether or not the image is color or gray-scale.")]
76 get {
return m_bIsColor; }
77 set { m_bIsColor = value; }
83 [Description(
"Specifies the folder containing the image files.")]
86 get {
return m_strRootFolder; }
87 set { m_strRootFolder = value; }
91 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
106 m_nRandomSkip = p.m_nRandomSkip;
107 m_bShuffle = p.m_bShuffle;
108 m_nNewHeight = p.m_nNewHeight;
109 m_nNewWidth = p.m_nNewWidth;
110 m_bIsColor = p.m_bIsColor;
111 m_strRootFolder = p.m_strRootFolder;
134 rgChildren.
Add(
"shuffle",
shuffle.ToString());
145 return new RawProto(strName,
"", rgChildren);
161 if ((strVal = rp.
FindValue(
"rand_skip")) !=
null)
162 p.rand_skip = uint.Parse(strVal);
164 if ((strVal = rp.
FindValue(
"shuffle")) !=
null)
165 p.shuffle =
bool.Parse(strVal);
167 if ((strVal = rp.
FindValue(
"new_height")) !=
null)
168 p.new_height = uint.Parse(strVal);
170 if ((strVal = rp.
FindValue(
"new_width")) !=
null)
171 p.new_width = uint.Parse(strVal);
173 if ((strVal = rp.
FindValue(
"is_color")) !=
null)
174 p.is_color =
bool.Parse(strVal);
176 if ((strVal = rp.
FindValue(
"root_folder")) !=
null)
177 p.root_folder = strVal.Trim(
'\"');
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 ImageDataLayer
static ImageDataParameter FromProto(RawProto rp, ImageDataParameter p=null)
Parses the parameter from a RawProto.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
ImageDataParameter()
Constructor for the parameter.
string root_folder
Specifies the folder containing the image files.
bool shuffle
Specifies whether or not the ImageLayer should shuffle the list of files at each epoch.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
uint new_width
When > 0, specifies the new width of the images fed into the network (default = 0).
uint new_height
When > 0, specifies the new height of the images fed into the network (default = 0).
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
uint rand_skip
Specifies the amount for the image data layer to skip a few points to avoid all asynchronous sgd clie...
bool is_color
Specififies whether or not the image is color or gray-scale.
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-...