









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










One of the primary functions of the brain is associative memory. We associate the faces with names, letters with sounds, or we can recognize the people even if they have sunglasses or if they are somehow elder now.
Associative memories can be implemented either by using feedforward or recurrent neural networks. Such associative neural networks are used to associate one set of vectors with another set of vectors, say input and output patterns. The aim of an associative memory is, to produce the associated output pattern whenever one of the input pattern is applied to the neural network. The input pattern may be applied to the network either as input or as initial state, and the output pattern is observed at the outputs of some neurons constituting the network. According to the way that the network handles errors at the input pattern, they are classified as interpolative and accretive memory. In the interpolative memory it is allowed to have some deviation from the desired output pattern when added some noise to the related input pattern. However, in accretive memory, it is desired the output to be exactly the same as the associated output pattern, even if the input pattern is noisy. Another classification of associative memory is such that while the memory in which the associated input and output patterns differ are called heteroassociative memory , it is called autoassociative memory if they are the same.
In this chapter, first the basic definitions about associative memory is given and then it is explained how neural networks can be made linear associators so as to perform as interpolative memory. Next it is explained how the Hopfield network can be used as autoassociative memory and then Bipolar Associative Memory network, which is designed to operate as heteroassociative memory, is introduced.
In an associative memory, we store a set of patterns μ k , k =1... K, so that the network responds by producing whichever of the stored patterns most closely resembles the one presented to the network
Here we need a measure for defining resemblance of the patterns. For this purpose the norms that were introduced in Section 2.1 may be used. While Euclidean distance is convenient for the continuous valued pattern vectors, Hamming distance, which gives the number of mismatched components, is more appropriate for patterns with binary or bipolar entries.
Suppose that the stored patterns, which are called exemplars or memory elements, are in the form of pairs of associations, μ k =( u k, y k ), u k ∈RN , y k ∈RM, k =1..K. According to the mapping ϕ: RN→RM^ that they implement, we distinguish the following types of associative memories:
k
r (^) such that r
k (^) - u ||, k=1..K (3.1.2)
The accretive associative memory in the form given above is called heteroassociative memory. However if the stored exemplars are in a special form such that the desired patterns and the input patterns are the same, that is y k= u k^ for k = 1..K , then it is called autoassociative memory. In such a memory, whenever u is presented to the memory it responds by u r which is the closest one to u among u k , k = 1..K , that is,
k
r (^) such that r
k (^) - u || k=1..K (3.1.3)
presented to the network by setting x (0)= μ k^ , then the network should stay converged to x *=μ r^ (Figure 3.1).
Figure 3.1 In associative memory each memory element is assigned to an attractor
A second way to use recurrent networks as associative memory, is to present the input pattern u r^ to the system as an external input. This can be done by setting θ= u r , where θ is the threshold vector whose i th^ component is corresponding to the threshold of neuron i. After setting x (0) to some fixed value we relax the network and then wait until it converges to an attractor x *. For a good performance of the network, we desire the network to have a single attractor such that x *=μ k^ for each stored input pattern u k , therefore the network will converge to this attractor independent of the initial state of the network. Another solution to the problem is to have predetermined initial values, so that these initial values lie within the basin attraction of μ k^ whenever u k^ is applied. We will consider this kind of networks in Chapter 7 in more detail, where we will examine how these recurrent networks are trained.
It is quite easy to implement interpolative associative memory when the set of input memory elements { u k } constitutes an othonormal set of vectors, that is
u i^ u j^ i^ j i j
By using kronecker delta, we write simply
The mapping function ϕ( u ) defined below may be used to establish an interpolative associative memory:
where T^ denotes transpose and
W = (^) ∑ u k^ × y k k
Here the symbol × is used to denote outer product of x ∈R N^ and y ∈R M , which is defined as
u k^ × y k = u k y k T =( y k u^ k T)T , (3.2.5)
resulting in a matrix of size N by M.
By defining matrices [Haykin 94]:
U =[ u^1 u^2 .. u k.. u K ] (3.2.6) and Y =[ y^1 y^2 .. y k.. y K ] (3.2.7)
the weight matrix can be formulated as
W T^ = YU T (3.2.8)
If the network is going to be used as autoassociative memory we have Y = U so,
W T^ = UU T (3.2.9)
For a function ϕ( u ) to constitute an interpolative associative memory, it should satisfy the condition
Such a memory can be implemented as shown in Figure 3.2 by using M neurons each having N inputs. The connection weights of neuron i is assigned value W i , which is the ith^ column vector of matrix W. Here each neuron has a linear output transfer function f(a)=a. When a stored pattern u k^ is applied as input to the network, the desired value y k^ is observed at the output of the network as:
x k^ = W T^ u k (3.2.19)
Figure 3.2 Linear Associator
Until now, we have investigated the use of linear mapping YU T^ as associative memory, which works well when the input patterns are orthonormal. In the case the input patterns are not orthonormal, the linear associator cannot map some input patterns to desired output patterns without error. In the following we will investigate the conditions necessary to minimize the output error for the exemplar patterns. That is, for a given set of exemplars μ k =( u k, y k ), u k ∈R N,^ y k ∈R M , k = 1.. K , our purpose is to find a linear mapping A * among A : R N →R M^ such that:
A A
|| y k^ - Au k^ || (3.2.20)
where ||.|| is chosen as Euclidean norm.
The problem may be reformulated by using the matrices U and Y [Haykin 94]:
A A
(^1 2) i M
output layer
input layer
u (^) 1 u (^) 2 u (^) j u N
x (^) 1 x^ 1 x^ i x^ M
The pseudo inverse method [Kohonen 76] based on least squares estimation provides a solution for the problem in which A * is determined as:
**A ***^ = YU +^ (3.2.22)
where U +^ is pseudo inverse of U.
The pseudoinverse U+ is a matrix satisfying the condition:
U U +^ = 1 (3.2.23)
where 1 is the identity matrix. A perfect match is obtained by using **A ***^ = YU +^ , since
A U *^ = YU U +^ = Y (3.2.24)
resulting in no error due to the fact
|| Y - A * U || = 0 (3.2.25)
In the case the input patterns are linearly independent, that is none of them can be obtained as a linear combinations of the others, then a matrix U + satisfying Eq. (3.2.23) can be obtained by applying the formula [Golub and Van Loan 89, Haykin 94]
U +^ = ( U T U^ )−^1 U T (3.2.26)
Notice that for the input patterns, which are the columns of the matrix U , to be linearly independent, the number of columns should not be more than the number of rows, that is K ≤ N , otherwise U T U will be singular and no inverse will exist. The condition K ≤ N means that the number of entries constituting the patterns restricts the capacity of the memory. At most N patterns can be stored in such a memory.
This memory can be implemented by a neural network for which W T= YU +^. The desired value y k^ appears at the output of the network as x k^ when u k^ is applied as input to the network:
x k^ = W T^ u k (3.2.27)
Note that, whenever the patterns to be stored in Hopfield network are from N dimensional bipolar space constituting a hypercube, that is u k ∈{-1,1} N , k=1..K , then it is convenient to have any stable state of the network on the corners of the hypercube. For this purpose refer to the output transfer function given by Eq. (2.9.3) and to Figure 2.7 for different values of the gain. If we let the output transfer function of the neurons in the network to have a very high gain, in the extreme case
we obtain
f a a
for a for a for a
i (^ )^ =^ sign(^ )=
Furthermore note that the second term of the energy function given by Eq. (2.9.7) that we repeat here for convenience:
i
N i i
N i
x R
N i
N j ji^ j i
− = = =
1
1 1 0
1 1 1
approaches to zero. Therefore the stable states of the network corresponds to the local minima of the function:
E = − 2 ∑ i ∑ j wjixjxi − ∑ i θ ixi
so that they lie on the corners of the hypercube as explained previously.
In section 2.10, we have derived the discrete time approximation for continuous time Hopfield network described in section 2.9. However in this section we investigate a special case of the Hopfield network where the stable states of the network are forced to take discrete values in bipolar state space. Knowing in advance that the local minima of the energy function should take place at the corners of the N dimensional hypercube, we can get rid of the slow convergence problem due to small value of η.
For this purpose a discrete state excitation [Hopfield 82] of the network, is provided in the following:
x k f a k
for a k x k for a k for a k
i i
i i i
where ai ( k ) is defined in a manner similar to that we used to:
a (^) i k w (^) jix k j
( ) = (^) ∑ j ( )+θ i (3.3.6)
The processing elements of the network are updated one at a time, such that all of the processing elements must be updated at the same average rate.
Note that, for any vector x having bipolar entries, that is xi ∈{-1,1}, we obtain the vector itself if we apply the function defined by Eq. (3.3.5) on it, that is
f ( x )= x (3.3.7)
Here f is used to denote the vector function such that the function f is applied at each entry.
For stability of the discrete Hopfield network, it is further required wii =0 in addition to the constraint wij = wji
In order to use discrete Hopfield network as autoassociative memory, its weights are fixed to
W T^ = UU T (3.3.8)
where U is the input pattern matrix as defined in Eq. (3.2.6). Remember that in autoassociative memory we have Y = U , where Y is the matrix of desired output patterns as defined in Eq (3.2.7). For the stability of the network, the diagonal entries of W is set to 0, that is wii =0, i =1.. N
If all the states of the network are to be updated at once, then the next state of the system can be represented in the form
or x (^) p ( k )=1 and x (^) p ( k +1)= -1 due to fact ap ( k )<0. Whatever the case is, if xp ( k +1)≠ x (^) p ( k ) it is in a direction for which ∆ E <0. Therefore, for discrete Hopfield network we have
∆ E ≤ 0 (3.3.14)
Because at each state change, the energy function decreases at least by some fixed minimum amount, and because the energy function is bounded, it reaches a minimum value in a finite number of state changes. So the Hopfield network converges to one stable state in finite time in contrary to the asymptotic convergence in the continuous Hopfield network. The schedule, in which only one unit of the discrete Hopfield network is updated at a time, is called asynchronous update. The other approach in which all the units are updated at once is called synchronous update. Although the convergence with the asynchronous update mechanism is guaranteed, it may result in a cycle of length two in synchronous update.
It should be noted that, the continuous deterministic model implies the possibility of implementing the discrete network in actual hardware because of the close relation between discrete and continuous models. However, the discrete model is often implemented through computer simulations because of its simplicity.
Exercise: Explain how can we use the Hopfield network as autoassociative memory if the states are not from bipolar space {-1,1} N^ but from binary space{0,1} N^.
The Bi-directional Associative Memory (BAM) introduced in [Kosko 88] is a recurrent network (Figure 3.4) designed to work as heteroassociative memory [Nielsen 90]. BAM network consists of two sets of neurons whose outputs are represented by vectors x ∈ R N^ and v ∈R M^ respectively, having activation defined by the pair of equations:
a w f a for i M dt
da i
N i x j ji v
x i j
i (^) ( ) 1 .. 1
a w f a for j N dt
da j
M j y i ij x
v j i
j ( ) 1 .. 1
where α i , β j , θ i , φ j are positive constants for all i = 1..M , j = 1..N , f is sigmoid function and W =[ wij ] is any N × M real matrix.
The stability of the BAM network can be proved easily by applying Cohen-Grossberg theorem on the state vector z ∈R N+M^ defined as
v j i M M i M N
x i M z j
i i (^) = − < ≤ +
that is z obtained through concatenation x and v.
Figure 3.4: Bi-directional Associative Memory
Since BAM is a special case of the network defined by Cohen-Grossberg theorem, it has a Lyapunov Energy function as it is provided in the following:
j
N i j j
M i i
a i
N j
a i
M i
ij x v
N j
M i
f x f v
f aada f bbdb
E w f a f a
xi vi
i j
θ φ
α β
1 1
1 0 1 0
1 1
∑ ∑
∑ ∫ ∑ ∫
∑∑
= =
= =
= =
xv =−
(3.4.4)
The discrete BAM model is defined in a manner similar to discrete Hopfield network. The output functions are chosen to be f ( a )=sign( a ) and states are excited as:
x layer
v layer
(^1 2) i M
1 2 j N
For the special case of orthonormal input and output patterns we have
f ( W T u r )= f ( YU T u r )= f ( y r )= y r^ (3.4.14) and
f ( Wy r )= f ( UY T y r )= f ( u r )= u r^ (3.4.15)
indicating that exemplars are stable states of the network. Whenever the initial state is set to one of the exemplar, the system remains there. For arbitrary initial states the network converges to one of the stored exemplars, depending on the basin of attraction in which x (0) lies.
For the input patterns that are not orthonormal, the network behaves as it is explained for the Hopfield network.
Exercise: Compare the special case U=Y of BAM with Hopfield Autoassociative memory.