GClasses
|
A special context object for recurrent blocks.
#include <GBlock.h>
Public Member Functions | |
GContextRecurrent (GRand &rand, GBlockRecurrent &block) | |
virtual | ~GContextRecurrent () |
void | backPropThroughTime (const GVec &input, const GVec &output, const GVec &outBlame, GVec &inBlame) |
void | forwardProp (const GVec &input, GVec &output) |
void | forwardPropThroughTime (const GVec &input, GVec &output) |
virtual void | resetState () override |
Resets the state of all recurrent blocks. (This is called whenever a recurrent neural network begins with a new sequence, either for training or testing.) More... | |
void | updateGradient (const GVec &input, const GVec &outBlame, GVec &gradient) const |
Public Member Functions inherited from GClasses::GContext | |
GContext (GRand &rand) | |
virtual | ~GContext () |
Public Attributes | |
GBlockRecurrent & | m_block |
GVec | m_bogusBlame |
std::vector< GContextRecurrentInstance * > | m_contextHistory |
std::vector< GContextRecurrentInstance * > | m_contextSpares |
GVec | m_emptyBlame |
std::vector< GVec * > | m_inputHistory |
std::vector< GVec * > | m_inputSpares |
size_t | m_pos |
Public Attributes inherited from GClasses::GContext | |
GRand & | m_rand |
GClasses::GContextRecurrent::GContextRecurrent | ( | GRand & | rand, |
GBlockRecurrent & | block | ||
) |
|
virtual |
void GClasses::GContextRecurrent::backPropThroughTime | ( | const GVec & | input, |
const GVec & | output, | ||
const GVec & | outBlame, | ||
GVec & | inBlame | ||
) |
|
overridevirtual |
Resets the state of all recurrent blocks. (This is called whenever a recurrent neural network begins with a new sequence, either for training or testing.)
Implements GClasses::GContext.
void GClasses::GContextRecurrent::updateGradient | ( | const GVec & | input, |
const GVec & | outBlame, | ||
GVec & | gradient | ||
) | const |
GBlockRecurrent& GClasses::GContextRecurrent::m_block |
GVec GClasses::GContextRecurrent::m_bogusBlame |
std::vector<GContextRecurrentInstance*> GClasses::GContextRecurrent::m_contextHistory |
std::vector<GContextRecurrentInstance*> GClasses::GContextRecurrent::m_contextSpares |
GVec GClasses::GContextRecurrent::m_emptyBlame |
std::vector<GVec*> GClasses::GContextRecurrent::m_inputHistory |
std::vector<GVec*> GClasses::GContextRecurrent::m_inputSpares |
size_t GClasses::GContextRecurrent::m_pos |