2using System.Collections.Generic;
18 [TypeConverter(typeof(ExpandableObjectConverter))]
21 string m_strSource =
null;
23 uint m_nNumHistoricalSteps;
24 uint m_nNumFutureSteps;
26 Phase? m_forcedPhase =
null;
27 double m_dfMaxLoadPercent = 1;
28 uint m_nChunkCount = 1024;
29 int m_nDripRefreshRate = 0;
31 bool m_bShuffleData =
true;
32 bool m_bOutputTargetHistorical =
false;
33 bool m_bEnableDebugOutput =
false;
34 string m_strDebugOutputPath =
null;
80 get {
return m_bEnableDebugOutput; }
81 set { m_bEnableDebugOutput = value; }
89 get {
return m_strDebugOutputPath; }
90 set { m_strDebugOutputPath = value; }
96 [Description(
"Optionally, specifies to output a top containing the target historical data.")]
99 get {
return m_bOutputTargetHistorical; }
100 set { m_bOutputTargetHistorical = value; }
106 [Description(
"Optionally, specifies the phase to use when loading data.")]
109 get {
return m_forcedPhase; }
110 set { m_forcedPhase = value; }
116 [Description(
"Specifies to randomly select from the data (default = true).")]
119 get {
return m_bShuffleData; }
120 set { m_bShuffleData = value; }
129 [Description(
"Specifies the number of items to load per cycle when background loading (default = 1024).")]
132 get {
return m_nChunkCount; }
133 set { m_nChunkCount = value; }
139 [Description(
"Specifies the random seed used to shuffle the data. When not specified, the default seed is used.")]
142 get {
return m_nSeed; }
143 set { m_nSeed = value; }
149 [Description(
"Specifies the maximum percent of data rows to load (default = 1.0 = 100%).")]
152 get {
return m_dfMaxLoadPercent; }
153 set { m_dfMaxLoadPercent = value; }
159 [Description(
"Specifies rate the drip refresh occurs in seconds (default = 0, disabled).")]
162 get {
return m_nDripRefreshRate; }
163 set { m_nDripRefreshRate= value; }
169 [Description(
"Specifies the type of source data.")]
172 get {
return m_srcType; }
173 set { m_srcType = value; }
182 [Description(
"Specifies the data source.")]
185 get {
return m_strSource; }
186 set { m_strSource = value; }
192 [Description(
"Specifies the batch size the data.")]
195 get {
return m_nBatchSize; }
196 set { m_nBatchSize = value; }
202 [Description(
"Specifies the number of historical steps.")]
205 get {
return m_nNumHistoricalSteps; }
206 set { m_nNumHistoricalSteps = value; }
212 [Description(
"Specifies the number of future steps.")]
215 get {
return m_nNumFutureSteps; }
216 set { m_nNumFutureSteps = value; }
220 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
289 rgChildren.
Add(
"seed",
seed.Value.ToString());
294 return new RawProto(strName,
"", rgChildren);
307 if ((strVal = rp.
FindValue(
"batch_size")) !=
null)
310 if ((strVal = rp.
FindValue(
"source")) !=
null)
313 if ((strVal = rp.
FindValue(
"source_type")) !=
null)
315 if (strVal ==
SOURCE_TYPE.PATH_NPY_FILE.ToString())
320 throw new Exception(
"Unknown source_type '" + strVal +
"'!");
323 if ((strVal = rp.
FindValue(
"num_historical_steps")) !=
null)
326 if ((strVal = rp.
FindValue(
"num_future_steps")) !=
null)
329 if ((strVal = rp.
FindValue(
"max_load_percent")) !=
null)
332 if ((strVal = rp.
FindValue(
"drip_refresh_rate_in_sec")) !=
null)
335 if ((strVal = rp.
FindValue(
"chunk_count")) !=
null)
341 if ((strVal = rp.
FindValue(
"seed")) !=
null)
342 p.
seed = uint.Parse(strVal);
344 if ((strVal = rp.
FindValue(
"shuffle_data")) !=
null)
347 if ((strVal = rp.
FindValue(
"forced_phase")) !=
null)
349 if (strVal ==
Phase.TRAIN.ToString())
351 else if (strVal ==
Phase.TEST.ToString())
353 else if (strVal ==
Phase.RUN.ToString())
356 throw new Exception(
"Unknown forced_phase '" + strVal +
"'!");
359 if ((strVal = rp.
FindValue(
"output_target_historical")) !=
null)
362 if ((strVal = rp.
FindValue(
"enable_debug_output")) !=
null)
365 if ((strVal = rp.
FindValue(
"debug_output_path")) !=
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 DataTemporalLayer (used in TFT models).
bool shuffle_data
Specifies to randomly select from the data (default = true).
SOURCE_TYPE
Defines the type of source data.
bool enable_debug_output
Optionally, specifies to output debug information (slower) on each pass.
string debug_output_path
Specifies the debug output path where debug images are placed when enable_debug_output = true.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
virtual uint batch_size
Specifies the batch size of the data.
int drip_refresh_rate_in_sec
Specifies rate the drip refresh occurs in seconds (default = 0, disabled).
uint num_historical_steps
Specifies the number of historical steps
uint num_future_steps
Specifies the number of future steps
double max_load_percent
Specifies the maximum percent of data rows to load (default = 1.0 = 100%).
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
Phase? forced_phase
Optionally, specifies the phase to use when loading data.
static DataTemporalParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
string source
Specifies the data source.
uint chunk_count
Specifies the number of items to load per cycle when background loading (default = 1024).
DataTemporalParameter()
Constructor for the parameter.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
bool output_target_historical
Optionally, specifies to output a top containing the target historical data.
uint? seed
Specifies the random seed used to shuffle the data. When not specified, the default seed is used.
SOURCE_TYPE source_type
Specifies the type of source data.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Phase
Defines the Phase under which to run a Net.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...