Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FeedForwardNetwork Class Reference

#include <Gist/FFN.H>

Collaboration diagram for FeedForwardNetwork:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Feed Forward Network.

Definition at line 54 of file FFN.H.

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


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 463 of file FFN.C.

References crop(), 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 493 of file FFN.C.

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

Referenced by main(), and train().

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

get the most recent output

Definition at line 167 of file FFN.H.

Referenced by main(), and train().

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 176 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.

References init().

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(), i, LINFO, NO_INIT, Dlist::rand(), Image< T >::resize(), RW_RANGE, Image< T >::setVal(), temp, 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 349 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 228 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 239 of file FFN.C.

References Image< T >::beginw(), i, LINFO, NO_INIT, Dlist::rand(), RW_RANGE, temp, and transpose().

Referenced by main().

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

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

Definition at line 406 of file FFN.C.

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

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

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

Definition at line 431 of file FFN.C.

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

Referenced by main(), and train().

void FeedForwardNetwork::setLearningRate double  newLR  ) 
 

Set Learning rate - for simulated annealing.

Definition at line 601 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 538 of file FFN.C.

References Image< T >::beginw(), Image< T >::endw(), LFATAL, lobot::stop(), temp, 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 567 of file FFN.C.

References Image< T >::beginw(), Image< T >::endw(), LFATAL, lobot::stop(), temp, and transpose().

Referenced by main().


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 15:50:15 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4