class FFNet

Feed-forward neural network (MLP) class More...

Definition#include <NNet/include/FFNet.h>
InheritsObject (data-flow)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

Feed-forward neural network (MLP) class

Vector<int> topo

[protected]

Network topology

Vector<RCPtr<FFLayer> > layers

[protected]

Pointers to all MLP layers

float * weights

[protected]

Complete weight vector

int nbNeurons

[protected]

Total number of neurons

int nbWeights

[protected]

Total number of weights

 FFNet (const Vector<int> &_topo, const Vector<string> &functions)

 FFNet ()

 FFNet (FFNet &net)

 FFNet (const Vector<int> &_topo, const Vector<string> &functions, vector<float *> &tin, vector<float *> &tout)

void  init (const Vector<string> &functions)

void  setupLayersAfterRead ()

float * calc (const float *input, float *value, float *deriv=NULL)

Calculates the network result for a certain input

void  learn (float *input, float *output, double *gradient, double *err=NULL, float *calc_output=NULL)

Calculates the gradient for a single sample

void  calcGradient (vector<float *> &tin, vector<float *> &tout, Array<float> weights, Array<double> &gradient, double &err)

Calculates the gradient for a set of sample

void  weightedLearn (float *input, float *output, float *learnWeights, double *gradient, double *err=NULL, float *calc_output=NULL)

Calculates the gradient for a single sample using variable weight

void  weightedCalcGradient (vector<float *> &tin, vector<float *> &tout, vector<float *> &learnWeights, Array<float> weights, Array<double> &gradient, double &err)

Calculates the gradient for a set of sample using variable weight

float  totalError (vector<float *> tin, vector<float *> tout)

Mean square error for a complete set

int  getNbWeights ()

int  getNbNeurons ()

const Vector<int> & getTopo ()

const Vector<RCPtr<FFLayer> > & getLayers ()

const float * getWeights ()

void  setWeights (float *ptr)

void  setDerivOffset (float d)

void  printOn (ostream &out)

[const]

Writes an MLP to a stream

Reimplemented from Object.

void  readFrom (istream &in)

Reads an MLP from a stream

Reimplemented from Object.