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

Teem::FeedForwardNeuralNetwork Class Reference
[Controllers and neural networks]

#include <FeedForwardNeuralNetwork.h>

Inheritance diagram for Teem::FeedForwardNeuralNetwork:

Teem::Controller Teem::BackPropFeedForwardNeuralNetwork Teem::RecurrentFeedForwardNeuralNetwork List of all members.

Detailed Description

Class that implement a simple multilayer feedforward neural network without using the abstract NN architecture.


Public Member Functions

 FeedForwardNeuralNetwork (size_t inputCount, size_t outputCount, const std::string &root)
 Constructor, create a neural network with inputCount inputs and outputCount outputs.
virtual ~FeedForwardNeuralNetwork ()
 Destructor.
virtual void setInput (unsigned index, double val)
 Set the input values to the neural network.
virtual double getInput (unsigned index) const
 Return the input value.
virtual unsigned getInputCount () const
 Returns the number of input.
virtual double getOutput (unsigned index)
 Read the output values.
virtual void step ()
 Propagate the input values to the output through all the layers.
size_t layerNum ()
 Return the number of layers.
size_t layerSize (size_t layer)
 Return the size of the nth layer. Layer 0 is the fist layer after input.
size_t inputNum ()
 Return the number of input.
size_t outputNum ()
 Return the number of output.
void setWeight (size_t toLayer, size_t from, size_t to, double w)
 Set the weight of a particular synapse to a particular layer.
double getWeight (size_t toLayer, size_t from, size_t to) const
 Get the value for a particular weight.
void setBiasWeight (size_t toLayer, size_t to, double w)
 Set weight from bias to neuron.
double getBiasWeight (size_t toLayer, size_t to) const
 Get weight from bias to neuron.
virtual void randomize (double from, double to)
 Put random weights with uniform distribution.

Protected Types

typedef double(* ActivationFunction )(double x, double b)
 Activation function y = g(x).

Static Protected Member Functions

static double TanhForwardActivationFunction (double x, double b)
 Tanh activation function.

Protected Attributes

size_t inputCount
 number of input
size_t outputCount
 number of output
size_t layerCount
 number of layer
Ishtar::Variable< unsigned > hiddenLayerCount
 number of hidden layer
std::vector< size_t > layerSizes
 size of layers
Ishtar::Variable< double > biasValue
 value of the bias neuron
Ishtar::Variable< std::string > activationFunction
 name of the activation function
Ishtar::Variable< double > activationFunctionParameter
 parameter for the activation function
std::vector< Matrix< double > > weights
 weight matrix for each layer
std::vector< std::valarray<
double > > 
biasWeights
 weight from the bias to each layer
std::vector< std::valarray<
double > > 
activations
 activation of each neuron
std::vector< std::valarray<
double > > 
outputs
 output of each neuron
std::valarray< double > input
 input vector
ActivationFunction forwardActFunc
 pointer to activation function

Classes

class  ActivationFunctor
 Functor to compute activation function on std::valarray<double> unsing std::for_each. More...


Member Typedef Documentation

typedef double(* Teem::FeedForwardNeuralNetwork::ActivationFunction)(double x, double b) [protected]
 

Activation function y = g(x).

Parameters:
x activation
b activation function parameter (slope)
Returns:
output


Member Function Documentation

void Teem::FeedForwardNeuralNetwork::setWeight size_t  toLayer,
size_t  from,
size_t  to,
double  w
[inline]
 

Set the weight of a particular synapse to a particular layer.

Using layer 0, synpases from input to layer 0 are set.


The documentation for this class was generated from the following files:
Generated on Mon Oct 24 17:38:27 2005 for Teem by  doxygen 1.4.2