FFNNController Class Reference

class for robot controller that uses the georg's matrixlib for direct matrix inversion for n channels (simple one layer networks) More...

#include <ffnncontroller.h>

Inherits AbstractController.

Inheritance diagram for FFNNController:

Inheritance graph
[legend]
Collaboration diagram for FFNNController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FFNNController (const std::string &networkfilename, int history, bool input_only_x=false)
 networkfilename is the file to load the network from, and history is the number of time steps the network gets input from (in sensce of dimension of input)
virtual void init (int sensornumber, int motornumber)
 initialisation of the controller with the given sensor/ motornumber Must be called before use.
virtual ~FFNNController ()
virtual int getSensorNumber () const
 returns the number of sensors the controller was initialised with or 0 if not initialised
virtual int getMotorNumber () const
 returns the mumber of motors the controller was initialised with or 0 if not initialised
virtual void step (const sensor *, int number_sensors, motor *, int number_motors)
 performs one step (includes learning).
virtual void stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors)
 performs one step without learning.
virtual bool store (FILE *f) const
 stores the controller values to a given file (binary).
virtual bool restore (FILE *f)
 loads the controller values from a given file (binary).
virtual std::list< iparamkeygetInternalParamNames () const
 The list of the names of all internal parameters given by getInternalParams().
virtual std::list< iparamvalgetInternalParams () const
virtual paramval getParam (const paramkey &key) const
 returns the value of the requested parameter or 0 (+ error message to stderr) if unknown.
virtual bool setParam (const paramkey &key, paramval val)
 sets the value of the given parameter or does nothing if unknown.
virtual paramlist getParamList () const
 The list of all parameters with there value as allocated lists.

Protected Member Functions

void putInBuffer (matrix::Matrix *buffer, const matrix::Matrix &vec, int delay=0)
matrix::Matrix calculateSmoothValues (const matrix::Matrix *buffer, int number_steps_for_averaging_) const
 calculate time-smoothed values
matrix::Matrix assembleNetworkInputXY (matrix::Matrix *xbuffer, matrix::Matrix *ybuffer) const
matrix::Matrix assembleNetworkInputX (matrix::Matrix *xbuffer, matrix::Matrix *ybuffer) const

Protected Attributes

unsigned short number_motors
unsigned short number_sensors
unsigned short history
unsigned short buffersize
bool input_only_x
unsigned short s4avg
unsigned int t
matrix::Matrixx_buffer
matrix::Matrixy_buffer
matrix::Matrix x_smooth
MultiLayerFFNNnet
bool initialised

Detailed Description

class for robot controller that uses the georg's matrixlib for direct matrix inversion for n channels (simple one layer networks)

Implements standart parameters: eps, rho, mu, stepnumber4avg, stepnumber4delay


Constructor & Destructor Documentation

FFNNController const std::string &  networkfilename,
int  history,
bool  input_only_x = false
 

networkfilename is the file to load the network from, and history is the number of time steps the network gets input from (in sensce of dimension of input)

Parameters:
input_only_x if true then the input vector is

\[ (x_{t},x_{t-1},...,x_{t-history})^T \]

if false then also the y values are used:

\[ (x_{t}, y_{t-1}, x_{t-1},y_{t-2},...,x_{t-history})^T \]

~FFNNController  )  [virtual]
 


Member Function Documentation

matrix::Matrix assembleNetworkInputX matrix::Matrix xbuffer,
matrix::Matrix ybuffer
const [protected]
 

matrix::Matrix assembleNetworkInputXY matrix::Matrix xbuffer,
matrix::Matrix ybuffer
const [protected]
 

matrix::Matrix calculateSmoothValues const matrix::Matrix buffer,
int  number_steps_for_averaging_
const [protected]
 

calculate time-smoothed values

virtual std::list<iparamkey> getInternalParamNames  )  const [inline, virtual]
 

The list of the names of all internal parameters given by getInternalParams().

The naming convention is "v[i]" for vectors and "A[i][j]" for matrices, where i, j start at 0.

Returns:
: list of keys

Implements Inspectable.

virtual std::list<iparamval> getInternalParams  )  const [inline, virtual]
 

Returns:
: list of values

Implements Inspectable.

virtual int getMotorNumber  )  const [inline, virtual]
 

returns the mumber of motors the controller was initialised with or 0 if not initialised

Reimplemented from AbstractController.

Configurable::paramval getParam const paramkey key  )  const [virtual]
 

returns the value of the requested parameter or 0 (+ error message to stderr) if unknown.

Reimplemented from Configurable.

Configurable::paramlist getParamList  )  const [virtual]
 

The list of all parameters with there value as allocated lists.

Returns:
list of key-value pairs

Reimplemented from Configurable.

virtual int getSensorNumber  )  const [inline, virtual]
 

returns the number of sensors the controller was initialised with or 0 if not initialised

Reimplemented from AbstractController.

void init int  sensornumber,
int  motornumber
[virtual]
 

initialisation of the controller with the given sensor/ motornumber Must be called before use.

Reimplemented from AbstractController.

void putInBuffer matrix::Matrix buffer,
const matrix::Matrix vec,
int  delay = 0
[protected]
 

bool restore FILE *  f  )  [virtual]
 

loads the controller values from a given file (binary).

Implements Storeable.

bool setParam const paramkey key,
paramval  val
[virtual]
 

sets the value of the given parameter or does nothing if unknown.

Reimplemented from Configurable.

void step const sensor ,
int  number_sensors,
motor ,
int  number_motors
[virtual]
 

performs one step (includes learning).

Calculates motor commands from sensor inputs.

Parameters:
sensors sensors inputs scaled to [-1,1]
sensornumber length of the sensor array
motors motors outputs. MUST have enough space for motor values!
motornumber length of the provided motor array

Reimplemented from AbstractController.

void stepNoLearning const sensor ,
int  number_sensors,
motor ,
int  number_motors
[virtual]
 

performs one step without learning.

See also:
step

Reimplemented from AbstractController.

bool store FILE *  f  )  const [virtual]
 

stores the controller values to a given file (binary).

Implements Storeable.


Member Data Documentation

unsigned short buffersize [protected]
 

unsigned short history [protected]
 

bool initialised [protected]
 

bool input_only_x [protected]
 

MultiLayerFFNN* net [protected]
 

unsigned short number_motors [protected]
 

unsigned short number_sensors [protected]
 

unsigned short s4avg [protected]
 

unsigned int t [protected]
 

matrix::Matrix* x_buffer [protected]
 

matrix::Matrix x_smooth [protected]
 

matrix::Matrix* y_buffer [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 16 02:14:46 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8