Professional Documents
Culture Documents
Hopfield Network
Hopfield Network
Hopfield Network
Hopfield Network
• A feedback neural network has feedback loops from
its outputs to its inputs. The presence of such loops
has a profound impact on the learning capability of
the network.
• After applying a new input, the network output is
calculated and fed back to adjust the input. This
process is repeated until the outcome becomes
constant.
• John Hopfield (1982)
– Associative Memory via artificial neural networks
– Optimisation
Neural Networks and Fuzzy Systems
Hopfield Network
x10 1 y1
w41 w31 w21 w11
x20 2 y2
.
w42 w32 w22 w12 .
.
.
.
.
xi0 i yi
. w43 w33 w23 w13 .
. .
. .
xn0 n yn
w44 w34 w24 w14
1 if x 0 It is a dynamic system:
y j (t ) sgn( x j (t )); sgn x(0)→y(0) →x(1) →y(1)…. →y*
- 1 if x 0
n
x j (t ) wij yi (t 1)
i 1
Neural Networks and Fuzzy Systems
Attractor
• Attractor
If a state x(t) in a region S and t → ∞,, x(t) →
x*
S is the attractive region.
if x*=desired state, x* is an attractor
if x*≠desired state, x* is a spurious attractor.
S
x(t)
x*
Neural Networks and Fuzzy Systems
Associative memory
• Nature of associative memory
– part of information given
– the rest of the pattern is recalled
• Hopfiled networks can be used as
associative memory. x*
– Design weight W so that
X*=the memorised patterns.
– Can store more than one. Capacity
increases
x(0)
x(0)
Neural Networks and Fuzzy Systems
Hebbian Rule
• Original rule proposed by Hebb (1949)
The organization behavior
When an axon of cell A is near enough to excite a cell B
and repeatedly or persistently takes parts in firing it,
some growth process or metabolic change takes place
in one or both cells such that A’s efficiency, as one of the
cells firing B, is increased.
That is, the correlation of activity between two cells is
reinforced by increasing the synaptic strength between them.
Neural Networks and Fuzzy Systems
Hebbian Rule
β
If a neuron α and a neuronβ are “on” at the same time, their synaptic
connection is strengthened. The next time some of them are activated
they will activate each other.
Neural Networks and Fuzzy Systems
Hebbian Rule
In other words:
1. If two neurons on either side of a synapse (connection) are activated
simultaneously (i.e. synchronously), then the strength of that synapse is
selectively increased.
Activation↑
This rule is often supplemented by:
nV l mV l ( n m )V l
if n m, V l (t 1) sgn(WV l ) V l (t )
( n m)V l V kV kTV l
k !l
Neural Networks and Fuzzy Systems
Storage Capacity
• As the number of patterns (m) increases, the chances
of accurate storage must decrease
• Hopfield’s empirical work in 1982
– About half of the memories were stored accurately in a net
of N nodes if m = 0.15N
• McCliece’s analysis in 1987
– If we require almost all the required memories to be stored
accurately, then the maximum number of patterns m is
N/(2lnN)
– For N = 100, m = 11
Neural Networks and Fuzzy Systems
An example of memorization
• Memorize the two states, (1,1,1) and (-1,-1,-1).
1 1
Y1 1 Y2 1
1 1
Example Cont’d…
W Y1Y1T Y2Y2T 2 I
• So,
1 1 1 0 0 0 2 2
W 11 1 1 1 1 1 1 2 0 1 0 2 0 2
1 1 0 0 1 2 2 0
• First activate the network by applying input vector X. Then, calculate the actual
output vector Y, and finally, compare the result with the initial input vector X.
Ym sign(WX m ), m 1,2,......., M
Assume all thresholds to be zero for this example. Thus,
0 2 2 1 1
Y1 sign 2 0 2 1 1
2 2 0 1 1
Y1=X1 and Y2=X2, so both
and states, (1,1,1) and (-1,-1,-1).
0 2 2 1 1 are said to be stable.
Y2 sign 2 0 2 1 1
2 2 0 1 1
Neural Networks and Fuzzy Systems
1 1 1 0 1 1 1 1 1 1 1 1 1
-1 1 1 0 -1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 -1 1 0 1 -1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 -1 0 1 1 -1 1 1 1
1 1 1 1 1 1 1 1 1 1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 1 0 -1 -1 1 -1 -1 -1
1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 1 -1 0 -1 1 -1 -1 -1 -1
1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1 -1 -1 0 1 -1 -1 -1 -1 -1
1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Neural Networks and Fuzzy Systems
Step 1: Storage
The n-neuron Hopfield network is required to store a set of M
fundamental memories, Y1, Y2,… YM. The synaptic weight from
neuron i to neuron j is calculated as
M
ym ,i ym , j , i ! j ,
wi , j m 1
0 i j
where ym,i and ym,j are the ith and jth elements of the fundamental
memory Ym , respectively.
Neural Networks and Fuzzy Systems
The Hopfiled network can store a set of fundamental memories if the weight
matrix is symmetrical, with zeros in its main diagonal.
0 w12 w1i w1n
w 0 w w
21 2i 2n Where wij = wji. Once the
weights are calculated, they
W remain fixed.
w w
i1 i 2 0 win
wn1 wn 2 wni 0
Neural Networks and Fuzzy Systems
Step 2: Testing
The network must recall any fundamental memory Ym when presented with it
as an input.
xm , i y m , i , i 1,2,, n; m 1,2, M
n
ym ,i sign
wij xm , j
j 1
where ym,i is the ith element of the actual vector Ym, and xm,j is the jth element of
the input vector Xm. In matrix form,
X m Ym , m 1,2,, M
Ym sign(WX m )
Neural Networks and Fuzzy Systems
Step 3: Retrieval (If all fundamental memories are called perfectly proceed to
this step.)
Present an unknown n-dimensional vector(probe), X, to the network and
retrieve a stable state. That is,
X ! Ym , m 1,2, , M
n
yi (0) sign wij x j (0) , i 1,2,...., n
j 1
Neural Networks and Fuzzy Systems
Step 3: Retrieval
where xj(0) is the jth element of the probe vector X at iteration p=0, and
yj(0) is the state of neuron i at iteration p=0.
In matrix form, the state vector at iteration p=0 is presented as
Y (0) signWX (0)
yi ( p 1) sign( xi ( p 1))
Neural Networks and Fuzzy Systems
Step 3: Retrieval
Weights for updating are selected asynchronously, that is, randomly and one
at a time.
Repeat the iteration until the state vector becomes unchanged, or in other
words, a stable state is reached.
It can be proved:
The Hopfield network will always converge to a stable state when the
retrieval operation is performed asynchronously, if wij=wji, and wii=0.
It can be proved:
The Little Model will always converge to a stable state or a limit cycle
of length at most 2 if wij=wji.
• Hebbian Learning:
– The neurons that fire together , wire together
Neural Networks and Fuzzy Systems
Summary
• Associative memory
• Discrete Hopfield Neural Networks
• Hebbian Learning Rule
Readings
Picton ’s book:
Haykin’s book: pp.289-308
Blackboad readings