2using System.Collections.Generic;
15 [TypeConverter(typeof(ExpandableObjectConverter))]
28 string m_strDbgIdxFile;
105 get {
return m_nSeed; }
106 set { m_nSeed = value; }
112 [Description(
"Specifies data source input type.")]
115 get {
return m_inputType; }
116 set { m_inputType = value; }
122 [Description(
"Specifies the vocabulary type to use.")]
125 get {
return m_vocabType; }
126 set { m_vocabType = value; }
132 [Description(
"Specifies the sampling method used when post processing logits (default = ARGMAX).")]
135 get {
return m_sampleMethod; }
136 set { m_sampleMethod = value; }
142 [Description(
"Specifies the data source based on the INPUT_TYPE used. Each dataset has both a training and testing data source.")]
145 get {
return m_strSource; }
146 set { m_strSource = value; }
152 [Description(
"Specifies an optional data index file used for debuging only.")]
155 get {
return m_strDbgIdxFile; }
156 set { m_strDbgIdxFile = value; }
162 [Description(
"Specifies batch size.")]
165 get {
return m_nBatchSize; }
166 set { m_nBatchSize = value; }
174 get {
return m_nBlockSize; }
175 set { m_nBlockSize = value; }
179 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
229 rgChildren.
Add(
"source",
"\"" +
source +
"\"");
237 rgChildren.
Add(
"seed",
seed.ToString());
239 return new RawProto(strName,
"", rgChildren);
253 if (rpPython !=
null)
256 if ((strVal = rp.
FindValue(
"block_size")) !=
null)
259 if ((strVal = rp.
FindValue(
"batch_size")) !=
null)
262 if ((strVal = rp.
FindValue(
"source")) !=
null)
263 p.
source = strVal.Trim(
'\"');
265 if ((strVal = rp.
FindValue(
"seed")) !=
null)
266 p.
seed =
int.Parse(strVal);
268 if ((strVal = rp.
FindValue(
"debug_index_file")) !=
null)
271 if ((strVal = rp.
FindValue(
"input_type")) !=
null)
273 if (strVal ==
INPUT_TYPE.TEXT_FILE.ToString())
275 else if (strVal ==
INPUT_TYPE.CUSTOM.ToString())
278 throw new Exception(
"Unknown input type '" + strVal +
"'");
281 if ((strVal = rp.
FindValue(
"vocabulary_type")) !=
null)
292 throw new Exception(
"Unknown vocabulary type '" + strVal +
"'");
295 if ((strVal = rp.
FindValue(
"sample_method")) !=
null)
302 throw new Exception(
"Unknown sample method '" + 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.
RawProto FindChild(string strName)
Searches for a given node.
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 TokenizedDataLayer.
string debug_index_file
Specifies an optional data index file used for debugging only.
SAMPLE_METHOD sample_method
Specifies the sampling method used when post processing logits (default = ARGMAX).
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
INPUT_TYPE input_type
Specifies data source input type.
PythonParameter python_param
Specifies the PythonParameter used by the python implementation of the TokenizedDataPairsLayer,...
string source
Specifies the data source based on the INPUT_TYPE used. Each dataset has both a training and testing ...
uint block_size
Specifies size of the block.
uint batch_size
The number of heads used.
static TokenizedDataParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
SAMPLE_METHOD
Defines the sampling method used.
VOCABULARY_TYPE vocabulary_type
Specifies the vocabulary type to use.
int? seed
Specifies the seed used to initialize the random number generator (normally only for testing).
INPUT_TYPE
Defines the input type used.
PythonParameter m_pythonParam
Python layer implementations use this parameter for Python specific settings such as the location of ...
TokenizedDataParameter()
Constructor for the parameter.
VOCABULARY_TYPE
Defines the vocabulary type to use.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
Specifies the parameters for the PythonLayer.
static PythonParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
@ CUSTOM
Defines a purely custom training method.
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-...