Robotsystem of the Robot Group Leipzig: InvertNChannelController Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# InvertNChannelController 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 <invertnchannelcontroller.h>`

Inherits InvertController.

Inheritance diagram for InvertNChannelController:

[legend]
Collaboration diagram for InvertNChannelController:

[legend]
List of all members.

## Public Member Functions
| InvertNChannelController (int _buffersize, bool _update_only_1=false)
virtual void | init (int sensornumber, int motornumber, RandGen *randGen=0)
| initialisation of the controller with the given sensor/ motornumber Must be called before use.
virtual | ~InvertNChannelController ()
virtual paramkey | getName () const
| returns the name of the object (with version number)
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.
## Protected Member Functions
virtual double | calculateE (const matrix::Matrix &x_delay, const matrix::Matrix &y_delay)
virtual void | learn (const matrix::Matrix &x_delay, const matrix::Matrix &y_delay)
| learn values h,C
virtual void | learnmodel (const matrix::Matrix &y_delay)
virtual matrix::Matrix | calculateDelayedValues (const matrix::Matrix *buffer, unsigned int number_steps_of_delay_)
| calculate delayed values
virtual matrix::Matrix | calculateSmoothValues (const matrix::Matrix *buffer, unsigned int number_steps_for_averaging_)
matrix::Matrix | calculateControllerValues (const matrix::Matrix &x_smooth)
| calculate controller outputs
void | putInBuffer (matrix::Matrix *buffer, const matrix::Matrix &vec)
## Static Protected Member Functions
static double | g (double z)
| neuron transfer function
static double | g_s (double z)
static double | squash (double z)
| squashing function, to protect against to large weight updates
## Protected Attributes
unsigned short | number_channels
unsigned short | buffersize
bool | update_only_1
matrix::Matrix | A
matrix::Matrix | C
matrix::Matrix | h
matrix::Matrix | L
matrix::Matrix * | x_buffer
matrix::Matrix * | y_buffer
int | t
paramkey | name

## 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

InvertNChannelController | ( | int | _buffersize,
|  | bool | _update_only_1 = `false` |
| ) |  |  |

~InvertNChannelController | ( |  | ) | `[virtual]`

## Member Function Documentation

Matrix calculateControllerValues | ( | const matrix::Matrix & | x_smooth | ) | `[protected]`

calculate controller outputs

Parameters:

  | x_smooth | Matrix(number_channels,1)

Matrix calculateDelayedValues | ( | const matrix::Matrix * | buffer,
|  | unsigned int | number_steps_of_delay_ |
| ) |  |  | `[protected, virtual]`

calculate delayed values

double calculateE | ( | const matrix::Matrix & | x_delay,
|  | const matrix::Matrix & | y_delay |
| ) |  |  | `[protected, virtual]`

Matrix calculateSmoothValues | ( | const matrix::Matrix * | buffer,
|  | unsigned int | number_steps_for_averaging_ |
| ) |  |  | `[protected, virtual]`

static double g | ( | double | z | ) | `[inline, static, protected]`

neuron transfer function

static double g_s | ( | double | z | ) | `[inline, static, protected]`

list< Inspectable::iparamkey > getInternalParamNames | ( |  | ) | const`[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

Reimplemented from Inspectable.

list< Inspectable::iparamval > getInternalParams | ( |  | ) | const`[virtual]`

Returns:
  : list of values

Reimplemented from Inspectable.

virtual int getMotorNumber | ( |  | ) | const`[inline, virtual]`

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

Implements AbstractController.

virtual paramkey getName | ( |  | ) | const`[inline, virtual]`

returns the name of the object (with version number)

Reimplemented from Configurable.

virtual int getSensorNumber | ( |  | ) | const`[inline, virtual]`

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

Implements AbstractController.

list< Inspectable::IConnection > getStructuralConnections | ( |  | ) | const`[virtual]`

Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important.

Returns:
  : list of layer names with dimension

Reimplemented from Inspectable.

list< Inspectable::ILayer > getStructuralLayers | ( |  | ) | const`[virtual]`

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.

Returns:
  : list of layer names with dimension

Reimplemented from Inspectable.

void init | ( | int | sensornumber,
|  | int | motornumber,
|  | RandGen * | randGen = `0` |
| ) |  |  | `[virtual]`

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

The random generator is optional.

Implements AbstractController.

void learn | ( | const matrix::Matrix & | x_delay,
|  | const matrix::Matrix & | y_delay |
| ) |  |  | `[protected, virtual]`

learn values h,C

void learnmodel | ( | const matrix::Matrix & | y_delay | ) | `[protected, virtual]`

void putInBuffer | ( | matrix::Matrix * | buffer,
|  | const matrix::Matrix & | vec |
| ) |  |  | `[protected]`

bool restore | ( | FILE * | f | ) | `[virtual]`

loads the controller values from a given file.

Implements Storeable.

static double squash | ( | double | z | ) | `[inline, static, protected]`

squashing function, to protect against to large weight updates

void step | ( | const sensor * | ,
|  | int | number_sensors,
|  | motor * | ,
|  | int | number_motors |
| ) |  |  | `[virtual]`

performs one step (includes learning).

Calulates motor commands from sensor inputs.

Implements AbstractController.

void stepNoLearning | ( | const sensor * | ,
|  | int | number_sensors,
|  | motor * | ,
|  | int | number_motors |
| ) |  |  | `[virtual]`

performs one step without learning. Calulates motor commands from sensor inputs.

Implements AbstractController.

bool store | ( | FILE * | f | ) | const`[virtual]`

stores the controller values to a given file.

Implements Storeable.

## Member Data Documentation

matrix::Matrix A`[protected]`

unsigned short buffersize`[protected]`

matrix::Matrix C`[protected]`

matrix::Matrix h`[protected]`

matrix::Matrix L`[protected]`

paramkey name`[protected]`

Reimplemented from Configurable.

unsigned short number_channels`[protected]`

int t`[protected]`

bool update_only_1`[protected]`

matrix::Matrix* x_buffer`[protected]`

matrix::Matrix* y_buffer`[protected]`

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

- invertnchannelcontroller.h
- invertnchannelcontroller.cpp