4using System.Collections.Generic;
8using System.Runtime.Serialization;
10using System.Threading.Tasks;
134 Tuple<State, double, bool>
Step(
int nAction,
bool bGetLabel =
false,
PropertySet extraProp =
null);
143 Tuple<Bitmap, SimpleDatum>
Render(
bool bShowUi,
int nWidth,
int nHeight,
bool bGetAction);
153 Tuple<Bitmap, SimpleDatum>
Render(
bool bShowUi,
int nWidth,
int nHeight,
double[] rgData,
bool bGetAction);
241 List<double> m_rgdfPredicted =
null;
242 List<string> m_rgstrPredicted =
null;
243 List<bool> m_rgbEmphasize =
null;
255 public DataPoint(
float[] rgfInputs,
float[] rgfMask,
float fTarget, List<double> rgdfPredicted, List<string> rgstrPredicted, List<bool> rgbEmphasize,
float fTime)
257 m_rgfInputs = rgfInputs;
262 m_rgdfPredicted = rgdfPredicted;
263 m_rgstrPredicted = rgstrPredicted;
264 m_rgbEmphasize = rgbEmphasize;
272 get {
return m_rgfInputs; }
280 get {
return m_rgfMask; }
288 get {
return m_fTarget; }
296 get {
return m_rgdfPredicted; }
304 get {
return m_rgstrPredicted; }
312 get {
return m_rgbEmphasize; }
320 get {
return m_fTime; }
329 return new DataPoint(m_rgfInputs, m_rgfMask, m_fTarget,
Utility.Clone<
double>(m_rgdfPredicted),
Utility.Clone<
string>(m_rgstrPredicted),
Utility.Clone<
bool>(m_rgbEmphasize), m_fTime);
364 public virtual bool HasClip {
get {
return false; } }
373 public virtual bool HasLabel {
get {
return false; } }
The Log class provides general output in text form.
Specifies a key-value pair of properties.
The SimpleDatum class holds a data input within host memory.
The Utility class provides general utility funtions.
The DatasetDescriptor class describes a dataset which contains both a training data source and testin...
The DataPoint contains the data used when training.
List< bool > PredictedEmphasize
Returns the predicted labels to emphasize.
float Target
Returns the target value.
float Time
Returns the time for the data point.
DataPoint Clone()
Copies the data point to a new data point.
float[] Inputs
Returns the inputs.
DataPoint(float[] rgfInputs, float[] rgfMask, float fTarget, List< double > rgdfPredicted, List< string > rgstrPredicted, List< bool > rgbEmphasize, float fTime)
The constructor.
float[] Mask
Returns the mask where a value of 1 indicates that the input at that same location is valid.
List< double > Predicted
Returns the predicted values.
List< string > PredictedLabels
Returns the predicted labels.
The State class defines an abstract base class for the state information and gym data.
abstract State Clone()
Copies the state to another new state.
virtual SimpleDatum GetLabel()
Get the label data (used with recurrent models such as LSTM with dynamic data).
virtual bool HasLabel
Returns 'true' if this state supports label data.
virtual SimpleDatum GetClip()
Get the clip data (used with recurrent models such as LSTM).
virtual bool HasClip
Returns 'true' if this State supports clip data.
List< DataPoint > History
Returns the history of the previous points if provided by the gym.
List< DataPoint > m_rgPrevPoints
Contains the history of the previous target points.
abstract SimpleDatum GetData(bool bNormalize, out int nDataLen)
Get the data.
The IXMyCaffeGym interface is used to interact with each Gym.
byte[] ConvertOutput(Stage stage, int nN, float[] rg, out string type)
Converts the output values into the native type used by the Gym during queries.
Phase ActivePhase
Specifies the active phase under which to get the data reset and next.
The IXMyCaffeGym interface is used to interact with each Gym.
DatasetDescriptor GetDataset(DATA_TYPE dt, Log log=null)
Returns the dataset of the gym.
string Name
Returns the name of the gym.
Tuple< Bitmap, SimpleDatum > Render(bool bShowUi, int nWidth, int nHeight, bool bGetAction)
Render the gym on a bitmap.
Tuple< State, double, bool > Step(int nAction, bool bGetLabel=false, PropertySet extraProp=null)
Run an action on the gym.
DATA_TYPE[] SupportedDataType
Returns an array of data types supported by the gym.
int UiDelay
Returns the user-interface delay to use (if any).
Tuple< State, double, bool > Reset(bool bGetLabel=false, PropertySet props=null)
Resets the state of they gym.
double TestingPercent
Returns the percentage of the data to use for testing, or -1 which then uses the default of 0....
DATA_TYPE SelectedDataType
Returns the selected data-type.
Dictionary< string, int > GetActionSpace()
Returns a dictionary containing the action space where each entry contains the action name and action...
void Initialize(Log log, PropertySet properties)
Initialize the gym using the properties in the PropertySet.
Tuple< Bitmap, SimpleDatum > Render(bool bShowUi, int nWidth, int nHeight, double[] rgData, bool bGetAction)
Render the gym on a bitmap.
void Close()
Close a previously initialized gym.
IXMyCaffeGym Clone(PropertySet properties=null)
Copy a gym creating a new one.
bool RequiresDisplayImage
Returns whether or not the gym requires the display image.
The IXMyCaffeGymRange interface is used to query the data range for the vocabulary.
bool UseFixedVocabulary
Returns true to use the fixed bucket collection based on the GetDataRange values, otherwise the bucke...
Tuple< double, double > GetDataRange()
Returns the data range of the gym which is used to build the vocabulary.
int VocabularySize
Returns the vocabulary size to use (e.g. the number of buckets).
bool UsePreLoadData
Specifies whether or not to use the pre-load data.
The descriptors namespace contains all descriptor used to describe various items stored within the da...
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Phase
Defines the Phase under which to run a Net.
DATA_TYPE
Defines the gym data type.
Stage
Specifies the stage underwhich to run a custom trainer.
The MyCaffe.gym namespace contains all classes related to the Gym's supported by MyCaffe.
GYM_SRC_TRAIN_ID
Defines the Standard GYM Training Data Source ID's.
GYM_DS_ID
Defines the Standard GYM Dataset ID's.
@ CURVE
Specifies the Curve GYM Dataset ID.
@ DATAGENERAL
Specifies the Standard DATAGENERAL GYM Dataset ID.
@ MODEL
Specifies the Standard MODEL GYM Dataset ID.
@ ATARI
Specifies the Standard ATARI GYM Dataset ID.
@ CARTPOLE
Specifies the Standard CARTPOLE GYM Dataset ID.
GYM_SRC_TEST_ID
Defines the Standard GYM Testing Data Source ID's.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...