GClasses
GClasses::GContextRecurrent Class Reference

Detailed Description

A special context object for recurrent blocks.

#include <GBlock.h>

Inheritance diagram for GClasses::GContextRecurrent:
GClasses::GContext

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

GBlockRecurrentm_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
GRandm_rand
 

Constructor & Destructor Documentation

GClasses::GContextRecurrent::GContextRecurrent ( GRand rand,
GBlockRecurrent block 
)
virtual GClasses::GContextRecurrent::~GContextRecurrent ( )
virtual

Member Function Documentation

void GClasses::GContextRecurrent::backPropThroughTime ( const GVec input,
const GVec output,
const GVec outBlame,
GVec inBlame 
)
void GClasses::GContextRecurrent::forwardProp ( const GVec input,
GVec output 
)
void GClasses::GContextRecurrent::forwardPropThroughTime ( const GVec input,
GVec output 
)
virtual void GClasses::GContextRecurrent::resetState ( )
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

Member Data Documentation

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