GPLIB++
Public Types | Public Member Functions | List of all members
gplib::NeuralNetwork Class Reference

#include <NeuralNetwork.h>

Inheritance diagram for gplib::NeuralNetwork:
Inheritance graph
[legend]

Public Types

typedef std::vector
< boost::shared_ptr
< GeneralNeuron > > 
tNeuralLayer
 
typedef std::vector< tNeuralLayertNeuralArray
 
typedef std::vector
< SigmoidalNeuron::tneurontype
ttypeVector
 
typedef std::vector< ttypeVectorttypeArray
 

Public Member Functions

void SetAlpha (const double a)
 Set the momentum multiplier. More...
 
void SetMu (const double m)
 Set the adaptation stepsize. More...
 
void SetLayers (ttypeArray typeArray, bool cachedoutput=false)
 Configure the layers of the network according to the types in typeArray. More...
 
void InitWeights (const double MaxWeight, const double MaxBias)
 Initialize the weights with random values with the specified maxima. More...
 
void PrintTopology (std::string filename)
 Print the topology and weights of the network for plotting with the dot program. More...
 
virtual void PrintWeights (std::ostream &output)
 Print the weights of the network to the specified output stream. More...
 
virtual const gplib::rvec & GetWeightsAsVector ()
 Return the network weights as a single vector. More...
 
virtual void AdaptFilter (const gplib::rvec &Input, const gplib::rvec &Desired)
 Adapt the Filter with the current input and desired. More...
 
virtual void CalcOutput (const gplib::rvec &Input, gplib::rvec &Output)
 Calculate the output with the given input. More...
 
 NeuralNetwork (const int inputsize, const int outputsize)
 The minium values for the network are the length of the input and output. More...
 
 NeuralNetwork (const int inputsize, const int outputsize, const double mu_, const ttypeArray &Layerssetup, const double maxinit, bool cachedoutput=false)
 Extended constructor with most of the necessary values. More...
 
virtual ~NeuralNetwork ()
 
- Public Member Functions inherited from gplib::AdaptiveFilter
const gplib::rvec & GetFilterOutput () const
 Access to the last calculated output (not sure if needed) More...
 
const gplib::rvec & GetEpsilon () const
 Return the last estimation error. More...
 
 AdaptiveFilter (const int inputsize, const int outputsize)
 The constructor needs to know the length of the input and output vectors for memory allocation. More...
 
virtual ~AdaptiveFilter ()
 

Additional Inherited Members

- Protected Member Functions inherited from gplib::AdaptiveFilter
unsigned int GetInputLength ()
 Access function for derived classes for the inputlength. More...
 
unsigned int GetOutputLength ()
 Access function for derived classes for the outputlength. More...
 
void SetEpsilon (const gplib::rvec &MyEps)
 Possibility for derived classes to set estimation error. More...
 
void SetOutput (const gplib::rvec &Out)
 Possibility for derived classes to set output. More...
 

Detailed Description

The class NeuralNetwork manages the network output calculation, neuron storage and weight adaptation Derived from AdaptiveFilter so we can use the Filter functionality

Definition at line 17 of file NeuralNetwork.h.

Member Typedef Documentation

Definition at line 21 of file NeuralNetwork.h.

typedef std::vector<boost::shared_ptr<GeneralNeuron> > gplib::NeuralNetwork::tNeuralLayer

Definition at line 20 of file NeuralNetwork.h.

Definition at line 23 of file NeuralNetwork.h.

Definition at line 22 of file NeuralNetwork.h.

Constructor & Destructor Documentation

gplib::NeuralNetwork::NeuralNetwork ( const int  inputsize,
const int  outputsize 
)

The minium values for the network are the length of the input and output.

Definition at line 13 of file NeuralNetwork.cpp.

gplib::NeuralNetwork::NeuralNetwork ( const int  inputsize,
const int  outputsize,
const double  mu_,
const ttypeArray Layerssetup,
const double  maxinit,
bool  cachedoutput = false 
)

Extended constructor with most of the necessary values.

Definition at line 20 of file NeuralNetwork.cpp.

References InitWeights(), and SetLayers().

gplib::NeuralNetwork::~NeuralNetwork ( )
virtual

Definition at line 31 of file NeuralNetwork.cpp.

Member Function Documentation

void gplib::NeuralNetwork::AdaptFilter ( const gplib::rvec &  Input,
const gplib::rvec &  Desired 
)
virtual

Adapt the Filter with the current input and desired.

Implements gplib::AdaptiveFilter.

Definition at line 35 of file NeuralNetwork.cpp.

References gplib::AdaptiveFilter::GetFilterOutput(), and gplib::AdaptiveFilter::SetEpsilon().

Referenced by main().

void gplib::NeuralNetwork::CalcOutput ( const gplib::rvec &  Input,
gplib::rvec &  Output 
)
virtual

Calculate the output with the given input.

Implements gplib::AdaptiveFilter.

Definition at line 45 of file NeuralNetwork.cpp.

References gplib::AdaptiveFilter::SetOutput().

const gplib::rvec & gplib::NeuralNetwork::GetWeightsAsVector ( )
virtual

Return the network weights as a single vector.

Implements gplib::AdaptiveFilter.

Definition at line 58 of file NeuralNetwork.cpp.

References size.

Referenced by PrintTopology().

void gplib::NeuralNetwork::InitWeights ( const double  MaxWeight,
const double  MaxBias 
)

Initialize the weights with random values with the specified maxima.

Definition at line 122 of file NeuralNetwork.cpp.

References gplib::UniformRNG::GetNumber().

Referenced by main(), and NeuralNetwork().

void gplib::NeuralNetwork::PrintTopology ( std::string  filename)

Print the topology and weights of the network for plotting with the dot program.

Definition at line 233 of file NeuralNetwork.cpp.

References GetWeightsAsVector(), and size.

Referenced by main().

void gplib::NeuralNetwork::PrintWeights ( std::ostream &  output)
virtual

Print the weights of the network to the specified output stream.

Implements gplib::AdaptiveFilter.

Definition at line 219 of file NeuralNetwork.cpp.

Referenced by main().

void gplib::NeuralNetwork::SetAlpha ( const double  a)
inline

Set the momentum multiplier.

Definition at line 45 of file NeuralNetwork.h.

Referenced by main().

void gplib::NeuralNetwork::SetLayers ( ttypeArray  typeArray,
bool  cachedoutput = false 
)

Configure the layers of the network according to the types in typeArray.

Definition at line 81 of file NeuralNetwork.cpp.

Referenced by main(), and NeuralNetwork().

void gplib::NeuralNetwork::SetMu ( const double  m)
inline

Set the adaptation stepsize.

Definition at line 50 of file NeuralNetwork.h.


The documentation for this class was generated from the following files: