2using System.Collections.Generic;
18 [TypeConverter(typeof(ExpandableObjectConverter))]
21 string m_strSource =
null;
24 List<BlobShape> m_rgExpectedTopShapes =
new List<BlobShape>();
39 [Description(
"Specifies the data source.")]
42 get {
return m_strSource; }
43 set { m_strSource = value; }
49 [Description(
"Specifies the batch size of images to collect and train on each iteration of the network. NOTE: Setting the training netorks batch size >= to the testing net batch size will conserve memory by allowing the training net to share its gpu memory with the testing net.")]
52 get {
return m_nBatchSize; }
59 if (args.
Error !=
null)
70 [Description(
"Specifies the expected top shapes. Only used to verify input shapes, if the shape is -1 or does not exist the verification test is ignored for the shape.")]
73 get {
return m_rgExpectedTopShapes; }
74 set { m_rgExpectedTopShapes = value; }
80 [Description(
"Specifies whether to shuffle the data or now.")]
83 get {
return m_bShuffle; }
84 set { m_bShuffle = value; }
88 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
103 m_strSource = p.m_strSource;
104 m_nBatchSize = p.m_nBatchSize;
105 m_bShuffle = p.m_bShuffle;
107 m_rgExpectedTopShapes =
new List<BlobShape>();
108 foreach (
BlobShape shape
in p.m_rgExpectedTopShapes)
110 m_rgExpectedTopShapes.Add(shape.
Clone());
131 rgChildren.
Add(
"source",
"\"" +
source +
"\"");
133 rgChildren.
Add(
"shuffle",
shuffle.ToString());
135 for (
int i = 0; i < m_rgExpectedTopShapes.Count; i++)
137 rgChildren.
Add(m_rgExpectedTopShapes[i].
ToProto(
"expected_top_shape"));
140 return new RawProto(strName,
"", rgChildren);
156 if ((strVal = rp.
FindValue(
"source")) !=
null)
157 p.source = strVal.Trim(
'\"');
159 if ((strVal = rp.
FindValue(
"batch_size")) !=
null)
160 p.batch_size = uint.Parse(strVal);
162 if ((strVal = rp.
FindValue(
"shuffle")) !=
null)
163 p.shuffle =
bool.Parse(strVal);
165 p.m_rgExpectedTopShapes =
new List<BlobShape>();
167 foreach (
RawProto rp1
in colExpectedTopShapes)
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.
RawProtoCollection FindChildren(params string[] rgstrName)
Searches for all children with a given name in this node's children.
Specifies the shape of a Blob.
BlobShape Clone()
Creates a copy of the BlobShape.
static BlobShape FromProto(RawProto rp)
Parse a new BlobShape from a RawProto.
Specifies the parameter for the HDF5 data layer.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
string source
Specifies the data source.
virtual uint batch_size
Specifies the batch size.
HDF5DataParameter()
Constructor for the parameter.
static HDF5DataParameter FromProto(RawProto rp, HDF5DataParameter p=null)
Parses the parameter from a RawProto.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
bool shuffle
Specifies the whether to shuffle the data or now.
EventHandler< VerifyBatchSizeArgs > OnVerifyBatchSize
This event is, optionally, called to verify the batch size of the HDF5DataParameter.
List< BlobShape > expected_top_shapes
Specifies the expected top shapes. Only used to verify input shapes, if the shape is -1 or does not e...
The LayerParameterBase is the base class for all other layer specific parameters.
The VerifyBatchSizeArgs class defines the arguments of the OnVerifyBatchSize event.
Exception Error
Get/set the error value. For example if the receiver of the event determines that the batch size is i...
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-...