Professional Documents
Culture Documents
Hopfield Network Example Training and Testing
Hopfield Network Example Training and Testing
Training:
Binary Patterns: P1 =1110, P2 = 0001 Threshold=1
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
1 1 1 0
1 0 1 1 -1
1 1 0 1 -1
1 1 1 0 -1
0 -1 -1 -1 0
0 0 0 1
0 0 2 2 -2
0 2 0 2 -2
0 2 2 0 -2
1 -2 -2 -2 0
Recall or Testing
Suppose the first pattern P1 is distorted to 0110
0 1 1 0 Update
First neuron
0 2 2 -2 4=1 (changed)
2 0 2 -2
2 2 0 -2
-2 -2 -2 0
1 1 1 0 Update
Third neuron
0 2 2 -2
2 0 2 -2
2 2 0 -2 4=1 (no change)
-2 -2 -2 0
1 1 1 0 Update fourth
neuron
0 2 2 -2
2 0 2 -2
2 2 0 -2
-2 -2 -2 0 -6=0 (no change)
1 1 1 0 Update second
neuron
0 2 2 -2
2 0 2 -2 4=1 (no change)
2 2 0 -2
-2 -2 -2 0
So, the pattern that will be recalled after seeing 0110 is 1110.
Suppose we are feeding slightly distorted version of pattern P2 i.e., 1001
1 0 0 1 Update second
neuron
0 2 2 -2
2 0 2 -2 0=0 (no change)
2 2 0 -2
-2 -2 -2 0
1 0 0 1 Update first
neuron
0 2 2 -2 -2 = 0 (changed)
2 0 2 -2
2 2 0 -2
-2 -2 -2 0 -2 =0 (changed)
0 0 0 1 Update third
neuron
0 2 2 -2
2 0 2 -2
2 2 0 -2 -2 =0 (changed)
-2 -2 -2 0
0 0 0 1 Update fourth
neuron
0 2 2 -2
2 0 2 -2
2 2 0 -2
-2 -2 -2 0