Qualia  0.2
Public Member Functions | Public Attributes | List of all members
GradientFunction Class Referenceabstract

#include <GradientFunction.h>

Inheritance diagram for GradientFunction:
Inheritance graph
[legend]
Collaboration diagram for GradientFunction:
Collaboration graph
[legend]

Public Member Functions

 GradientFunction ()
 
virtual ~GradientFunction ()
 
virtual void clearDelta ()
 Clears the derivatives. More...
 
virtual unsigned int nParams () const =0
 Returns the number of parameters. More...
 
virtual void backpropagate (real *outputError)=0
 Backpropagates the error, updating the derivatives. More...
 
virtual void update ()=0
 Updates the weights according to the derivatives. More...
 
virtual void save (XFile *file)
 Saves the model to a file. More...
 
virtual void load (XFile *file)
 Loads the model from a file. More...
 
- Public Member Functions inherited from Function
 Function ()
 
virtual ~Function ()
 
virtual void init ()
 Initializes the function. More...
 
virtual unsigned nInputs () const =0
 Returns the number of inputs. More...
 
virtual unsigned nOutputs () const =0
 Returns the number of outputs. More...
 
virtual void setInputs (const real *input)
 Sets the value of the inputs. More...
 
virtual void getOutputs (real *output) const
 Get the value of the outputs. More...
 
virtual void setInput (int i, real x)=0
 Sets input i to value x. More...
 
virtual float getOutput (int i) const =0
 Get output i. More...
 
virtual void propagate ()=0
 Propagates inputs to outputs. More...
 

Public Attributes

realweights
 The weights (parameters) of the gradient function. More...
 
realdWeights
 The derivatives of the weights. More...
 

Detailed Description

Abstract class for gradient functions, such as a NeuralNetwork. A GradientFunction has a set of parameters (weights) and error derivatives. It can back-propagate the errors to compute the derivatives and udpate its weights accordingly.

Constructor & Destructor Documentation

GradientFunction::GradientFunction ( )
inline
virtual GradientFunction::~GradientFunction ( )
inlinevirtual

Member Function Documentation

virtual void GradientFunction::backpropagate ( real outputError)
pure virtual

Backpropagates the error, updating the derivatives.

Implemented in NeuralNetwork, and QFunction.

virtual void GradientFunction::clearDelta ( )
inlinevirtual

Clears the derivatives.

virtual void GradientFunction::load ( XFile file)
inlinevirtual

Loads the model from a file.

Implements Function.

Reimplemented in NeuralNetwork, and QFunction.

virtual unsigned int GradientFunction::nParams ( ) const
pure virtual

Returns the number of parameters.

Implemented in NeuralNetwork, and QFunction.

virtual void GradientFunction::save ( XFile file)
inlinevirtual

Saves the model to a file.

Implements Function.

Reimplemented in NeuralNetwork, and QFunction.

virtual void GradientFunction::update ( )
pure virtual

Updates the weights according to the derivatives.

Implemented in NeuralNetwork, and QFunction.

Member Data Documentation

real* GradientFunction::dWeights

The derivatives of the weights.

real* GradientFunction::weights

The weights (parameters) of the gradient function.


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