20 #ifndef __INVERTNCHANNELCONTROLLER_H
21 #define __INVERTNCHANNELCONTROLLER_H
29 #include <selforg/matrix.h>
42 virtual void init(
int sensornumber,
int motornumber,
RandGen* randGen = 0);
55 virtual void step(
const sensor* ,
int number_sensors,
motor* ,
int number_motors);
60 motor* ,
int number_motors);
65 virtual bool store(FILE* f)
const;
102 unsigned int number_steps_of_delay_);
104 unsigned int number_steps_for_averaging_);
112 static double g(
double z)
118 static double g_s(
double z)
130 return clip(z,-0.1,0.1);
Matrix type.
Definition: matrix.h:65
matrix::Matrix L
Definition: invertnchannelcontroller.h:82
std::string paramkey
Definition: configurable.h:85
static double squash(double z)
squashing function, to protect against to large weight updates
Definition: invertnchannelcontroller.h:128
static double g(double z)
neuron transfer function
Definition: invertnchannelcontroller.h:112
virtual paramkey getName() const
returns the name of the object (with version number)
Definition: invertnchannelcontroller.h:47
InvertNChannelController(int _buffersize, bool _update_only_1=false)
Definition: invertnchannelcontroller.cpp:26
int t
Definition: invertnchannelcontroller.h:85
double sensor
Definition: types.h:29
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
unsigned short buffersize
Definition: invertnchannelcontroller.h:76
matrix::Matrix C
Definition: invertnchannelcontroller.h:80
virtual void init(int sensornumber, int motornumber, RandGen *randGen=0)
initialisation of the controller with the given sensor/ motornumber Must be called before use...
Definition: invertnchannelcontroller.cpp:44
virtual double calculateE(const matrix::Matrix &x_delay, const matrix::Matrix &y_delay)
Definition: invertnchannelcontroller.cpp:163
virtual ~InvertNChannelController()
Definition: invertnchannelcontroller.cpp:39
virtual void learn(const matrix::Matrix &x_delay, const matrix::Matrix &y_delay)
learn values h,C
Definition: invertnchannelcontroller.cpp:233
matrix::Matrix * x_buffer
Definition: invertnchannelcontroller.h:83
static double g_s(double z)
Definition: invertnchannelcontroller.h:118
virtual bool restore(FILE *f)
loads the controller values from a given file.
Definition: invertnchannelcontroller.cpp:324
virtual void stepNoLearning(const sensor *, int number_sensors, motor *, int number_motors)
performs one step without learning. Calulates motor commands from sensor inputs.
Definition: invertnchannelcontroller.cpp:86
paramkey name
Definition: invertnchannelcontroller.h:86
class for robot controller that uses the georg's matrixlib for direct matrix inversion for n channels...
Definition: invertnchannelcontroller.h:38
matrix::Matrix * y_buffer
Definition: invertnchannelcontroller.h:84
virtual std::list< IConnection > getStructuralConnections() const
Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The...
Definition: invertnchannelcontroller.cpp:343
double clip(double r, double x)
clipping function for mapP
Definition: controller_misc.cpp:39
virtual matrix::Matrix calculateDelayedValues(const matrix::Matrix *buffer, unsigned int number_steps_of_delay_)
calculate delayed values
Definition: invertnchannelcontroller.cpp:280
unsigned short number_channels
Definition: invertnchannelcontroller.h:75
matrix::Matrix h
Definition: invertnchannelcontroller.h:81
virtual int getMotorNumber() const
returns the mumber of motors the controller was initialised with or 0 if not initialised ...
Definition: invertnchannelcontroller.h:51
matrix::Matrix calculateControllerValues(const matrix::Matrix &x_smooth)
calculate controller outputs
Definition: invertnchannelcontroller.cpp:303
double motor
Definition: types.h:30
virtual bool store(FILE *f) const
stores the controller values to a given file.
Definition: invertnchannelcontroller.cpp:314
virtual void step(const sensor *, int number_sensors, motor *, int number_motors)
performs one step (includes learning).
Definition: invertnchannelcontroller.cpp:66
virtual std::list< ILayer > getStructuralLayers() const
Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering...
Definition: invertnchannelcontroller.cpp:335
virtual matrix::Matrix calculateSmoothValues(const matrix::Matrix *buffer, unsigned int number_steps_for_averaging_)
Definition: invertnchannelcontroller.cpp:287
Abstract class (interface) for robot controller that use direct matrix inversion and simple one layer...
Definition: invertcontroller.h:33
virtual int getSensorNumber() const
returns the number of sensors the controller was initialised with or 0 if not initialised ...
Definition: invertnchannelcontroller.h:49
virtual void learnmodel(const matrix::Matrix &y_delay)
Definition: invertnchannelcontroller.cpp:274
matrix::Matrix A
Definition: invertnchannelcontroller.h:79
void putInBuffer(matrix::Matrix *buffer, const matrix::Matrix &vec)
Definition: invertnchannelcontroller.cpp:309
bool update_only_1
Definition: invertnchannelcontroller.h:77