Qualia  0.2
Public Member Functions | Public Attributes | List of all members
QFunction Class Reference

#include <QFunction.h>

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

Public Member Functions

 QFunction (GradientFunction *function, unsigned int observationDim, ActionProperties *actionProperties)
 
virtual ~QFunction ()
 
virtual void init ()
 Initializes the function. More...
 
virtual unsigned int nInputs () const
 Returns the number of inputs. More...
 
virtual unsigned int nOutputs () const
 Returns the number of outputs. More...
 
virtual unsigned int nParams () const
 Returns the number of parameters. More...
 
virtual void setInput (int i, real x)
 Sets input i to value x. More...
 
virtual real getOutput (int i) const
 Get output i. More...
 
virtual void propagate ()
 Propagates inputs to outputs. More...
 
virtual void backpropagate (real *outputError)
 Backpropagates the error, updating the derivatives. More...
 
virtual void update ()
 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...
 
real getValue (const Observation *observation, const Action *action)
 
void getMaxAction (Action *dst, const Observation *observation, real *maxQ=0)
 
- Public Member Functions inherited from GradientFunction
 GradientFunction ()
 
virtual ~GradientFunction ()
 
virtual void clearDelta ()
 Clears the derivatives. More...
 
- Public Member Functions inherited from Function
 Function ()
 
virtual ~Function ()
 
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...
 

Public Attributes

GradientFunction * function
 
real * input
 
unsigned int observationDim
 
ActionProperties * actionProperties
 
- Public Attributes inherited from GradientFunction
real * weights
 The weights (parameters) of the gradient function. More...
 
real * dWeights
 The derivatives of the weights. More...
 

Constructor & Destructor Documentation

QFunction::QFunction ( GradientFunction *  function,
unsigned int  observationDim,
ActionProperties *  actionProperties 
)
QFunction::~QFunction ( )
virtual

Member Function Documentation

virtual void QFunction::backpropagate ( real *  outputError)
inlinevirtual

Backpropagates the error, updating the derivatives.

Implements GradientFunction.

void QFunction::getMaxAction ( Action *  dst,
const Observation *  observation,
real *  maxQ = 0 
)
virtual real QFunction::getOutput ( int  i) const
inlinevirtual

Get output i.

Implements Function.

real QFunction::getValue ( const Observation *  observation,
const Action *  action 
)
virtual void QFunction::init ( )
inlinevirtual

Initializes the function.

Reimplemented from Function.

virtual void QFunction::load ( XFile *  file)
inlinevirtual

Loads the model from a file.

Reimplemented from GradientFunction.

virtual unsigned int QFunction::nInputs ( ) const
inlinevirtual

Returns the number of inputs.

Implements Function.

virtual unsigned int QFunction::nOutputs ( ) const
inlinevirtual

Returns the number of outputs.

Implements Function.

virtual unsigned int QFunction::nParams ( ) const
inlinevirtual

Returns the number of parameters.

Implements GradientFunction.

virtual void QFunction::propagate ( )
inlinevirtual

Propagates inputs to outputs.

Implements Function.

virtual void QFunction::save ( XFile *  file)
inlinevirtual

Saves the model to a file.

Reimplemented from GradientFunction.

virtual void QFunction::setInput ( int  i,
real  x 
)
inlinevirtual

Sets input i to value x.

Implements Function.

virtual void QFunction::update ( )
inlinevirtual

Updates the weights according to the derivatives.

Implements GradientFunction.

Member Data Documentation

ActionProperties* QFunction::actionProperties
GradientFunction* QFunction::function
real* QFunction::input
unsigned int QFunction::observationDim

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