A Hopfield neural network is a simple neural network that contains a single layer of four interconnected neurons. The following applet demonstrates a 4-neuron Hopfield neural network.
Hopfield Neural Network
- Notice the activation weight matrix is empty(all zeros). This neural network has no knowledge. Lets teach it to recognize the pattern 1001. Enter 1001 under the "Input pattern to run or train". Click the train button. Notice the weight matrix adjust to absorb the new knowledge.
- Now test it. Enter the pattern 1001 into the "Input pattern to run or train"(it should still be there from your training). The output will be "1001". This is an autoassociative network, therefore it echos the input if it recognizes it.
- Lets test it some more. Enter the pattern 1000 and click "Run". The output will now be "1001". The neural network did not recognize "1000", but the closest thing it knew was "1001". It figured you made an error typing and attempted a correction!
- Now, notice a side effect. Enter "0110", which is the binary inverse of what the network was trained with ("1001"). Hopfield networks ALWAYS get trained for the binary inverse too. So if you enter "0110", the network will recognize it.
- Likewise, if you enter "0100" the neural network will output "0110" thinking that is what you meant.
- Now one final test. Lets try "1111", which is totally off base and not close to anything the neural network knows. The neural network responds with ?0000?, it did not try to correct, it has no idea what you mean!! (your confusing it, please stop ;) )
- Play with it more. It can be taught more than one pattern. As you train new patterns it builds upon the matrix already in memory. Pressing ?Clear? clears out the memory.
To the left is a Hopfield neural network. A Hopfield neural network is one of the most simple neural network models. A Hopfield neural network is an autoassociative fully connected neural network. The one presented to the right is trainable. The instructions for use are presented below.
When you first come to this page the Hopfield applet has no knowledge and is only capable of recognizing a few random patterns. You can train this neural network to recognize 4 digit binary patterns (i.e. 1001, 0101, etc). Once it has been trained to accept a few patterns you can input a new pattern and run the neural network. Once trained, the neural network can recall the patterns you entered. To see an example, complete the following steps.
[Download Source Code]