MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.trainers.dqn.noisy.simple.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.noisy.simple.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...
 
void SaveWeights (string strFile)
 Save the weight and bias values to file. More...
 
void LoadWeights (string strFile)
 Load the weight and bias values from file. More...
 

Properties

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 399 of file TrainerNoisyDqn.cs.

Constructor & Destructor Documentation

◆ Brain()

MyCaffe.trainers.dqn.noisy.simple.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 439 of file TrainerNoisyDqn.cs.

Member Function Documentation

◆ act()

int MyCaffe.trainers.dqn.noisy.simple.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 628 of file TrainerNoisyDqn.cs.

◆ Dispose()

Release all resources used by the Brain.

Definition at line 509 of file TrainerNoisyDqn.cs.

◆ getDataArgs()

GetDataArgs MyCaffe.trainers.dqn.noisy.simple.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 554 of file TrainerNoisyDqn.cs.

◆ GetModelUpdated()

bool MyCaffe.trainers.dqn.noisy.simple.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 645 of file TrainerNoisyDqn.cs.

◆ LoadWeights()

void MyCaffe.trainers.dqn.noisy.simple.Brain< T >.LoadWeights ( string  strFile)

Load the weight and bias values from file.

Parameters
strFileSpecifies the file to load the weights from.

Definition at line 1138 of file TrainerNoisyDqn.cs.

◆ OnOverlay()

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 987 of file TrainerNoisyDqn.cs.

◆ Preprocess()

SimpleDatum MyCaffe.trainers.dqn.noisy.simple.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 592 of file TrainerNoisyDqn.cs.

◆ SaveWeights()

void MyCaffe.trainers.dqn.noisy.simple.Brain< T >.SaveWeights ( string  strFile)

Save the weight and bias values to file.

Parameters
strFileSpecifies the file to save the weights to.

Definition at line 1089 of file TrainerNoisyDqn.cs.

◆ Train()

void MyCaffe.trainers.dqn.noisy.simple.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 along with the priorities associated with the samples.
nActionCountSpecifies the number of actions in the action set.

Definition at line 670 of file TrainerNoisyDqn.cs.

◆ UpdateTargetModel()

void MyCaffe.trainers.dqn.noisy.simple.Brain< T >.UpdateTargetModel ( )

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

Definition at line 655 of file TrainerNoisyDqn.cs.

Property Documentation

◆ BatchSize

Returns the batch size defined by the model.

Definition at line 563 of file TrainerNoisyDqn.cs.

◆ Cancel

Returns the Cancel event used to cancel all MyCaffe tasks.

Definition at line 579 of file TrainerNoisyDqn.cs.

◆ Log

Returns the output log.

Definition at line 571 of file TrainerNoisyDqn.cs.


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