24 #ifndef __MULTILAYERFFNN_H
25 #define __MULTILAYERFFNN_H
54 virtual void init(
unsigned int inputDim,
unsigned int outputDim,
55 double unit_map = 0.0,
RandGen* randGen = 0);
64 double learnRateFactor = 1);
92 return (
weights.rbegin())->getM();
97 assert(layer < layers.size());
102 virtual void damp(
double damping);
106 return layers.size();
111 assert(layer < layers.size());
112 return layers[layer];
117 assert(layer < layers.size());
118 return layers[layer];
123 assert(to_layer <
weights.size());
129 assert(to_layer <
weights.size());
135 assert(of_layer <
bias.size());
136 return bias[of_layer];
141 assert(of_layer <
bias.size());
142 return bias[of_layer];
147 bool store(FILE* f)
const;
153 bool write(FILE* f)
const;
188 std::vector<matrix::Matrix>
bias;
195 std::vector<matrix::Matrix>
ys;
196 std::vector<matrix::Matrix>
zs;
Matrix type.
Definition: matrix.h:65
double lambda
Definition: multilayerffnn.h:198
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.
Definition: multilayerffnn.cpp:45
std::list< IConnection > iconnectionlist
Definition: inspectable.h:88
matrix::Matrix bypassWeights
Definition: multilayerffnn.h:191
bool store(FILE *f) const
stores the layer binary into file stream
Definition: multilayerffnn.cpp:206
virtual unsigned int getInputDim() const
returns the number of input neurons
Definition: multilayerffnn.h:87
virtual const matrix::Matrix & getLayerOutput(unsigned int layer) const
returns activation of the given layer. Layer 0 is the first hidden layer
Definition: multilayerffnn.h:96
bool someInternalParams
Definition: multilayerffnn.h:192
bool write(FILE *f) const
writes the layer ASCII into file stream (not in the storable interface)
Definition: multilayerffnn.cpp:225
double eps
learning rate
Definition: multilayerffnn.h:167
bool restore(FILE *f)
restores the layer binary from file stream
Definition: multilayerffnn.cpp:245
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
virtual const Layer & getLayer(unsigned int layer) const
layers 0 is the first hidden layer
Definition: multilayerffnn.h:110
virtual iparamkeylist getInternalParamNames() const
The list of the names of all internal parameters given by getInternalParams().
Definition: multilayerffnn.cpp:284
std::vector< matrix::Matrix > weights
Definition: multilayerffnn.h:187
virtual ilayerlist getStructuralLayers() const
Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering...
Definition: multilayerffnn.cpp:326
bool initialised
Definition: multilayerffnn.h:199
matrix::Matrix input
Definition: multilayerffnn.h:194
std::vector< matrix::Matrix > smallids
Definition: multilayerffnn.h:189
virtual const matrix::Matrix process(const matrix::Matrix &input)
passive processing of the input
Definition: multilayerffnn.cpp:84
virtual matrix::Matrix & getWeights(unsigned int to_layer)
weight matrix 0 connects input with the first hidden layer
Definition: multilayerffnn.h:128
MultiLayerFFNN(double eps, const std::vector< Layer > &layers, bool useBypass=false, bool someInternalParams=true)
Definition: multilayerffnn.cpp:32
virtual iparamvallist getInternalParams() const
Definition: multilayerffnn.cpp:305
virtual matrix::Matrix & getBias(unsigned int of_layer)
Note: layers 0 is the first hidden layer.
Definition: multilayerffnn.h:140
virtual const matrix::Matrix & getWeights(unsigned int to_layer) const
weight matrix 0 connects input with the first hidden layer
Definition: multilayerffnn.h:122
virtual void setActivationFunctions(std::vector< ActivationFunction > actfunList)
sets the activation functions (and derivative and inversion too) for all layers.
Definition: multilayerffnn.cpp:356
std::vector< matrix::Matrix > zs
Definition: multilayerffnn.h:196
virtual ~MultiLayerFFNN()
Definition: multilayerffnn.h:46
virtual const matrix::Matrix response(const matrix::Matrix &input) const
response matrix of neural network at given input
Definition: multilayerffnn.cpp:168
virtual void damp(double damping)
damps the weights and the biases by multiplying (1-damping)
Definition: multilayerffnn.cpp:191
virtual void setSomeInternalParams(bool someInternalParams)
Definition: multilayerffnn.h:162
virtual Layer & getLayer(unsigned int layer)
layers 0 is the first hidden layer
Definition: multilayerffnn.h:116
std::vector< matrix::Matrix > ys
Definition: multilayerffnn.h:195
abstract class (interface) for feed forward rate based neural networks
Definition: feedforwardnn.h:41
virtual unsigned int getOutputDim() const
returns the number of output neurons
Definition: multilayerffnn.h:91
virtual const matrix::Matrix & getBias(unsigned int of_layer) const
Note: layers 0 is the first hidden layer.
Definition: multilayerffnn.h:134
bool useBypass
Definition: multilayerffnn.h:190
multi layer neural network with configurable activation functions
Definition: multilayerffnn.h:35
virtual unsigned int getLayerNum() const
Definition: multilayerffnn.h:105
double(* ActivationFunction)(double)
activation function type: input: membrane potential
Definition: feedforwardnn.h:34
std::list< ILayer > ilayerlist
Definition: inspectable.h:87
virtual std::vector< ActivationFunction > setActivationFunction(ActivationFunction actfun)
sets the activation function (and derivative and inversion too) for ALL layers!
Definition: multilayerffnn.cpp:347
virtual const matrix::Matrix learn(const matrix::Matrix &input, const matrix::Matrix &nom_output, double learnRateFactor=1)
performs learning and returns the network output before learning (process should be called before) ...
Definition: multilayerffnn.cpp:104
std::list< iparamkey > iparamkeylist
Definition: inspectable.h:59
virtual const matrix::Matrix inversion(const matrix::Matrix &input, const matrix::Matrix &xsi) const
calculates the input shift v to a given output shift xsi via pseudo inversion.
Definition: multilayerffnn.cpp:141
std::list< iparamval > iparamvallist
Definition: inspectable.h:61
std::vector< Layer > layers
Definition: multilayerffnn.h:186
std::vector< matrix::Matrix > bias
Definition: multilayerffnn.h:188
virtual iconnectionlist getStructuralConnections() const
Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The...
Definition: multilayerffnn.cpp:338