Robot Simulator of the Robotics Group for Self-Organization of Control: ModelWithMemoryAdapter Class Reference

# ModelWithMemoryAdapter Class Reference

multi layer neural network with configurable activation functions More...

`#include <modelwithmemoryadapter.h>`

Inherits InvertableModel.

Collaboration diagram for ModelWithMemoryAdapter:
[legend]

List of all members.

## Classes
struct | Pat
## Public Member Functions
| ModelWithMemoryAdapter (InvertableModel *model, int memorySize, int numPatternsPerStep)
virtual | ~ModelWithMemoryAdapter ()
virtual void | init (unsigned int inputDim, unsigned int outputDim, double unit_map=0.0, RandGen *randGen=0)
| initialisation of the network with the given number of input and output units
virtual const matrix::Matrix | learn (const matrix::Matrix &input, const matrix::Matrix &nom_output, double learnRateFactor=1)
| learn the input output mapping but also learn mappings from the memory.
virtual const matrix::Matrix | process (const matrix::Matrix &input)
| passive processing of the input (this function is not constant since a recurrent network for example might change internal states
virtual const matrix::Matrix | response (const matrix::Matrix &input) const
| calculates the partial derivative of the of the output with repect to the input (Jacobi matrix).
virtual const matrix::Matrix | inversion (const matrix::Matrix &input, const matrix::Matrix &xsi) const
| calculates the input shift v to given output shift xsi via pseudo inversion.
virtual unsigned int | getInputDim () const
| returns the number of input neurons
virtual unsigned int | getOutputDim () const
| returns the number of output neurons
virtual void | damp (double damping)
| damps the weights and the biases by multiplying (1-damping)
Inspectable * | getModel ()
const Inspectable * | getModel () const
bool | store (FILE *f) const
| stores the layer binary into file stream
bool | restore (FILE *f)
| restores the layer binary from file stream
virtual iparamkeylist | getInternalParamNames () const
| The list of the names of all internal parameters given by getInternalParams().
virtual iparamvallist | getInternalParams () const
virtual ilayerlist | getStructuralLayers () const
| Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important.
virtual iconnectionlist | getStructuralConnections () const
| Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important.
## Protected Attributes
InvertableModel * | model
int | memorySize
int | numPatternsPerStep
std::vector< Pat > | memory
| vector of input output mappings
RandGen * | randGen

## Detailed Description

multi layer neural network with configurable activation functions

## Constructor & Destructor Documentation

ModelWithMemoryAdapter | ( | InvertableModel * | model,
|  | int | memorySize,
|  | int | numPatternsPerStep |
| ) |  |  |

Parameters:

  | model | pointer to model to accomplish by memory
  | memorySize | number of pattern that are stored
  | numPatternsPerStep | number of past patterns to learn each step

virtual ~ModelWithMemoryAdapter | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual void damp | ( | double | damping | ) | `[inline, virtual]`

damps the weights and the biases by multiplying (1-damping)

Implements AbstractModel.

virtual unsigned int getInputDim | ( |  | ) | const`[inline, virtual]`

returns the number of input neurons

Implements AbstractModel.

virtual iparamkeylist 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

Reimplemented from Inspectable.

virtual iparamvallist getInternalParams | ( |  | ) | const`[inline, virtual]`

Returns:
  : list of values

Reimplemented from Inspectable.

const Inspectable* getModel | ( |  | ) | const`[inline]`

Inspectable* getModel | ( |  | ) | `[inline]`

virtual unsigned int getOutputDim | ( |  | ) | const`[inline, virtual]`

returns the number of output neurons

Implements AbstractModel.

virtual iconnectionlist getStructuralConnections | ( |  | ) | const`[inline, 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.

virtual ilayerlist getStructuralLayers | ( |  | ) | const`[inline, 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 | ( | unsigned int | inputDim,
|  | unsigned int | outputDim,
|  | double | unit_map = `0.0`,
|  | RandGen * | randGen = `0` |
| ) |  |  | `[virtual]`

initialisation of the network with the given number of input and output units

Parameters:

  | inputDim | length of input vector
  | outputDim | length of output vector
  | unit_map | if 0 the parametes are choosen randomly. Otherwise the model is initialised to represent a unit_map with the given response strength.
  | randGen | pointer to random generator, if 0 an new one is used

Implements AbstractModel.

virtual const matrix::Matrix inversion | ( | const matrix::Matrix & | input,
|  | const matrix::Matrix & | xsi |
| ) |  |  | const`[inline, virtual]`

calculates the input shift v to given output shift xsi via pseudo inversion.

The result is a vector of dimension inputdim

Implements InvertableModel.

const Matrix learn | ( | const matrix::Matrix & | input,
|  | const matrix::Matrix & | nom_output,
|  | double | learnRateFactor = `1` |
| ) |  |  | `[virtual]`

learn the input output mapping but also learn mappings from the memory.

See also:
  InvertableModel::learn

Implements AbstractModel.

virtual const matrix::Matrix process | ( | const matrix::Matrix & | input | ) | `[inline, virtual]`

passive processing of the input (this function is not constant since a recurrent network for example might change internal states

Implements AbstractModel.

virtual const matrix::Matrix response | ( | const matrix::Matrix & | input | ) | const`[inline, virtual]`

calculates the partial derivative of the of the output with repect to the input (Jacobi matrix).

The result is a matrix of dimension (outputdim x inputdim)

Implements InvertableModel.

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

restores the layer binary from file stream

Implements Storeable.

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

stores the layer binary into file stream

Implements Storeable.

## Member Data Documentation

std::vector<Pat> memory`[protected]`

vector of input output mappings

int memorySize`[protected]`

InvertableModel* model`[protected]`

int numPatternsPerStep`[protected]`

RandGen* randGen`[protected]`

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

- modelwithmemoryadapter.h
- modelwithmemoryadapter.cpp