MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.gym.CurveGym Class Reference

The Curve Gym provides a simulation of continuous curve such as Sin or Cos. More...

Inheritance diagram for MyCaffe.gym.CurveGym:
MyCaffe.gym.IXMyCaffeGym

Public Types

enum  ACTION { MOVEUP , MOVEDN }
 Defines the actions to perform. More...
 
enum  CURVE_TYPE { SIN , COS , RANDOM }
 Defines the curve types. More...
 

Public Member Functions

 CurveGym ()
 The constructor. More...
 
void Dispose ()
 Release all resources used. More...
 
void Initialize (Log log, PropertySet properties)
 Initialize the gym with the specified properties. More...
 
IXMyCaffeGym Clone (PropertySet properties=null)
 Create a new copy of the gym. More...
 
Dictionary< string, int > GetActionSpace ()
 Returns the action space as a dictionary of name,actionid pairs. More...
 
void Close ()
 Shutdown and close the gym. More...
 
Tuple< Bitmap, SimpleDatumRender (bool bShowUi, int nWidth, int nHeight, bool bGetAction)
 Render the gym's current state on a bitmap and SimpleDatum. More...
 
Tuple< Bitmap, SimpleDatumRender (bool bShowUi, int nWidth, int nHeight, double[] rgData, bool bGetAction)
 Render the gyms specified data. More...
 
Tuple< State, double, bool > Reset (bool bGetLabel, PropertySet props=null)
 Reset the state of the gym. More...
 
Tuple< State, double, bool > Step (int nAction, bool bGetLabel, PropertySet propExtra=null)
 Step the gym one step in its simulation. More...
 
DatasetDescriptor GetDataset (DATA_TYPE dt, Log log=null)
 Returns the dataset descriptor of the dynamic dataset produced by the Gym. More...
 

Properties

bool RequiresDisplayImage [get]
 Returns false indicating that this Gym does not require a display image. More...
 
DATA_TYPE SelectedDataType [get]
 Returns the selected data type. More...
 
DATA_TYPE[] SupportedDataType [get]
 Returns the data types supported by this gym. More...
 
string Name [get]
 Returns the gym's name. More...
 
int UiDelay [get]
 Returns the delay to use (if any) when the user-display is visible. More...
 
double TestingPercent [get]
 Returns the testinng percent of -1, which then uses the default of 0.2. More...
 
- Properties inherited from MyCaffe.gym.IXMyCaffeGym
string Name [get]
 Returns the name of the gym. More...
 
int UiDelay [get]
 Returns the user-interface delay to use (if any). More...
 
DATA_TYPE SelectedDataType [get]
 Returns the selected data-type. More...
 
DATA_TYPE[] SupportedDataType [get]
 Returns an array of data types supported by the gym. More...
 
bool RequiresDisplayImage [get]
 Returns whether or not the gym requires the display image. More...
 
double TestingPercent [get]
 Returns the percentage of the data to use for testing, or -1 which then uses the default of 0.2. More...
 

Detailed Description

The Curve Gym provides a simulation of continuous curve such as Sin or Cos.

Definition at line 18 of file CurveGym.cs.

Member Enumeration Documentation

◆ ACTION

Defines the actions to perform.

Enumerator
MOVEUP 

Move the cart left.

MOVEDN 

Move the cart right.

Definition at line 55 of file CurveGym.cs.

◆ CURVE_TYPE

Defines the curve types.

Enumerator
SIN 

Specifies to use a Sin curve as the target.

COS 

Specifies to use a Cos curve as the target.

RANDOM 

Specifies to use a Random curve as the target.

Definition at line 70 of file CurveGym.cs.

Constructor & Destructor Documentation

◆ CurveGym()

MyCaffe.gym.CurveGym.CurveGym ( )

The constructor.

Definition at line 89 of file CurveGym.cs.

Member Function Documentation

◆ Clone()

IXMyCaffeGym MyCaffe.gym.CurveGym.Clone ( PropertySet  properties = null)

Create a new copy of the gym.

Parameters
propertiesOptionally, specifies the properties to initialize the new copy with.
Returns
The new Gym copy is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 149 of file CurveGym.cs.

◆ Close()

void MyCaffe.gym.CurveGym.Close ( )

Shutdown and close the gym.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 223 of file CurveGym.cs.

◆ Dispose()

void MyCaffe.gym.CurveGym.Dispose ( )

Release all resources used.

Definition at line 108 of file CurveGym.cs.

◆ GetActionSpace()

Dictionary< string, int > MyCaffe.gym.CurveGym.GetActionSpace ( )

Returns the action space as a dictionary of name,actionid pairs.

Returns
The action space is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 211 of file CurveGym.cs.

◆ GetDataset()

DatasetDescriptor MyCaffe.gym.CurveGym.GetDataset ( DATA_TYPE  dt,
Log  log = null 
)

Returns the dataset descriptor of the dynamic dataset produced by the Gym.

Parameters
dtSpecifies the data-type to use.
logOptionally, specifies the output log to use (default = null).
Returns
The dataset descriptor is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 573 of file CurveGym.cs.

◆ Initialize()

void MyCaffe.gym.CurveGym.Initialize ( Log  log,
PropertySet  properties 
)

Initialize the gym with the specified properties.

Parameters
logSpecifies the output log to use.
propertiesSpecifies the properties containing Gym specific initialization parameters.

The AtariGym uses the following initialization properties. Init1=value - specifies the default force to use. Init2=value - specifies whether to use an additive force (1) or not (0).

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 131 of file CurveGym.cs.

◆ Render() [1/2]

Tuple< Bitmap, SimpleDatum > MyCaffe.gym.CurveGym.Render ( bool  bShowUi,
int  nWidth,
int  nHeight,
bool  bGetAction 
)

Render the gym's current state on a bitmap and SimpleDatum.

Parameters
bShowUiWhen true the Bitmap is drawn.
nWidthSpecifies the width used to size the Bitmap.
nHeightSpecifies the height used to size the Bitmap.
bGetActionWhen true the action data is returned as a SimpleDatum.
Returns
A tuple optionally containing a Bitmap and/or Simpledatum is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 235 of file CurveGym.cs.

◆ Render() [2/2]

Tuple< Bitmap, SimpleDatum > MyCaffe.gym.CurveGym.Render ( bool  bShowUi,
int  nWidth,
int  nHeight,
double[]  rgData,
bool  bGetAction 
)

Render the gyms specified data.

Parameters
bShowUiWhen true the Bitmap is drawn.
nWidthSpecifies the width used to size the Bitmap.
nHeightSpecifies the height used to size the Bitmap.
rgDataSpecifies the gym data to render.
bGetActionWhen true the action data is returned as a SimpleDatum.
Returns
A tuple optionally containing a Bitmap and/or Simpledatum is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 263 of file CurveGym.cs.

◆ Reset()

Tuple< State, double, bool > MyCaffe.gym.CurveGym.Reset ( bool  bGetLabel,
PropertySet  props = null 
)

Reset the state of the gym.

Parameters
bGetLabelNot used.
propsOptionally, specifies the property set to use.
Returns
A tuple containing state data, the reward, and the done state is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 420 of file CurveGym.cs.

◆ Step()

Tuple< State, double, bool > MyCaffe.gym.CurveGym.Step ( int  nAction,
bool  bGetLabel,
PropertySet  propExtra = null 
)

Step the gym one step in its simulation.

Parameters
nActionSpecifies the action to run on the gym.
bGetLabelNot used.
propExtraOptionally, specifies extra parameters.
Returns
A tuple containing state data, the reward, and the done state is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 482 of file CurveGym.cs.

Property Documentation

◆ Name

string MyCaffe.gym.CurveGym.Name
get

Returns the gym's name.

Definition at line 186 of file CurveGym.cs.

◆ RequiresDisplayImage

bool MyCaffe.gym.CurveGym.RequiresDisplayImage
get

Returns false indicating that this Gym does not require a display image.

Definition at line 162 of file CurveGym.cs.

◆ SelectedDataType

DATA_TYPE MyCaffe.gym.CurveGym.SelectedDataType
get

Returns the selected data type.

Definition at line 170 of file CurveGym.cs.

◆ SupportedDataType

DATA_TYPE [] MyCaffe.gym.CurveGym.SupportedDataType
get

Returns the data types supported by this gym.

Definition at line 178 of file CurveGym.cs.

◆ TestingPercent

double MyCaffe.gym.CurveGym.TestingPercent
get

Returns the testinng percent of -1, which then uses the default of 0.2.

Definition at line 202 of file CurveGym.cs.

◆ UiDelay

int MyCaffe.gym.CurveGym.UiDelay
get

Returns the delay to use (if any) when the user-display is visible.

Definition at line 194 of file CurveGym.cs.


The documentation for this class was generated from the following file: