#include <invertmotornstep.h>
Inherits InvertMotorController.
Inherited by Deprivation, ProActive, and ProActive2.
Inheritance diagram for InvertMotorNStep:
Public Member Functions | |
InvertMotorNStep (const InvertMotorNStepConf &conf=getDefaultConf()) | |
virtual void | init (int sensornumber, int motornumber) |
initialisation of the controller with the given sensor/ motornumber Must be called before use. | |
virtual | ~InvertMotorNStep () |
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 controller values to a given file. | |
virtual bool | restore (FILE *f) |
loads the controller values from a given file. | |
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 | calcCandHUpdatesTeaching (matrix::Matrix &C_update, matrix::Matrix &H_update, int y_delay) |
calculates the Update for C and H using the teaching signal | |
void | getLastMotors (motor *motors, int len) |
Static Public Member Functions | |
InvertMotorNStepConf | 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 void | calcCandHUpdates (matrix::Matrix &C_update, matrix::Matrix &H_update, int y_delay) |
calculates the Update for C and H | |
virtual void | updateCandH (const matrix::Matrix &C_update, const matrix::Matrix &H_update, double squashSize) |
updates the matrix C and H | |
virtual void | learnModel (int delay) |
learn A, (and S) using motors y and corresponding sensors x | |
virtual matrix::Matrix | model (const matrix::Matrix *x_buffer, int delay, const matrix::Matrix &y) |
calculates the predicted sensor values | |
virtual matrix::Matrix | calculateControllerValues (const matrix::Matrix &x_smooth) |
returns controller output for given sensor values | |
matrix::Matrix | calcDerivatives (const matrix::Matrix *buffer, int delay) |
Calculates first and second derivative and returns both in on matrix (above). | |
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 derivatives to sensors) | |
matrix::Matrix | C |
Controller Matrix. | |
matrix::Matrix | H |
Controller Bias. | |
matrix::Matrix | B |
Model Bias. | |
NoiseGenerator * | BNoiseGen |
Noisegenerator for noisy bias. | |
matrix::Matrix | R |
C*A. | |
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 | |
InvertMotorNStepConf | conf |
Implements standart parameters: eps, rho, mu, stepnumber4avg, stepnumber4delay
|
|
|
|
|
calculates the Update for C and H
|
|
calculates the Update for C and H using the teaching signal
|
|
Calculates first and second derivative and returns both in on matrix (above). We use simple discrete approximations:
where we have to go into the past because we do not have f(x+1). The scaling can be neglegted. |
|
calculates the first shift into the motor space useing delayed motor values.
|
|
returns controller output for given sensor values
|
|
calculates xsi for the current time step using the delayed y values
Reimplemented in ProActive, and ProActive2.
|
|
puts the sensors in the ringbuffer, generate controller values and put them in the
|
|
Reimplemented in ProActive, and ProActive2.
|
|
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.
Reimplemented in ProActive, and ProActive2.
|
|
Implements Inspectable.
Reimplemented in ProActive, and ProActive2.
|
|
|
|
returns the mumber of motors the controller was initialised with or 0 if not initialised
Reimplemented from AbstractController.
|
|
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.
Reimplemented in ProActive, and ProActive2.
|
|
learn H,C with motors y and corresponding sensors x
Reimplemented in Deprivation.
|
|
learn A, (and S) using motors y and corresponding sensors x
|
|
calculates the predicted sensor values
|
|
loads the controller values from a given file.
Implements Storeable.
|
|
|
|
|
|
performs one step (includes learning). Calulates motor commands from sensor inputs. Reimplemented from AbstractController.
Reimplemented in ProActive, and ProActive2.
|
|
performs one step without learning. Calulates motor commands from sensor inputs.
Reimplemented from AbstractController.
Reimplemented in ProActive, and ProActive2.
|
|
stores the controller values to a given file.
Implements Storeable.
|
|
updates the matrix C and H
Reimplemented in ProActive.
|
|
Model Matrix (motors to sensors).
|
|
Model Bias.
|
|
Noisegenerator for noisy bias.
|
|
Controller Matrix.
|
|
|
|
|
|
Controller Bias.
|
|
|
|
|
|
if the modelling error (xsi) is too high we have a pain signal
|
|
C*A.
|
|
additional Model Matrix (sensors derivatives to sensors)
|
|
small identity matrix in the dimension of R
|
|
|
|
|
|
current output error
|
|
norm of matrix
|
|
average norm of xsi (used to define whether Modell learns)
|
|
|
|
teaching motor signal
|
|
|