#include <dercontroller.h>
Inherits InvertMotorController.
Inheritance diagram for DerController:
Public Member Functions | |
DerController (const DerControllerConf &conf=getDefaultConf()) | |
virtual void | init (int sensornumber, int motornumber) |
initialisation of the controller with the given sensor/ motornumber Must be called before use. | |
virtual | ~DerController () |
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. Calulates motor commands from sensor inputs. | |
virtual bool | store (FILE *f) const |
stores the object to the given file stream (binary). | |
virtual bool | restore (FILE *f) |
loads the object from the given file stream (binary). | |
virtual std::list< iparamkey > | getInternalParamNames () const |
The list of the names of all internal parameters given by getInternalParams(). | |
virtual std::list< iparamval > | getInternalParams () const |
virtual std::list< ILayer > | getStructuralLayers () const |
Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important. | |
virtual std::list< IConnection > | getStructuralConnections () const |
Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important. | |
virtual void | setTeachingMode (bool onOff) |
virtual bool | getTeachingMode () |
virtual void | setMotorTeachingSignal (const motor *teaching, int len) |
void | getLastMotors (motor *motors, int len) |
Static Public Member Functions | |
DerControllerConf | getDefaultConf () |
Protected Member Functions | |
virtual void | fillBuffersAndControl (const sensor *x_, int number_sensors, motor *y_, int number_motors) |
puts the sensors in the ringbuffer, generate controller values and put them in the | |
virtual void | calcEtaAndBufferIt (int delay) |
calculates the first shift into the motor space useing delayed motor values. | |
virtual void | calcXsi (int delay) |
calculates xsi for the current time step using the delayed y values | |
virtual void | learnController () |
learn H,C with motors y and corresponding sensors x | |
virtual matrix::Matrix | model (const matrix::Matrix &x, const matrix::Matrix &y) |
calculates the predicted sensor values | |
virtual void | calcCandHandAUpdates (matrix::Matrix &C_update, matrix::Matrix &H_update, matrix::Matrix &A_update, int y_delay) |
calculates the Update for C, H and A | |
virtual void | updateCandHandA (const matrix::Matrix &C_update, const matrix::Matrix &H_update, const matrix::Matrix &A_update, double squashSize) |
updates the matrices C, H and A | |
virtual matrix::Matrix | calculateControllerValues (const matrix::Matrix &x_smooth) |
calculate controller outputs | |
virtual double | calcMatrixNorm (const matrix::Matrix &m) |
calculates the city block distance (abs) norm of the matrix. (abs sum of absolutes / size of matrix) | |
virtual double | calcErrorFactor (const matrix::Matrix &e, bool loga, bool root) |
calculates the error_factor for either logarithmic (E=ln(e^T*e)) or square (E=sqrt(e^t*e)) error | |
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. | |
Static Protected Member Functions | |
double | squashP (void *d, double z) |
squashing function, to protect against too large weight updates | |
double | q_s (double z, double xsi) |
an exact formula for inversion if neuron. | |
double | q_2s_div_s (double z, double xsi) |
an exact formula for q''/q' | |
Protected Attributes | |
unsigned short | number_sensors |
unsigned short | number_motors |
matrix::Matrix | A |
Model Matrix (motors to sensors). | |
matrix::Matrix | S |
additional Model Matrix (sensors to sensors) | |
matrix::Matrix | C |
Controller Matrix. | |
matrix::Matrix | H |
Controller Bias. | |
matrix::Matrix | B |
Model Bias. | |
NoiseGenerator * | BNoiseGen |
Noisegenerator for noisy bias. | |
NoiseGenerator * | YNoiseGen |
Noisegenerator for noisy motor values. | |
matrix::Matrix | R |
C*A. | |
matrix::Matrix | RRT |
matrix::Matrix | AAT |
matrix::Matrix | Rm1 |
R^-1. | |
matrix::Matrix | SmallID |
small identity matrix in the dimension of R | |
matrix::Matrix | xsi |
current output error | |
double | xsi_norm |
norm of matrix | |
double | xsi_norm_avg |
average norm of xsi (used to define whether Modell learns) | |
double | pain |
if the modelling error (xsi) is too high we have a pain signal | |
matrix::Matrix * | x_buffer |
matrix::Matrix * | y_buffer |
matrix::Matrix * | eta_buffer |
matrix::Matrix | zero_eta |
matrix::Matrix | x_smooth |
matrix::Matrix | y_teaching |
teaching motor signal | |
matrix::Matrix | x_intern |
fantasy sensor values | |
int | fantControl |
interval length for fantasising | |
int | fantControlLen |
length of fantasy control | |
int | fantReset |
number of fantasy control events before reseting internal state | |
DerControllerConf | conf |
Implements standart parameters: eps, rho, mu, stepnumber4avg, stepnumber4delay
|
|
|
|
|
calculates the Update for C, H and A
|
|
calculates the error_factor for either logarithmic (E=ln(e^T*e)) or square (E=sqrt(e^t*e)) error
Reimplemented from InvertMotorController.
|
|
calculates the first shift into the motor space useing delayed motor values.
|
|
calculates the city block distance (abs) norm of the matrix. (abs sum of absolutes / size of matrix)
|
|
calculate controller outputs
|
|
calculates xsi for the current time step using the delayed y values
|
|
puts the sensors in the ringbuffer, generate controller values and put them in the
|
|
|
|
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.
Implements Inspectable.
|
|
Implements Inspectable.
|
|
|
|
returns the mumber of motors the controller was initialised with or 0 if not initialised
Reimplemented from AbstractController.
|
|
returns the value of the requested parameter or 0 (+ error message to stderr) if unknown.
Reimplemented from InvertMotorController.
|
|
The list of all parameters with there value as allocated lists.
Reimplemented from InvertMotorController.
|
|
returns the number of sensors the controller was initialised with or 0 if not initialised
Reimplemented from AbstractController.
|
|
Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important.
Reimplemented from Inspectable.
|
|
Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important. The first entry is the input layer and so on.
Reimplemented from Inspectable.
|
|
|
|
initialisation of the controller with the given sensor/ motornumber Must be called before use.
Reimplemented from AbstractController.
|
|
learn H,C with motors y and corresponding sensors x
|
|
calculates the predicted sensor values
|
|
an exact formula for q''/q'
|
|
an exact formula for inversion if neuron.
|
|
loads the object from the given file stream (binary).
Implements Storeable.
|
|
|
|
sets the value of the given parameter or does nothing if unknown.
Reimplemented from InvertMotorController.
|
|
|
|
squashing function, to protect against too large weight updates
|
|
performs one step (includes learning). Calulates motor commands from sensor inputs. Reimplemented from AbstractController.
|
|
performs one step without learning. Calulates motor commands from sensor inputs.
Reimplemented from AbstractController.
|
|
stores the object to the given file stream (binary).
Implements Storeable.
|
|
updates the matrices C, H and A
|
|
Model Matrix (motors to sensors).
|
|
|
|
Model Bias.
|
|
Noisegenerator for noisy bias.
|
|
Controller Matrix.
|
|
|
|
|
|
interval length for fantasising
|
|
length of fantasy control
|
|
number of fantasy control events before reseting internal state
|
|
Controller Bias.
|
|
|
|
|
|
if the modelling error (xsi) is too high we have a pain signal
|
|
C*A.
|
|
R^-1.
|
|
|
|
additional Model Matrix (sensors to sensors)
|
|
small identity matrix in the dimension of R
|
|
|
|
fantasy sensor values
|
|
|
|
current output error
|
|
norm of matrix
|
|
average norm of xsi (used to define whether Modell learns)
|
|
|
|
teaching motor signal
|
|
Noisegenerator for noisy motor values.
|
|
|