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

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

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

Public Member Functions

 TrainerRNN (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 TrainerRNN implements a 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 26 of file TrainerRNN.cs.

Constructor & Destructor Documentation

◆ TrainerRNN()

MyCaffe.trainers.rnn.simple.TrainerRNN< T >.TrainerRNN ( 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 48 of file TrainerRNN.cs.

Member Function Documentation

◆ Dispose()

Releases all resources used.

Definition at line 61 of file TrainerRNN.cs.

◆ Initialize()

bool MyCaffe.trainers.rnn.simple.TrainerRNN< T >.Initialize ( )

Initialize the trainer.

Returns
Returns true.

Implements MyCaffe.trainers.IxTrainer.

Definition at line 69 of file TrainerRNN.cs.

◆ Run() [1/2]

float[] MyCaffe.trainers.rnn.simple.TrainerRNN< 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 113 of file TrainerRNN.cs.

◆ Run() [2/2]

byte[] MyCaffe.trainers.rnn.simple.TrainerRNN< 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 130 of file TrainerRNN.cs.

◆ Shutdown()

bool MyCaffe.trainers.rnn.simple.TrainerRNN< 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 93 of file TrainerRNN.cs.

◆ Test()

bool MyCaffe.trainers.rnn.simple.TrainerRNN< 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 146 of file TrainerRNN.cs.

◆ Train()

bool MyCaffe.trainers.rnn.simple.TrainerRNN< 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 167 of file TrainerRNN.cs.


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