Hopfield network demonstration

(c) David J.C. MacKay | Lecture course | Book | Other demonstrations |
This demo uses perl (version 4).

Please download Demonstration program (perl) and Data file. Save these as demo.p and dat.

Usage

demo.p
Hit return a couple of times.
This will display the 3 desired memory states of a 25-neuron Hopfield network. (These are read from the file dat)
Then the weights given by the Hebbian learning rule.
Then each desired memory is tested to see if it is stable.
Phase S: gradually increasing noise is added to each desired memory to see if it is restored.
Phase C: Weights are chopped out of the network (i.e. set to zero) and the restoring ability of the network is tested again (using 0.15 noise level). Even when half of the weights are deleted, the memory still works pretty well.

Further examples

To try to store more memories,
demo.p  states=1 corrupt=1 N=4
demo.p  states=1 corrupt=1 N=5
demo.p  states=1 corrupt=1 N=6
To switch off Phase S, use states=0, e.g.
demo.p  states=0 corrupt=1 N=5
To switch off Phase C, use
corrupt=0

David MacKay <mackay@mrao.cam.ac.uk>
Last modified: Fri Mar 28 15:12:56 1997