A.I.M.S algorithms


AimsMultilayerPerceptron Class Reference

The class for a complete MultiLayer Perceptron. More...

#include <aims/neuralnet/multilayerperceptron.h>

Collaboration diagram for AimsMultilayerPerceptron:

Public Member Functions

Constructors and Destructor
 AimsMultilayerPerceptron (const AimsData< int32_t > &topology, int ninputs, float learningrate, float momentum, float maxerror, int stabilitytime, int maxtime)
 The constructor needs 7 parameters. More...
 
 AimsMultilayerPerceptron (const AimsData< int32_t > &topology, const AimsData< float > &weights, int ninputs, float learningrate=0, float momentum=0, float maxerror=0, int stabilitytime=0, int maxtime=0)
 The constructor needs 8 parameters. More...
 
virtual ~AimsMultilayerPerceptron ()
 Destructor deletes all the layers. More...
 
Methods
AimsData< int32_t > topology () const
 Return the topology of the MLP network. More...
 
int nLayers () const
 Return the number of layers of the network. More...
 
int nInputs () const
 Return the number of inputs of the network. More...
 
int nOutputs () const
 Return the number of outputs of the network. More...
 
float learningRate () const
 Return the learning rate of the network. More...
 
float momentum () const
 Return the momentum of the network. More...
 
float maxError () const
 Return the maximum allowed error for convergence. More...
 
int stabilityTime () const
 Return the minimum time for the net to be stable. More...
 
int maxTime () const
 Return the maximum time for learning step. More...
 
void setLearningRate (float learningrate)
 Set the learning rate of the network. More...
 
void setMomentum (float momentum)
 Set the momentum of the network. More...
 
void setMaxError (float maxerror)
 Set the maximum allowed error for convergence. More...
 
void setStabilityTime (int stabilitytime)
 Set the minimum time for the net to be stable. More...
 
void setMaxTime (int maxtime)
 Set the maximum time for learning step. More...
 
void learn (const AimsData< float > &base, const AimsData< float > &target, int counter)
 Send a learning operation on a data base with a target. More...
 
void forward (const AimsData< float > &input)
 Forward propagation. More...
 
void backPropagation ()
 Gradient backward propagation. More...
 
void adjust (const AimsData< float > &input)
 Modification of the weights. More...
 
AimsData< float > test (const AimsData< float > &base)
 Test a data base and return the result. More...
 
AimsData< float > weights () const
 Return all the weights of all the neurons in a volume. More...
 
void save (const std::string &filetopology, const std::string &fileweight)
 Save the network to both G.I.S. files. More...
 

Protected Attributes

Data
int _nLayers
 Number of layers. More...
 
int _nInputs
 Number of inputs for each neuron. More...
 
int _nOutputs
 Number of outputs of the network. More...
 
float _learningRate
 Learning rate. More...
 
float _momentum
 Momentum coefficient. More...
 
float _maxError
 Maximum error to consider the network learned. More...
 
int _stabilityTime
 Minimum number of epochs for the network to be considered stable. More...
 
int _maxTime
 Maximum of number of epochs for the learning step. More...
 
AimsMLPLayer ** _layer
 Pointer to layer pointers. More...
 
AimsData< int32_t > * _topology
 Topology of the network, i.e. number of neurons for each layer. More...
 

Detailed Description

The class for a complete MultiLayer Perceptron.

Definition at line 162 of file multilayerperceptron.h.

Constructor & Destructor Documentation

AimsMultilayerPerceptron::AimsMultilayerPerceptron ( const AimsData< int32_t > &  topology,
int  ninputs,
float  learningrate,
float  momentum,
float  maxerror,
int  stabilitytime,
int  maxtime 
)

The constructor needs 7 parameters.

Parameters
topologydata containing the number of neurons for each layer
ninputsnumber of inputs per neuron
learningratelearning rate
momentummomentum coefficient
maxerrormaximum error to consider the network learned
stabilitytimeminimum number of epochs for the network to be considered stable
maxtimemaximum of number of epochs for the learning step
AimsMultilayerPerceptron::AimsMultilayerPerceptron ( const AimsData< int32_t > &  topology,
const AimsData< float > &  weights,
int  ninputs,
float  learningrate = 0,
float  momentum = 0,
float  maxerror = 0,
int  stabilitytime = 0,
int  maxtime = 0 
)

The constructor needs 8 parameters.

Parameters
topologydata containing the number of neurons for each layer
weightsneuron weights
ninputsnumber of inputs per neuron
learningratelearning rate [default=0]
momentummomentum coefficient [default=0]
maxerrormax error to consider the network learned [default=0]
stabilitytimeminimum number of epochs for the network to be considered stable [defaul=0]
maxtimemaximum of number of epochs for the learning step [default=0]
virtual AimsMultilayerPerceptron::~AimsMultilayerPerceptron ( )
virtual

Destructor deletes all the layers.

Member Function Documentation

void AimsMultilayerPerceptron::adjust ( const AimsData< float > &  input)

Modification of the weights.

void AimsMultilayerPerceptron::backPropagation ( )

Gradient backward propagation.

void AimsMultilayerPerceptron::forward ( const AimsData< float > &  input)

Forward propagation.

void AimsMultilayerPerceptron::learn ( const AimsData< float > &  base,
const AimsData< float > &  target,
int  counter 
)

Send a learning operation on a data base with a target.

float AimsMultilayerPerceptron::learningRate ( ) const

Return the learning rate of the network.

float AimsMultilayerPerceptron::maxError ( ) const

Return the maximum allowed error for convergence.

int AimsMultilayerPerceptron::maxTime ( ) const

Return the maximum time for learning step.

float AimsMultilayerPerceptron::momentum ( ) const

Return the momentum of the network.

int AimsMultilayerPerceptron::nInputs ( ) const

Return the number of inputs of the network.

int AimsMultilayerPerceptron::nLayers ( ) const

Return the number of layers of the network.

int AimsMultilayerPerceptron::nOutputs ( ) const

Return the number of outputs of the network.

void AimsMultilayerPerceptron::save ( const std::string &  filetopology,
const std::string &  fileweight 
)

Save the network to both G.I.S. files.

void AimsMultilayerPerceptron::setLearningRate ( float  learningrate)

Set the learning rate of the network.

void AimsMultilayerPerceptron::setMaxError ( float  maxerror)

Set the maximum allowed error for convergence.

void AimsMultilayerPerceptron::setMaxTime ( int  maxtime)

Set the maximum time for learning step.

void AimsMultilayerPerceptron::setMomentum ( float  momentum)

Set the momentum of the network.

void AimsMultilayerPerceptron::setStabilityTime ( int  stabilitytime)

Set the minimum time for the net to be stable.

int AimsMultilayerPerceptron::stabilityTime ( ) const

Return the minimum time for the net to be stable.

AimsData<float> AimsMultilayerPerceptron::test ( const AimsData< float > &  base)

Test a data base and return the result.

AimsData<int32_t> AimsMultilayerPerceptron::topology ( ) const

Return the topology of the MLP network.

AimsData<float> AimsMultilayerPerceptron::weights ( ) const

Return all the weights of all the neurons in a volume.

Member Data Documentation

AimsMLPLayer** AimsMultilayerPerceptron::_layer
protected

Pointer to layer pointers.

Definition at line 183 of file multilayerperceptron.h.

float AimsMultilayerPerceptron::_learningRate
protected

Learning rate.

Definition at line 173 of file multilayerperceptron.h.

float AimsMultilayerPerceptron::_maxError
protected

Maximum error to consider the network learned.

Definition at line 177 of file multilayerperceptron.h.

int AimsMultilayerPerceptron::_maxTime
protected

Maximum of number of epochs for the learning step.

Definition at line 181 of file multilayerperceptron.h.

float AimsMultilayerPerceptron::_momentum
protected

Momentum coefficient.

Definition at line 175 of file multilayerperceptron.h.

int AimsMultilayerPerceptron::_nInputs
protected

Number of inputs for each neuron.

Definition at line 169 of file multilayerperceptron.h.

int AimsMultilayerPerceptron::_nLayers
protected

Number of layers.

Definition at line 167 of file multilayerperceptron.h.

int AimsMultilayerPerceptron::_nOutputs
protected

Number of outputs of the network.

Definition at line 171 of file multilayerperceptron.h.

int AimsMultilayerPerceptron::_stabilityTime
protected

Minimum number of epochs for the network to be considered stable.

Definition at line 179 of file multilayerperceptron.h.

AimsData<int32_t>* AimsMultilayerPerceptron::_topology
protected

Topology of the network, i.e. number of neurons for each layer.

Definition at line 185 of file multilayerperceptron.h.


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