Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

FD::FFNet Class Reference

#include <FFNet.h>

Inheritance diagram for FD::FFNet:

Inheritance graph
[legend]
Collaboration diagram for FD::FFNet:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FFNet (const Vector< int > &_topo, const Vector< std::string > &functions)
 FFNet (FFNet &net)
 FFNet (const Vector< int > &_topo, const Vector< std::string > &functions, std::vector< float * > &tin, std::vector< float * > &tout)
void init (const Vector< std::string > &functions)
void setupLayersAfterRead ()
float * calc (const float *input, float *value, float *deriv=NULL)
void learn (float *input, float *output, double *gradient, double *err=NULL, float *calc_output=NULL)
void calcGradient (std::vector< float * > &tin, std::vector< float * > &tout, Array< float > weights, Array< double > &gradient, double &err)
void weightedLearn (float *input, float *output, float *learnWeights, double *gradient, double *err=NULL, float *calc_output=NULL)
void weightedCalcGradient (std::vector< float * > &tin, std::vector< float * > &tout, std::vector< float * > &learnWeights, Array< float > weights, Array< double > &gradient, double &err)
float totalError (std::vector< float * > tin, std::vector< float * > tout)
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 (std::ostream &out) const
void readFrom (std::istream &in)

Protected Attributes

Vector< int > topo
Vector< RCPtr< FFLayer > > layers
float * weights
int nbNeurons
int nbWeights

Detailed Description

Feed-forward neural network (MLP) class
Author:
: Jean-Marc Valin


Member Function Documentation

float* FD::FFNet::calc const float *  input,
float *  value,
float *  deriv = NULL
[inline]
 

Calculates the network result for a certain input

void FD::FFNet::calcGradient std::vector< float * > &  tin,
std::vector< float * > &  tout,
Array< float >  weights,
Array< double > &  gradient,
double &  err
 

Calculates the gradient for a set of sample

void FD::FFNet::learn float *  input,
float *  output,
double *  gradient,
double *  err = NULL,
float *  calc_output = NULL
 

Calculates the gradient for a single sample

void FD::FFNet::printOn std::ostream &  out  )  const [virtual]
 

Writes an MLP to a stream

Implements FD::Object.

void FD::FFNet::readFrom std::istream &  in  )  [virtual]
 

Reads an MLP from a stream

Reimplemented from FD::Object.

float FD::FFNet::totalError std::vector< float * >  tin,
std::vector< float * >  tout
 

Mean square error for a complete set

void FD::FFNet::weightedCalcGradient std::vector< float * > &  tin,
std::vector< float * > &  tout,
std::vector< float * > &  learnWeights,
Array< float >  weights,
Array< double > &  gradient,
double &  err
 

Calculates the gradient for a set of sample using variable weight

void FD::FFNet::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


Member Data Documentation

Vector<RCPtr<FFLayer> > FD::FFNet::layers [protected]
 

Pointers to all MLP layers

int FD::FFNet::nbNeurons [protected]
 

Total number of neurons

int FD::FFNet::nbWeights [protected]
 

Total number of weights

Vector<int> FD::FFNet::topo [protected]
 

Network topology

float* FD::FFNet::weights [protected]
 

Complete weight vector


The documentation for this class was generated from the following file:
Generated on Wed Oct 5 14:30:25 2005 for FlowDesigner by  doxygen 1.4.4