MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T > Class Template Reference

The TrainerRNNSimple implements a very simple RNN trainer inspired by adepierre's GitHub site referenced. More...

Inheritance diagram for MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >:
MyCaffe.trainers.IxTrainerRNN MyCaffe.trainers.IxTrainer

Public Member Functions

 TrainerRNNSimple (MyCaffeControl< T > mycaffe, PropertySet properties, CryptoRandom random, IxTrainerCallback icallback, BucketCollection rgVocabulary)
 The constructor. More...
 
void Dispose ()
 Releases all resources used. More...
 
bool Initialize ()
 Initialize the trainer. More...
 
bool Shutdown (int nWait)
 Shutdown the trainer. More...
 
float[] Run (int nN, PropertySet runProp)
 Run a single cycle on the environment after the delay. More...
 
byte[] Run (int nN, PropertySet runProp, out string type)
 Run a single cycle on the environment after the delay. More...
 
bool Test (int nN, ITERATOR_TYPE type)
 Run the test cycle - currently this is not implemented. More...
 
bool Train (int nN, ITERATOR_TYPE type, TRAIN_STEP step)
 Train the network using a modified PG training algorithm optimized for GPU use. More...
 

Detailed Description

The TrainerRNNSimple implements a very simple RNN trainer inspired by adepierre's GitHub site referenced.

See also
1. The Unreasonable Effectiveness of Recurrent Neural Networks, by Andrej Karpathy, 2015, Github.io
2. karpathy/char-rnn sample.lua
3. GitHub: adepierre/caffe-char-rnn, by adepierre, 2017, Github
4. MyCaffe: A Complete C# Re-Write of Caffe with Reinforcement Learning by D. Brown, 2018, arXiv

Definition at line 28 of file TrainerRNNSimple.cs.

Constructor & Destructor Documentation

◆ TrainerRNNSimple()

MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >.TrainerRNNSimple ( MyCaffeControl< T >  mycaffe,
PropertySet  properties,
CryptoRandom  random,
IxTrainerCallback  icallback,
BucketCollection  rgVocabulary 
)

The constructor.

Parameters
mycaffeSpecifies the MyCaffeControl to use for learning and prediction.
propertiesSpecifies the property set containing the key/value pairs of property settings.
randomSpecifies the random number generator to use.
icallbackSpecifies the callback for parent notifications and queries.
rgVocabularySpecifies the vocabulary to use.

The 'bUsePreloadData' parameter has been replaced with a property 'UsePreLoadData'. When this property does not exist, the 'UsePreLoadData' defaults to 'true'.

Definition at line 51 of file TrainerRNNSimple.cs.

Member Function Documentation

◆ Dispose()

Releases all resources used.

Definition at line 64 of file TrainerRNNSimple.cs.

◆ Initialize()

Initialize the trainer.

Returns
Returns true.

Implements MyCaffe.trainers.IxTrainer.

Definition at line 72 of file TrainerRNNSimple.cs.

◆ Run() [1/2]

float[] MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >.Run ( int  nN,
PropertySet  runProp 
)

Run a single cycle on the environment after the delay.

Parameters
nNspecifies the number of samples to run.
runPropOptionally specifies properties to use when running.
Returns
The results of the run containing the action are returned.

Implements MyCaffe.trainers.IxTrainerRNN.

Definition at line 136 of file TrainerRNNSimple.cs.

◆ Run() [2/2]

byte[] MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >.Run ( int  nN,
PropertySet  runProp,
out string  type 
)

Run a single cycle on the environment after the delay.

Parameters
nNSpecifies the number of samples to run.
runPropOptionally specifies properties to use when running.
typeReturns the data type contained in the byte stream.
Returns
The results of the run containing the action are returned as a byte stream.

Implements MyCaffe.trainers.IxTrainerRNN.

Definition at line 149 of file TrainerRNNSimple.cs.

◆ Shutdown()

bool MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >.Shutdown ( int  nWait)

Shutdown the trainer.

Parameters
nWaitSpecifies a wait in ms. for the shutdown to complete.
Returns
Returns true.

Implements MyCaffe.trainers.IxTrainer.

Definition at line 96 of file TrainerRNNSimple.cs.

◆ Test()

bool MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >.Test ( int  nN,
ITERATOR_TYPE  type 
)

Run the test cycle - currently this is not implemented.

Parameters
nNSpecifies the number of iterations (based on the ITERATION_TYPE) to run, or -1 to ignore.
typeSpecifies the iteration type (default = ITERATION).
Returns
A value of true is returned when handled, false otherwise.

Implements MyCaffe.trainers.IxTrainer.

Definition at line 162 of file TrainerRNNSimple.cs.

◆ Train()

bool MyCaffe.trainers.rnn.simple.TrainerRNNSimple< T >.Train ( int  nN,
ITERATOR_TYPE  type,
TRAIN_STEP  step 
)

Train the network using a modified PG training algorithm optimized for GPU use.

Parameters
nNSpecifies the number of iterations (based on the ITERATION_TYPE) to run, or -1 to ignore.
typeSpecifies the iteration type (default = ITERATION).
stepSpecifies the stepping mode to use (when debugging).
Returns
A value of true is returned when handled, false otherwise.

Implements MyCaffe.trainers.IxTrainer.

Definition at line 174 of file TrainerRNNSimple.cs.


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