aimsalgo  5.0.5
Neuroimaging image processing
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() [1/2]

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() [2/2]

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]

◆ ~AimsMultilayerPerceptron()

virtual AimsMultilayerPerceptron::~AimsMultilayerPerceptron ( )
virtual

Destructor deletes all the layers.

Member Function Documentation

◆ adjust()

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

Modification of the weights.

◆ backPropagation()

void AimsMultilayerPerceptron::backPropagation ( )

Gradient backward propagation.

◆ forward()

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

Forward propagation.

◆ learn()

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

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

◆ learningRate()

float AimsMultilayerPerceptron::learningRate ( ) const

Return the learning rate of the network.

◆ maxError()

float AimsMultilayerPerceptron::maxError ( ) const

Return the maximum allowed error for convergence.

◆ maxTime()

int AimsMultilayerPerceptron::maxTime ( ) const

Return the maximum time for learning step.

◆ momentum()

float AimsMultilayerPerceptron::momentum ( ) const

Return the momentum of the network.

◆ nInputs()

int AimsMultilayerPerceptron::nInputs ( ) const

Return the number of inputs of the network.

◆ nLayers()

int AimsMultilayerPerceptron::nLayers ( ) const

Return the number of layers of the network.

◆ nOutputs()

int AimsMultilayerPerceptron::nOutputs ( ) const

Return the number of outputs of the network.

◆ save()

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

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

◆ setLearningRate()

void AimsMultilayerPerceptron::setLearningRate ( float  learningrate)

Set the learning rate of the network.

◆ setMaxError()

void AimsMultilayerPerceptron::setMaxError ( float  maxerror)

Set the maximum allowed error for convergence.

◆ setMaxTime()

void AimsMultilayerPerceptron::setMaxTime ( int  maxtime)

Set the maximum time for learning step.

◆ setMomentum()

void AimsMultilayerPerceptron::setMomentum ( float  momentum)

Set the momentum of the network.

◆ setStabilityTime()

void AimsMultilayerPerceptron::setStabilityTime ( int  stabilitytime)

Set the minimum time for the net to be stable.

◆ stabilityTime()

int AimsMultilayerPerceptron::stabilityTime ( ) const

Return the minimum time for the net to be stable.

◆ test()

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

Test a data base and return the result.

◆ topology()

AimsData<int32_t> AimsMultilayerPerceptron::topology ( ) const

Return the topology of the MLP network.

◆ weights()

AimsData<float> AimsMultilayerPerceptron::weights ( ) const

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

Member Data Documentation

◆ _layer

AimsMLPLayer** AimsMultilayerPerceptron::_layer
protected

Pointer to layer pointers.

Definition at line 183 of file multilayerperceptron.h.

◆ _learningRate

float AimsMultilayerPerceptron::_learningRate
protected

Learning rate.

Definition at line 173 of file multilayerperceptron.h.

◆ _maxError

float AimsMultilayerPerceptron::_maxError
protected

Maximum error to consider the network learned.

Definition at line 177 of file multilayerperceptron.h.

◆ _maxTime

int AimsMultilayerPerceptron::_maxTime
protected

Maximum of number of epochs for the learning step.

Definition at line 181 of file multilayerperceptron.h.

◆ _momentum

float AimsMultilayerPerceptron::_momentum
protected

Momentum coefficient.

Definition at line 175 of file multilayerperceptron.h.

◆ _nInputs

int AimsMultilayerPerceptron::_nInputs
protected

Number of inputs for each neuron.

Definition at line 169 of file multilayerperceptron.h.

◆ _nLayers

int AimsMultilayerPerceptron::_nLayers
protected

Number of layers.

Definition at line 167 of file multilayerperceptron.h.

◆ _nOutputs

int AimsMultilayerPerceptron::_nOutputs
protected

Number of outputs of the network.

Definition at line 171 of file multilayerperceptron.h.

◆ _stabilityTime

int AimsMultilayerPerceptron::_stabilityTime
protected

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

Definition at line 179 of file multilayerperceptron.h.

◆ _topology

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: