KiTrack
1.7.0
|
Represents a Hopfield Neural Network. More...
#include <HopfieldNeuralNet.h>
Public Member Functions | |
HopfieldNeuralNet (std::vector< std::vector< bool > > G, std::vector< double > QI, std::vector< double > states, double omega) throw ( InvalidParameter ) | |
bool | doIteration () |
Does one iteration of the neuronal network. More... | |
void | setT (double T) |
Sets the temperature of the Neural Network (The HNN is cooled down in every iteration) | |
void | setTInf (double TInf) |
Sets the temperature at infinity. More... | |
void | setLimitForStable (double limit) |
Set the threshhold value below which the HNN is seen as "stable". More... | |
std::vector< double > | getStates () |
Protected Member Functions | |
double | activationFunction (double state, double T) |
Calculates the activation function. More... | |
Protected Attributes | |
std::vector< std::vector < double > > | _W |
the matrix of the weights | |
std::vector< double > | _States |
states describing how active a neuron is | |
std::vector< double > | _w0 |
double | _T |
temperature | |
double | _TInf |
temperature after infinite iterations | |
bool | _isStable |
indicates if the neuronal network is stable. More... | |
double | _limitForStable |
The upper limit for change of a neuron, if it should be considered stabel. More... | |
double | _omega |
Omega controls the influence of the quality indicator on the activation of the neuron. | |
std::vector< unsigned > | _order |
the order of the neurons to be updated. More... | |
HopfieldNeuralNet::HopfieldNeuralNet | ( | std::vector< std::vector< bool > > | G, |
std::vector< double > | QI, | ||
std::vector< double > | states, | ||
double | omega | ||
) | |||
throw | ( | InvalidParameter | |
) |
G | A matrix of the correlations between the neurons. True means two neurons are incompatible. False means, they are compatible. (the diagonal elements are 0 by definition and any entry there will be ignored and set to 0) |
QI | A vector containing the qualtity indicators of the neurons (i.e. their power to amplify or weaken other neurons). Quality should be indicated by a value between 0 and 1. 1 being the highest quality. |
states | The states of the neurons. Should be between 0 and 1. |
omega | Controls the influence of the quality indicator on the activation of the neuron. Needs to be between 0 and 1. 0 means, no influence from the quality of the neurons -> system tends to biggest compatible set. 1 means highest influence from the quality of the neurons -> the highest quality neurons tend to win. |
|
protected |
Calculates the activation function.
state | the state |
T | the temperature |
Referenced by doIteration().
bool HopfieldNeuralNet::doIteration | ( | ) |
Does one iteration of the neuronal network.
References _isStable, _limitForStable, _order, _States, _T, _TInf, _W, and activationFunction().
Referenced by KiTrack::SubsetHopfieldNN< T >::calculateBestSet().
|
inline |
References _States.
Referenced by KiTrack::SubsetHopfieldNN< T >::calculateBestSet().
|
inline |
Set the threshhold value below which the HNN is seen as "stable".
As long as any Neuron changes its state by a value bigger than this, the HNN is not considered stable. When all Neurons change their states so little, that none of the changes exceeds this threshold, then the HNN is stable.
References _limitForStable.
Referenced by KiTrack::SubsetHopfieldNN< T >::calculateBestSet().
|
inline |
Sets the temperature at infinity.
The temperature will converge to this value after infinite iterations.
References _TInf.
Referenced by KiTrack::SubsetHopfieldNN< T >::calculateBestSet().
|
protected |
indicates if the neuronal network is stable.
this is true when the change after one iteration of any neuron is not bigger than the value _limitForStable.
Referenced by doIteration().
|
protected |
The upper limit for change of a neuron, if it should be considered stabel.
Referenced by doIteration(), and setLimitForStable().
|
protected |
the order of the neurons to be updated.
So it should of course reach from 0 to the number of neurons -1. (4 , 2, 0 1, 3) will for example mean: update first the neuron 4, then the neuron 2, then 0 and so on
Referenced by doIteration().