#include <HopfieldNetwork.h>
Inheritance diagram for annie::HopfieldNetwork:

Public Methods | |
| HopfieldNetwork (int size) | |
| HopfieldNetwork (int size, bool bias, bool bipolar) | |
| HopfieldNetwork (const char *filename) | |
| virtual | ~HopfieldNetwork () |
| Cleans up memory by getting rid of the weight matrix and neurons. More... | |
| virtual void | addPattern (int pattern[]) |
| virtual real | getEnergy () |
| Returns the energy at the current state of the network. More... | |
| virtual real | getEnergy (int pattern[]) |
| virtual int | getSize () |
| Returns the size of the patterns that can be stored (i.e., length of the pattern vector). More... | |
| virtual void | step () |
| Steps the network in time. More... | |
| virtual int | getTime () |
| virtual int | getPatternCount () |
| virtual Matrix | getWeightMatrix () |
| Returns a copy of the weight matrix that is used by this network. More... | |
| virtual const char * | getClassName () |
| Returns "HopfieldNetwork". More... | |
| virtual void | save (const char *filename) |
| virtual void | setWeight (int i, int j, real weight) |
| virtual real | getBias (int i) |
| virtual void | setBias (int i, real bias) |
| virtual void | setInput (int pattern[]) |
| virtual void | setInput (std::vector< int > &pattern) |
| virtual std::vector< int > | getOutput () |
| virtual std::vector< int > | getNextOutput () |
| virtual VECTOR | getOutput (VECTOR &input) |
| virtual bool | propagate (int pattern[], int timeout) |
| virtual bool | propagate (std::vector< int > &pattern, int timeout) |
Protected Methods | |
| virtual bool | _equal (std::vector< int > &p1, std::vector< int > &p2) |
Protected Attributes | |
| bool | _bipolar |
| true if patterns are bipolar (ie, elements are -1 or 1), false if not (elements are 0 or 1). More... | |
| int | _nPatterns |
| The number of patterns that have been given to the network to be stored. More... | |
| Matrix * | _weightMatrix |
| The weight matrix of the network. More... | |
| RecurrentNeuron ** | _neurons |
| The recurrent neurons, each of them is connected to everyone else with weights from the weight matrix. More... | |
| int | _time |
Hopfield also introduced another important idea by establishing a new connection between computation and physics with the concept of energy in his model and showed that computation can be viewed as a transition to lower energy states.
|
|
Creates a Hopfield network, which can store bipolar binary patterns (i.e., patterns consisting of -1's and 1's). Diagonal elments of the weight matrix will be zero. Neurons will NOT have a bias.
|
|
||||||||||||||||
|
Creates a Hopfield network, which can store binary patterns. Diagonal elments of the weight matrix will be zero.
|
|
|
Loads a Hopfield network from a file.
|
|
|
Cleans up memory by getting rid of the weight matrix and neurons.
|
|
||||||||||||
|
|
|
|
Adds a pattern to the network by making suitable adjustments to the weight matrix.
|
|
|
Get the bias at the given neuron
|
|
|
Returns "HopfieldNetwork".
Implements annie::Network. |
|
|
Returns the energy of the supplied pattern. Energy of a pattern depends on the weight matrix |
|
|
Returns the energy at the current state of the network.
|
|
|
Steps the network through one unit of time and returns the output.
|
|
|
The HopfieldNetwork generally deals with vectors of integers only because the neurons are binary. But since this class implements the Network class, it must provide this function as well, which returns the same thing as setInput() following by getOutput() would, except that the neuron's output will be of type real instead of int Implements annie::Network. |
|
|
Returns the current outputs of the neurons.
|
|
|
The number of patterns that the network has been instructed to store This will be the same as the number of calls to addPattern
|
|
|
Returns the size of the patterns that can be stored (i.e., length of the pattern vector).
|
|
|
The number of steps the network has taken since the last call to getOutput
|
|
|
Returns a copy of the weight matrix that is used by this network.
|
|
||||||||||||
|
Sets the initial input of the network and then steps through time, returning true if the network converges before the given timeout.
|
|
||||||||||||
|
Sets the initial input of the network and then steps through time, returning true if the network converges before the given timeout.
|
|
|
Saves the network to a file
Implements annie::Network. |
|
||||||||||||
|
Sets the bias of the given neuron.
|
|
|
Sets the initial output of the neuron to the values in the given vector of integers and sets time to 0.
|
|
|
Sets the initial output of the neurons to the values in the given array and resets time to 0.
|
|
||||||||||||||||
|
Sets the weight between the ith and jth neuron. Since the weights are symmetruc, the weight between neuron i and neuron j will be the same as the weight between neuron j and neuron i, which will be the same as the weight supplied.
|
|
|
Steps the network in time.
|
|
|
true if patterns are bipolar (ie, elements are -1 or 1), false if not (elements are 0 or 1).
|
|
|
The recurrent neurons, each of them is connected to everyone else with weights from the weight matrix.
|
|
|
The number of patterns that have been given to the network to be stored.
|
|
|
|
|
|
The weight matrix of the network.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002