MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.trainers.dqn.c51.st.Brain< T > Class Template Reference

The Brain uses the instance of MyCaffe (e.g. the open project) to run new actions and train the network. More...

Inheritance diagram for MyCaffe.trainers.dqn.c51.st.Brain< T >:
MyCaffe.trainers.IxTrainerGetDataCallback

Public Member Functions

 Brain (MyCaffeControl< T > mycaffe, PropertySet properties, CryptoRandom random, Phase phase)
 The constructor. More...
 
void Dispose ()
 Release all resources used by the Brain. More...
 
GetDataArgs getDataArgs (Phase phase, int nAction)
 Returns the GetDataArgs used to retrieve new data from the envrionment implemented by derived parent trainer. More...
 
SimpleDatum Preprocess (StateBase s, bool bUseRawInput, out bool bDifferent, bool bReset=false)
 Preprocesses the data. More...
 
int act (SimpleDatum sd, SimpleDatum sdClip, int nActionCount)
 Returns the action from running the model. The action returned is either randomly selected (when using Exploration), or calculated via a forward pass (when using Exploitation). More...
 
bool GetModelUpdated ()
 Get whether or not the model has been udpated or not. More...
 
void UpdateTargetModel ()
 The UpdateTargetModel transfers the trained layers from the active Net to the target Net. More...
 
void Train (int nIteration, MemoryCollection rgSamples, int nActionCount)
 Train the model at the current iteration. More...
 
void OnOverlay (OverlayArgs e)
 The OnOverlay callback is called just before displaying the gym image, thus allowing for an overlay to be applied to the image. More...
 

Properties

int FrameStack [get]
 Specifies the number of frames per X value. More...
 
int BatchSize [get]
 Returns the batch size defined by the model. More...
 
Log Log [get]
 Returns the output log. More...
 
CancelEvent Cancel [get]
 Returns the Cancel event used to cancel all MyCaffe tasks. More...
 

Detailed Description

The Brain uses the instance of MyCaffe (e.g. the open project) to run new actions and train the network.

Template Parameters
TSpecifies the base type, which should be the same base type used for MyCaffe. This type is either double or float.

Definition at line 438 of file TrainerC51.cs.

Constructor & Destructor Documentation

◆ Brain()

MyCaffe.trainers.dqn.c51.st.Brain< T >.Brain ( MyCaffeControl< T >  mycaffe,
PropertySet  properties,
CryptoRandom  random,
Phase  phase 
)

The constructor.

Parameters
mycaffeSpecifies the instance of MyCaffe assoiated with the open project - when using more than one Brain, this is the master project.
propertiesSpecifies the properties passed into the trainer.
randomSpecifies the random number generator used.
phaseSpecifies the phase under which to run.

Definition at line 491 of file TrainerC51.cs.

Member Function Documentation

◆ act()

int MyCaffe.trainers.dqn.c51.st.Brain< T >.act ( SimpleDatum  sd,
SimpleDatum  sdClip,
int  nActionCount 
)

Returns the action from running the model. The action returned is either randomly selected (when using Exploration), or calculated via a forward pass (when using Exploitation).

Parameters
sdSpecifies the data to run the model on.
sdClipSpecifies the clip data (if any exits).
nActionCountReturns the number of actions in the action set.
Returns
The action value is returned.

Definition at line 769 of file TrainerC51.cs.

◆ Dispose()

void MyCaffe.trainers.dqn.c51.st.Brain< T >.Dispose ( )

Release all resources used by the Brain.

Definition at line 567 of file TrainerC51.cs.

◆ getDataArgs()

GetDataArgs MyCaffe.trainers.dqn.c51.st.Brain< T >.getDataArgs ( Phase  phase,
int  nAction 
)

Returns the GetDataArgs used to retrieve new data from the envrionment implemented by derived parent trainer.

Parameters
phaseSpecifies the phase under which to get the data.
nActionSpecifies the action to run, or -1 to reset the environment.
Returns
A new GetDataArgs is returned.

Definition at line 620 of file TrainerC51.cs.

◆ GetModelUpdated()

bool MyCaffe.trainers.dqn.c51.st.Brain< T >.GetModelUpdated ( )

Get whether or not the model has been udpated or not.

Returns
If the model has been updated from the last call to this function, true is returned, otherwise false is returned.

Definition at line 793 of file TrainerC51.cs.

◆ OnOverlay()

void MyCaffe.trainers.dqn.c51.st.Brain< T >.OnOverlay ( OverlayArgs  e)

The OnOverlay callback is called just before displaying the gym image, thus allowing for an overlay to be applied to the image.

Parameters
eSpecifies the arguments to the callback which contains the original display image.

Implements MyCaffe.trainers.IxTrainerGetDataCallback.

Definition at line 1230 of file TrainerC51.cs.

◆ Preprocess()

SimpleDatum MyCaffe.trainers.dqn.c51.st.Brain< T >.Preprocess ( StateBase  s,
bool  bUseRawInput,
out bool  bDifferent,
bool  bReset = false 
)

Preprocesses the data.

Parameters
sSpecifies the state and data to use.
bUseRawInputSpecifies whether or not to use the raw data true, or a difference of the current and previous data false (default = false).
bDifferentReturns whether or not the current state data is different from the previous - note this is only set when NOT using raw input, otherwise true is always returned.
bResetOptionally, specifies to reset the last sd to null.
Returns
The preprocessed data is returned.

Definition at line 666 of file TrainerC51.cs.

◆ Train()

void MyCaffe.trainers.dqn.c51.st.Brain< T >.Train ( int  nIteration,
MemoryCollection  rgSamples,
int  nActionCount 
)

Train the model at the current iteration.

Parameters
nIterationSpecifies the current iteration.
rgSamplesContains the samples to train the model with.
nActionCountSpecifies the number of actions in the action set.

Definition at line 817 of file TrainerC51.cs.

◆ UpdateTargetModel()

void MyCaffe.trainers.dqn.c51.st.Brain< T >.UpdateTargetModel ( )

The UpdateTargetModel transfers the trained layers from the active Net to the target Net.

Definition at line 803 of file TrainerC51.cs.

Property Documentation

◆ BatchSize

int MyCaffe.trainers.dqn.c51.st.Brain< T >.BatchSize
get

Returns the batch size defined by the model.

Definition at line 637 of file TrainerC51.cs.

◆ Cancel

Returns the Cancel event used to cancel all MyCaffe tasks.

Definition at line 653 of file TrainerC51.cs.

◆ FrameStack

int MyCaffe.trainers.dqn.c51.st.Brain< T >.FrameStack
get

Specifies the number of frames per X value.

Definition at line 629 of file TrainerC51.cs.

◆ Log

Returns the output log.

Definition at line 645 of file TrainerC51.cs.


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