FeedForwardNetwork Class Reference

A Feed Forward Network. More...

#include <Gist/FFN.H>

Collaboration diagram for FeedForwardNetwork:
Collaboration graph
[legend]

List of all members.

Constructors, assignment, and Destructors



 FeedForwardNetwork ()
 Constructor.
 ~FeedForwardNetwork ()
 Destructor.
void init (std::string wh_file, std::string wo_file, int inunits, int hidunits, int outunits, double lrate, double mrate)
void init (int inunits, int hidunits, int outunits, double lrate, double mrate)
void init (Image< double > wh, Image< double > wo, double lrate, double mrate)
 Initialize a two-weight-layer network with Image<double> weights.
void init3L (std::string wh1_file, std::string wh2_file, std::string wo_file, int inunits, int hid1units, int hid2units, int outunits, double lrate, double mrate)
void init3L (int inunits, int hid1units, int hid2units, int outunits, double lrate, double mrate)
void init3L (Image< double > wh, Image< double > wh2, Image< double > wo, double lrate, double mrate)
 Initialize a three-weight-layer network with Image<double> weights.
Image< double > run (Image< double > input)
 Run a two-weight-layer network with passed in input.
Image< double > run3L (Image< double > input)
 Run a three-weight-layer network with passed in input.
void backprop (Image< double > target)
void backprop3L (Image< double > target)
void write (std::string wh_file, std::string wo_file)
 Write the two-weight-layer network weights to a specified file.
void write3L (std::string wh1_file, std::string wh2_file, std::string wo_file)
 Write the three-weight-layer network weights to a specified file.
void setLearningRate (double newLR)
 Set Learning rate - for simulated annealing.
Image< double > getOutput ()
 get the most recent output

Detailed Description

A Feed Forward Network.

Definition at line 54 of file FFN.H.


Constructor & Destructor Documentation

FeedForwardNetwork::FeedForwardNetwork (  ) 

Constructor.

This implements a simple feedforward network with backpropagation. Supports 2 or 3-weight-layer networks through separate function calls NOTE: please allow the class to create the initial weight files (use the init function that does not ask for weight files). Also user should add an extra input for bias (set it to 1.0)

Definition at line 57 of file FFN.C.

FeedForwardNetwork::~FeedForwardNetwork (  ) 

Destructor.

Definition at line 61 of file FFN.C.


Member Function Documentation

void FeedForwardNetwork::backprop ( Image< double >  target  ) 

backpropagate the error in the two-weight-layer network with passed in target output (note: call run first)

Definition at line 468 of file FFN.C.

References Image< T >::getDims(), Image< T >::getSize(), matrixMult(), transpose(), and ZEROS.

void FeedForwardNetwork::backprop3L ( Image< double >  target  ) 

backpropagate the error in the three-weight-layer network with passed in target output (note: call run3L first)

Definition at line 498 of file FFN.C.

References Image< T >::getDims(), Image< T >::getSize(), matrixMult(), transpose(), and ZEROS.

Image< double > FeedForwardNetwork::getOutput (  )  [inline]

get the most recent output

Definition at line 167 of file FFN.H.

void FeedForwardNetwork::init ( Image< double >  wh,
Image< double >  wo,
double  lrate,
double  mrate 
)

Initialize a two-weight-layer network with Image<double> weights.

Definition at line 178 of file FFN.C.

References ASSERT, Image< T >::getHeight(), Image< T >::getWidth(), Image< T >::resize(), and Image< T >::setVal().

void FeedForwardNetwork::init ( int  inunits,
int  hidunits,
int  outunits,
double  lrate,
double  mrate 
)

Initialize a two-weight-layer network with small random weights momentum is unimplemented

Definition at line 82 of file FFN.C.

void FeedForwardNetwork::init ( std::string  wh_file,
std::string  wo_file,
int  inunits,
int  hidunits,
int  outunits,
double  lrate,
double  mrate 
)

Initialize a two-weight-layer network with saved weights momentum is unimplemented

Definition at line 90 of file FFN.C.

References Image< T >::beginw(), NO_INIT, Image< T >::resize(), Image< T >::setVal(), and transpose().

void FeedForwardNetwork::init3L ( Image< double >  wh,
Image< double >  wh2,
Image< double >  wo,
double  lrate,
double  mrate 
)

Initialize a three-weight-layer network with Image<double> weights.

Definition at line 354 of file FFN.C.

References ASSERT, Image< T >::getHeight(), and Image< T >::getWidth().

void FeedForwardNetwork::init3L ( int  inunits,
int  hid1units,
int  hid2units,
int  outunits,
double  lrate,
double  mrate 
)

Initialize a two-weight-layer network with small random weights momentum is unimplemented

Definition at line 230 of file FFN.C.

void FeedForwardNetwork::init3L ( std::string  wh1_file,
std::string  wh2_file,
std::string  wo_file,
int  inunits,
int  hid1units,
int  hid2units,
int  outunits,
double  lrate,
double  mrate 
)

Initialize a three-weight-layer network with saved weights momentum is unimplemented

Definition at line 241 of file FFN.C.

References Image< T >::beginw(), NO_INIT, and transpose().

Image< double > FeedForwardNetwork::run ( Image< double >  input  ) 

Run a two-weight-layer network with passed in input.

Definition at line 411 of file FFN.C.

References Image< T >::beginw(), Image< T >::endw(), and matrixMult().

Image< double > FeedForwardNetwork::run3L ( Image< double >  input  ) 

Run a three-weight-layer network with passed in input.

Definition at line 436 of file FFN.C.

References Image< T >::beginw(), Image< T >::endw(), and matrixMult().

void FeedForwardNetwork::setLearningRate ( double  newLR  ) 

Set Learning rate - for simulated annealing.

Definition at line 606 of file FFN.C.

void FeedForwardNetwork::write ( std::string  wh_file,
std::string  wo_file 
)

Write the two-weight-layer network weights to a specified file.

Definition at line 543 of file FFN.C.

References Image< T >::beginw(), Image< T >::endw(), and transpose().

void FeedForwardNetwork::write3L ( std::string  wh1_file,
std::string  wh2_file,
std::string  wo_file 
)

Write the three-weight-layer network weights to a specified file.

Definition at line 572 of file FFN.C.

References Image< T >::beginw(), Image< T >::endw(), and transpose().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:21:40 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3