Task On Hopfield Networks
Task On Hopfield Networks
Procedure for establishing a weight matrix and for calculation of a new of a test case using a matrix approach:
1. Define X with the three training vectors as rows
2. Define the weight matrix W = XTX
3. Normalise weight matrix W by dividing with N (number of training vectors)
4. Evaluate test case by multiplying test case with the normalized W.
5. Apply a threshold function with threshold = 0 to all elements in resulting vector.
1 1 -1
- 1 1 1 3 1 3 1 1/3 1
XT = 1 -1 -1 1. X = 1 -1 1 2. 1. XTX = 1 3 1 3. 1/3 1 1/3
1 1 -1 -1 -1 -1 3 1 3 1 1/3 1
Updating the state of one unit in the Hopfield network is performed using the following rule:
Thus, the values of neurons i and j will converge if the weight between them is positive. Similarly, they will
diverge if the weight is negative.
1/3
p1
1/3
-1/3 -1/3 = 1 2
1/3 3 4
-1
Stable State
Hopfield Network Example (3) Matrix calculation to retrieve state
V1 = 1 1 1-1 V2 = 1 1 -1 1 V3 = -1 1 1 -1 N=3 Stable unit states = -1, 1 Testcase = 1 0 0 1
Procedure for establishing a weight matrix and for calculation of a new of a test case using a matrix approach:
1. Define X with the three training vectors as rows
2. Define the weight matrix W = XTX
3. Normalise weight matrix W by dividing with N (number of training vectors)
4. Evaluate test case by multiplying test case with the normalized W.
5. Apply a threshold function with threshold = 0 to all elements in resultivng vector.
Test 1 0 0 -1 1 1/3 -1/3 1/3 - > 2/3 2/3 2/3 -2/3 -> S = 1 1 1 -1
1/3 1 1/3 -1/3 Retrieved state
-1/3 1/3 1 -1
1/3 -1/3 -1 1
Solution to Q11
1 1 -1
- 1 1 1 3 1 3 1 1/3 1
XT = 1 -1 -1 1. X = 1 -1 1 2. 1. XTX = 1 3 1 3. 1/3 1 1/3
1 1 -1 -1 -1 -1 3 1 3 1 1/3 1
S = 1 0 0 * 1 1/3 1 = 1 1 1
1/3 1 1/3
1 1/3 1