KiTrack  1.7.0
HopfieldNeuralNet.h
1 #ifndef HopfieldNeuralNet_h
2 #define HopfieldNeuralNet_h
3 
4 
5 #include <vector>
6 
7 #include "KiTrackExceptions.h"
8 
9 namespace KiTrack{
10 
19 
20 
21  public:
22 
37  HopfieldNeuralNet( std::vector < std::vector <bool> > G , std::vector < double > QI , std::vector < double > states , double omega) throw( InvalidParameter );
38 
39 
48  bool doIteration();
49 
53  void setT (double T) { _T = T;};
54 
59  void setTInf (double TInf) {_TInf = TInf;};
60 
66  void setLimitForStable (double limit) { _limitForStable = limit; };
67 
68 
71  std::vector <double> getStates(){ return _States; };
72 
73 
74 
75  protected:
76 
77 
78 
80  std::vector < std::vector <double> > _W;
81 
83  std::vector < double > _States;
84 
85 
86  std::vector < double > _w0;
87 
89  double _T;
90 
92  double _TInf;
93 
98  bool _isStable;
99 
102 
105  double _omega;
106 
110  std::vector <unsigned> _order;
111 
112 
119  double activationFunction ( double state , double T );
120 
121 
122  };
123 
124 
125 }
126 
127 
128 #endif
129 
void setT(double T)
Sets the temperature of the Neural Network (The HNN is cooled down in every iteration) ...
Definition: HopfieldNeuralNet.h:53
Represents a Hopfield Neural Network.
Definition: HopfieldNeuralNet.h:18
std::vector< unsigned > _order
the order of the neurons to be updated.
Definition: HopfieldNeuralNet.h:110
Invalid Parameter exception.
Definition: KiTrackExceptions.h:56
HopfieldNeuralNet(std::vector< std::vector< bool > > G, std::vector< double > QI, std::vector< double > states, double omega)
Definition: HopfieldNeuralNet.cc:11
double _T
temperature
Definition: HopfieldNeuralNet.h:89
double _TInf
temperature after infinite iterations
Definition: HopfieldNeuralNet.h:92
std::vector< double > getStates()
Definition: HopfieldNeuralNet.h:71
double activationFunction(double state, double T)
Calculates the activation function.
Definition: HopfieldNeuralNet.cc:149
std::vector< double > _States
states describing how active a neuron is
Definition: HopfieldNeuralNet.h:83
bool doIteration()
Does one iteration of the neuronal network.
Definition: HopfieldNeuralNet.cc:165
double _omega
Omega controls the influence of the quality indicator on the activation of the neuron.
Definition: HopfieldNeuralNet.h:105
double _limitForStable
The upper limit for change of a neuron, if it should be considered stabel.
Definition: HopfieldNeuralNet.h:101
void setLimitForStable(double limit)
Set the threshhold value below which the HNN is seen as "stable".
Definition: HopfieldNeuralNet.h:66
void setTInf(double TInf)
Sets the temperature at infinity.
Definition: HopfieldNeuralNet.h:59
std::vector< std::vector< double > > _W
the matrix of the weights
Definition: HopfieldNeuralNet.h:71
bool _isStable
indicates if the neuronal network is stable.
Definition: HopfieldNeuralNet.h:98