![]() |
aimsalgo
5.0.5
Neuroimaging image processing
|
The class for a complete MultiLayer Perceptron. More...
#include <aims/neuralnet/multilayerperceptron.h>
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... | |
The class for a complete MultiLayer Perceptron.
Definition at line 162 of file multilayerperceptron.h.
AimsMultilayerPerceptron::AimsMultilayerPerceptron | ( | const AimsData< int32_t > & | topology, |
int | ninputs, | ||
float | learningrate, | ||
float | momentum, | ||
float | maxerror, | ||
int | stabilitytime, | ||
int | maxtime | ||
) |
The constructor needs 7 parameters.
topology | data containing the number of neurons for each layer |
ninputs | number of inputs per neuron |
learningrate | learning rate |
momentum | momentum coefficient |
maxerror | maximum error to consider the network learned |
stabilitytime | minimum number of epochs for the network to be considered stable |
maxtime | maximum 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.
topology | data containing the number of neurons for each layer |
weights | neuron weights |
ninputs | number of inputs per neuron |
learningrate | learning rate [default=0] |
momentum | momentum coefficient [default=0] |
maxerror | max error to consider the network learned [default=0] |
stabilitytime | minimum number of epochs for the network to be considered stable [defaul=0] |
maxtime | maximum of number of epochs for the learning step [default=0] |
|
virtual |
Destructor deletes all the layers.
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.
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.
|
protected |
Pointer to layer pointers.
Definition at line 183 of file multilayerperceptron.h.
|
protected |
Learning rate.
Definition at line 173 of file multilayerperceptron.h.
|
protected |
Maximum error to consider the network learned.
Definition at line 177 of file multilayerperceptron.h.
|
protected |
Maximum of number of epochs for the learning step.
Definition at line 181 of file multilayerperceptron.h.
|
protected |
Momentum coefficient.
Definition at line 175 of file multilayerperceptron.h.
|
protected |
Number of inputs for each neuron.
Definition at line 169 of file multilayerperceptron.h.
|
protected |
Number of layers.
Definition at line 167 of file multilayerperceptron.h.
|
protected |
Number of outputs of the network.
Definition at line 171 of file multilayerperceptron.h.
|
protected |
Minimum number of epochs for the network to be considered stable.
Definition at line 179 of file multilayerperceptron.h.
|
protected |
Topology of the network, i.e. number of neurons for each layer.
Definition at line 185 of file multilayerperceptron.h.