2using System.Collections.Generic;
14 [TypeConverter(typeof(ExpandableObjectConverter))]
17 List<string> m_rgstrSource =
new List<string>();
18 uint m_nBatchSize = 1;
19 uint m_nTimeSteps = 80;
21 uint m_nSampleSize = 1000;
22 bool m_bShuffle =
true;
42 int nBatch = (int)m_nBatchSize;
43 int nInput = (int)m_nInputDim;
45 strInput +=
"input: \"idec\"" + Environment.NewLine;
46 strInput +=
"input_shape { dim: 1 dim: " + nBatch.ToString() +
" dim: 1 } " + Environment.NewLine;
48 strInput +=
"input: \"ienc\"" + Environment.NewLine;
49 strInput +=
"input_shape { dim: " + m_nTimeSteps.ToString() +
" dim: " + nBatch.ToString() +
" dim: " + nInput.ToString() +
" } " + Environment.NewLine;
51 strInput +=
"input: \"iencc\"" + Environment.NewLine;
52 strInput +=
"input_shape { dim: " + m_nTimeSteps.ToString() +
" dim: " + nBatch.ToString() +
" } " + Environment.NewLine;
70 [Description(
"Specifies the data 'sources' within the database. Each source must already have pre-calculated RawImageResult data within the RawImageResults table including both Results for encoder input and ExtraData for decoder input.")]
73 get {
return m_rgstrSource; }
74 set { m_rgstrSource = value; }
80 [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.")]
83 get {
return m_nBatchSize; }
90 if (args.
Error !=
null)
101 [Description(
"Specifies the maximum length for the encoder inputs.")]
104 get {
return m_nTimeSteps; }
105 set { m_nTimeSteps = value; }
111 [Description(
"Specifies the input dimension the encoder inputs.")]
114 get {
return m_nInputDim; }
115 set { m_nInputDim = value; }
121 [Description(
"Specifies the sample size to select from the data sources.")]
124 get {
return m_nSampleSize; }
125 set { m_nSampleSize = value; }
131 [Description(
"Specifies whether to shuffle the data or now.")]
134 get {
return m_bShuffle; }
135 set { m_bShuffle = value; }
139 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
155 m_nBatchSize = p.m_nBatchSize;
156 m_nTimeSteps = p.m_nTimeSteps;
157 m_nInputDim = p.m_nInputDim;
158 m_nSampleSize = p.m_nSampleSize;
159 m_bShuffle = p.m_bShuffle;
179 rgChildren.
Add<
string>(
"source", m_rgstrSource);
184 rgChildren.
Add(
"shuffle",
shuffle.ToString());
186 return new RawProto(strName,
"", rgChildren);
202 p.source = rp.FindArray<
string>(
"source");
204 if ((strVal = rp.
FindValue(
"batch_size")) !=
null)
205 p.batch_size = uint.
Parse(strVal);
207 if ((strVal = rp.
FindValue(
"time_steps")) !=
null)
208 p.time_steps = uint.
Parse(strVal);
210 if ((strVal = rp.
FindValue(
"input_dim")) !=
null)
211 p.input_dim = uint.
Parse(strVal);
213 if ((strVal = rp.
FindValue(
"shuffle")) !=
null)
214 p.shuffle =
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.
The Utility class provides general utility funtions.
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the base parameter for all layers.
List< string > bottom
Specifies the active bottom connections (in the bottom, out the top).
Specifies the parameter for the model data layer.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
bool shuffle
Specifies the whether to shuffle the data or now.
uint time_steps
Specifies the maximum length for each encoder input.
virtual uint batch_size
Specifies the batch size.
override void PrepareRunModel(LayerParameter p)
This method gives derivative classes a chance modify the layer parameter for a run model.
override string PrepareRunModelInputs()
This method gives derivative classes a chance specify model inputs required by the run model.
List< string > source
Specifies the data 'sources' within the database. Each source must already have pre-calculated RawIma...
ModelDataParameter()
Constructor for the parameter.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
uint input_dim
Specifies the input dimension for each encoder input.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
EventHandler< VerifyBatchSizeArgs > OnVerifyBatchSize
This event is, optionally, called to verify the batch size of the TextDataParameter.
static ModelDataParameter FromProto(RawProto rp, ModelDataParameter p=null)
Parses the parameter from a RawProto.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
uint sample_size
Specifies the sample size to select from the data sources.
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-...