# Fixed points of Hopfield type neural networks

## Abstract

The set of the fixed points of the Hopfield type network is under investigation. The connection matrix of the network is constructed according the Hebb rule from the set of memorized patterns which are treated as distorted copies of the standard-vector. It is found that the dependence of the set of the fixed points on the value of the distortion parameter can be described analytically. The obtained results are interpreted in the terms of neural networks and the Ising model.

$`\mathrm{𝟏}^{}.`$ The problem of maximization of a symmetric form which is quadratic in spin variables $`\sigma _i`$:

$$\{\begin{array}{c}F(\stackrel{}{\sigma })=_{i,j=1}^nJ_{ij}\sigma _i\sigma _j\mathrm{max},\sigma _i=\{\pm 1\},\hfill \\ \stackrel{}{\sigma }=(\sigma _1,\mathrm{},\sigma _n),J_{ij}=J_{ji},i,j=1,2,\mathrm{},n.\hfill \end{array}$$
$`(1)`$   
is under investigation. This problem arises in the Ising model, in the surface physics, in the theory of optimal coding, in factor analysis, in the theory of neural networks and in the optimization theory . Here the aim is to obtain an effective method for the search of the global maximum of the functional and a constructive description of the set of its local extrema.

The $`n`$-dimensional vectors $`\stackrel{}{\sigma }`$, which define $`2^n`$ configurations, will be called the configuration vectors. The configuration vector which gives the solution of the problem (1) will be called the ground state. We investigate the problem (1) in the case of the connection matrix constructed with regard to the Hebb rule from the $`(p\times n)`$-matrix $`𝐒`$ of the form

$$𝐒=\left(\begin{array}{ccccccc}1x& 1& \mathrm{}& 1& 1& \mathrm{}& 1\\ 1& 1x& \mathrm{}& 1& 1& \mathrm{}& 1\\ \mathrm{}& \mathrm{}& \mathrm{}& \mathrm{}& \mathrm{}& \mathrm{}& \mathrm{}\\ 1& 1& \mathrm{}& 1x& 1& \mathrm{}& 1\end{array}\right),$$
$`(2)`$   
where $`x`$ is an arbitrary real number. We introduce the special notation $`𝐍`$ for the related connection matrix:

$$𝐍=𝐒^𝐓𝐒,N_{ii}=0,i=1,2,\mathrm{},n.$$
$`(3)`$   
According to the conventional neural network tradition we treat the $`n`$-dimensional vectors $`\stackrel{}{s}^{(l)}`$, which are the rows of the matrix $`𝐒`$, as $`p`$ memorized patterns embedded in the network memory (it does not matter that not all the elements of the matrix $`𝐒`$ are equal $`\{\pm 1\}`$; see Note 1). Then the following meaningful interpretation of the problem can be suggested: the network had to be learned by p-time showing of the standard $`\stackrel{}{\epsilon }(n)=(1,1,\mathrm{},1)`$, but an error had crept into the learning process and in fact the network was learned with the help of its $`p`$ distorted copies; the value of the distortion $`x`$ was the same for all the memorized patterns and every time only one coordinate had been distorted:

$$\stackrel{}{s}^{(l)}=(1,\mathrm{},1,\underset{l}{\underset{}{1x}},1,\mathrm{},1),l=1,2,\mathrm{},p.$$
$`(4)`$   
When $`x`$ is equal zero, the network is found to be learned by $`p`$ copies of the standard $`\stackrel{}{\epsilon }(n)`$. It is well-known that in this case the vector $`\stackrel{}{\epsilon }(n)`$ itself is the ground state and the functional has no other local maxima. For continuity reasons, it is clear that the same situation remains for a sufficiently small distortion $`x`$. But when $`x`$ increases the ground state changes. For the problem (1)-(3) we succeeded in obtaining the analytical description of the dependence of the ground state on the value of the distortion parameter.

Notations. We denote by $`\stackrel{}{\epsilon }(k)`$ the configuration vector which is collinear to the bisectrix of the principle orthant of the space $`\mathrm{R}^\mathrm{k}`$. The vector, which after $`p`$ distortions generates the set of the memorized patterns $`\stackrel{}{s}^{(l)}`$, is called the standard-vector. Next, $`n`$ is the number of the spin variables, $`p`$ is the number of the memorized patterns and $`q=np`$ is the number of the nondistorted coordinates of the standard-vector. Configuration vectors are denoted by small Greek letters. We use small Latin letters to denote vectors whose coordinates are real.

Note 1. In the neural network theory the connection matrix obtained with the help of Eq.(3) from $`(p\times n)`$-matrix $`𝐒`$ whose elements are equal $`\{\pm 1\}`$ is called the Hebb matrix. If in Eq.(3) $`(p\times n)`$-matrix $`𝐒`$ is of the general type, the corresponding connection matrix will be called the matrix of the Hebb type.

With regard to the set of the fixed points of the network an arbitrary symmetric connection matrix with zero diagonal elements is equivalent to a matrix of the Hebb type. Indeed, equality of the diagonal to zero guarantees the coincidence of the set of the local maxima of the functional (1) with the set of the network’s fixed points. But the local maxima do not depend on the diagonal elements of the connection matrix, so the lasts can be chosen whatever we like. In particular, all the diagonal elements can be taken so large that the connection matrix becomes a positive definite one. And such a matrix can be already presented in the form of the matrix product (3), where the elements of the related matrix $`𝐒`$ are not necessarily equal to $`\{\pm 1\}`$. In other words, with the help of the simple deformation of the diagonal a symmetric connection matrix turns into the Hebb type matrix and as a result, the set of the local maxima of the functional (1) does not change. This reasoning is correct for the Hebb matrix too, since it is a symmetric one and its diagonal elements are equal zero. In such a way we ascertain the actuality of the Hebb type connection matrices for the Hopfield model (for details see ).

$`\mathrm{𝟐}^{}.\text{ Basic model.}`$ Let us look for the local maxima among configuration vectors whose last coordinate is positive.

Since $`q`$ last columns of the matrix $`𝐒`$ are the same, the configuration vector which is ”under the suspicion” to provide an extremum is of the form

$$\stackrel{}{\sigma }^{}=(\underset{\stackrel{}{\sigma }^{}}{\underset{}{\sigma _1,\sigma _2,\mathrm{},\sigma _p}},\underset{q}{\underset{}{1,\mathrm{},1}}),$$
$`(5)`$   
where we denote by $`\stackrel{}{\sigma }^{}`$ the $`p`$-dimension part of the vector $`\stackrel{}{\sigma }^{}`$, which is formed by its first $`p`$ coordinates. The direct calculations (or see ) show that

$$F(\stackrel{}{\sigma }^{})x^22x(q+p\mathrm{cos}w)\mathrm{cos}w+(q+p\mathrm{cos}w)^2,$$
$`(6)`$   
where

$$\mathrm{cos}w=\frac{_{i=1}^p\sigma _i}{p}$$
$`(7)`$   
is the cosine of the angle between the vectors $`\stackrel{}{\sigma }^{}`$ and $`\stackrel{}{\epsilon }(p)`$. Depending on the number of the coordinates of the vector $`\stackrel{}{\sigma }^{}`$ whose value is ”–1”, $`\mathrm{cos}w`$ takes the values $`\mathrm{cos}w_k=12k/p`$, where $`k=0,1,\mathrm{},p`$. Consequently, $`2^p`$ ”suspicious-looking” vectors $`\stackrel{}{\sigma }^{}`$ are grouped into the $`p+1`$ classes  $`\mathrm{\Sigma }_k`$: the functional $`F(\stackrel{}{\sigma }^{})`$ has the same value $`F_k(x)`$ for all the vectors from the same class. The classes $`\mathrm{\Sigma }_k`$ are numerated by the number $`k`$ of the negative coordinates which have the relevant vectors $`\stackrel{}{\sigma }^{}`$, and the number of the vectors in the $`k`$-class is equal to $`C_p^k`$.

To find the ground state under a given value of $`x`$, it is necessary to determine the greatest of the values $`F_0(x),F_1(x),\mathrm{},F_p(x)`$. Under the comparison the term $`x^2`$ can be omitted. Therefore, to find out how the ground state depends on the parameter $`x`$, it is necessary to examine the family of the straight lines

$$L_k(x)=(q+p\mathrm{cos}w_k)^22x(q+p\mathrm{cos}w_k)\mathrm{cos}w_k:$$
$`(8)`$   
in the region where the $`L_k(x)`$ majorizes all the other straight lines, the ground state belongs to the class $`\mathrm{\Sigma }_k`$ and is $`C_p^k`$ times degenerated. The analysis of the relative position of the straight lines $`L_k(x)`$ gives:

Theorem. As $`x`$ varies from $`\mathrm{}`$ to $`\mathrm{}`$ the ground state in consecutive order belongs to the classes $`\mathrm{\Sigma }_0,\mathrm{\Sigma }_1,\mathrm{},\mathrm{\Sigma }_{k_{max}}`$. The jump of the ground state from the class $`\mathrm{\Sigma }_{k1}`$ into the class $`\mathrm{\Sigma }_k`$ occurs at the point $`x_k`$ of intersection of the straight lines $`L_{k1}(x)`$ and $`L_k(x)`$:

$$x_k=p\frac{n(2k1)}{n+p2(2k1)},k=1,2,\mathrm{},k_{max}.$$

If $`\frac{p1}{n1}<\frac{1}{3}`$, one after another all the $`p`$ rebuildings of the ground state take place according the above scheme: $`k_{max}=p`$. And if $`\frac{p1}{n1}>\frac{1}{3}`$, the last rebuilding is the one whose number is $`k_{max}=\left[\frac{n+p+2}{4}\right]`$. The functional has no other local maxima.

This theorem allows to solve a lot of practical problems.

In Fig.1 the typical examples of the relative position of the straight lines $`L_k(x)`$ are presented for the cases $`\frac{p1}{n1}<\frac{1}{3}`$ (a) and $`\frac{p1}{n1}>\frac{1}{3}`$ (b). When $`x`$ changes from $`\mathrm{}`$ to $`x_1`$, the ground state is the standard-vector $`\stackrel{}{\epsilon }(n)`$ (it exhausts the class $`\mathrm{\Sigma }_0`$). In the point $`x_1`$ the ground state jumps from the class $`\mathrm{\Sigma }_0`$ to the class $`\mathrm{\Sigma }_1`$ and becomes $`p`$ times degenerated. When $`x`$ achieves the value $`x_2`$, the ground state jumps from the class $`\mathrm{\Sigma }_1`$ to the class $`\mathrm{\Sigma }_2`$ and becomes $`C_p^2`$ times degenerated, and so on. As $`x`$ increases, the value of the functional for the ground state at first monotonically decreases and then, after reaching the minimum value, increases monotonically. For what follows let us note that $`k_{max}[\frac{p+1}{2}]`$, and $`x_{k_{max}}p`$.

The case $`p=n`$ worth to be specially mentioned. Here all the jump points $`x_k`$ stick to one point

$$x^{}x_k=\frac{n}{2},k=1,2,3,\mathrm{},\left[\frac{n+1}{2}\right].$$
$`(9)`$   
For any $`x`$ from the left of $`x^{}`$ the ground state is the standard-vector $`\stackrel{}{\epsilon }(n)`$, and for $`x`$ from the right of $`x^{}`$ the ground state belongs to the class $`\mathrm{\Sigma }_{[\frac{n+1}{2}]}`$ and is $`C_n^{[\frac{n+1}{2}]}`$ times degenerated.

The interval $`x_1<x<x_{k_{max}}`$ will be called the rebuilding region of the ground state. This region is examined in details in . Here we would like to mention only that its left boundary $`x_1\frac{p}{2}`$ is the monotonically increasing function of $`p`$ as well as of $`n`$. And also, when $`p=const`$ and $`n\mathrm{}`$ the rebuilding region tightens to the point

$$x^{\prime \prime }=p.$$
$`(10)`$   
Here for $`x<x^{\prime \prime }`$ the ground state is the standard-vector and for $`x>x^{\prime \prime }`$ the ground state belongs to the class $`\mathrm{\Sigma }_p`$; again it is a nondegenerate one.

Note 2. The Theorem remains valid, if:

a). The memorized patterns (4) are normalized to unit to prevent their length being dependent on the varying parameter $`x`$. As a result the maximum value of the functional (1) for the ground state decreases monotonically as function of $`x`$.

b). An arbitrary configuration vector $`\stackrel{}{\alpha }=(\alpha _1,\alpha _2,\mathrm{},\alpha _p,\alpha _{p+1},\mathrm{},\alpha _n)`$ is used in place of the standard-vector $`\stackrel{}{\epsilon }(n)`$. Then all the results are formulated with respect to configuration vectors $`\stackrel{}{\sigma }^{}=(\alpha _1\sigma _1,\alpha _2\sigma _2,\mathrm{},\alpha _p\sigma _p,\alpha _{p+1},\mathrm{},\alpha _n)`$, and the elements of the connection matrix are chanched:

$$N_{ij}^{(\alpha )}=N_{ij}\alpha _i\alpha _j,i,j=1,2,\mathrm{},n.$$
$`(11)`$   
c). The first $`p`$ coordinates of the space $`\mathrm{R}^\mathrm{n}`$ are subjected to a rotation. If in this connection the standard-vector does not change, all the results of the ”Basic model” are valid, though in this case the memorized patterns are obtained from $`\stackrel{}{\epsilon }(n)`$ by simultaneous distortion of its $`p`$ coordinates! But if as a result of the rotation the standard-vector turns into

$$(u_1,u_2,\mathrm{},u_p,1,\mathrm{},1),u_l\mathrm{R}^1,\underset{l=1}{\overset{p}{}}u_l^2=p,$$

the elements of the relevant connection matrix take the form

$$N_{ij}^{(U)}=N_{ij}u_iu_j,i,j=1,2,\mathrm{},n.$$
$`(12)`$   
Then, as in the ”Basic model”, the vectors $`\stackrel{}{\sigma }^{}`$, which are ”under the suspicion” to provide an extremum, are grouped in the classes where the value of the functional is constant. But now the vectors $`\stackrel{}{\sigma }^{}`$ belong to the same class if their p-dimensional parts are equidistant from the vector $`\stackrel{}{u}=(u_1,u_2,\mathrm{},u_p)`$. And just as before when $`x`$ increases, the ground state in consecutive order jumps from a class to the next one. Here the Theorem remains valid, however a correction of the formulae is necessary. We would like to note, that since the choice of the values $`\{u_l\}_{l=1}^p`$ is completely in the researcher’s hand, it is possible to construct the Hopfield type networks with preassigned sets of fixed points. An additional analysis is required to find out the limits of this method.

We would like to mention that we succeeded in the generalization of the ”Basic model” to the case when the linear term $`h_{i=1}^n\sigma _i`$ was added to the functional $`F(\stackrel{}{\sigma })`$ which had to be maximized. In physics models due to such a term the external magnetic field can be taken into account. Now we prepare these results for publication. $`\mathrm{𝟑}^{}.\text{ Interpretations.}`$ Let us in short discuss the results which are relative to the ”Basic model”.

Neural networks. In this case the Theorem has to be interpreted in the framework of the meaningful setting of the problem, which has been done above (see $`1^{}`$): the quality of ”the truth” (the standard-vector) reconstruction by the network depends on the distortion value $`x`$ during the learning stage and on the length $`p`$ of the learning sequence.

In agree with the common sense the error of the network increases with the increase of the distortion $`x`$.

Also it is quite reasonable that the left boundary of the rebuilding region $`x_1`$ is the increasing function of $`p`$ and $`n`$. Indeed, when $`n`$ and $`x`$ are fixed, merely due to increase of the number of the memorized patterns $`p`$ the value of $`x_1`$ can be forced to exceed $`x`$ (of course, if $`x`$ is not too large). As a result $`x`$ turns out to be left of $`x_1`$, i.e. in the region where the only fixed point is the standard-vector. This conclusion is in agreement with the practical experience according which the greater the length of the learning sequence, the better the signal can be read through noise. In the same way the increasing of $`x_1`$ with the increasing of the number $`n`$ can be interpreted.

When $`p=const`$ and $`n\mathrm{}`$ all the jump points $`x_k`$ stick to one point $`x^{\prime \prime }=p`$. In this case for $`x<x^{\prime \prime }`$ the ground state is the vector which belongs to the class $`\mathrm{\Sigma }_0`$:

$$\stackrel{}{\epsilon }^{(+)}(n)=(\underset{p}{\underset{}{1,1,\mathrm{},1}},1,\mathrm{},1),$$
$`(13)`$   
and for $`x>x^{\prime \prime }`$ the ground state is the vector which belongs to the class $`\mathrm{\Sigma }_p`$:

$$\stackrel{}{\epsilon }^{()}(n)=(\underset{p}{\underset{}{1,1,\mathrm{},1}},1,\mathrm{},1)$$
$`(14)`$   
(see Eq.(10)). As we see it, this result is a nontrivial one. In terms of the learning process, the distinct parts of the vectors $`\stackrel{}{\epsilon }^{(+)}(n)`$ and $`\stackrel{}{\epsilon }^{()}(n)`$ are two opposed statements. And the network ”feels” this. When the distortions $`x`$ is not very large (less than $`x^{\prime \prime }`$) the memorized patterns $`\stackrel{}{s}^{(l)}`$ (4) are interpreted by the network as the distorted copies of the vector $`\stackrel{}{\epsilon }^{(+)}(n)`$ (13). But if during the learning stage the distortions exceed $`x^{\prime \prime }`$, the network interprets the memorized patterns $`\stackrel{}{s}^{(l)}`$ as the distorted copies of other standard-vector $`\stackrel{}{\epsilon }^{()}(n)`$ (14). The last result is in agreement with the practical experience too: we interpret deviations in the image of a standard as permissible ones only till some threshold. If only this threshold is exceeded, the distorted patterns are interpreted as quite different standard. (For details see . In the same reference the very interesting dependence of $`k_{max}`$ on the relation between $`p`$ and $`n`$ is discussed.)

The Ising model at T=0. The interpretation of this model in terms of the matrix $`𝐒`$ is not known yet. Therefore here the obtained results are interpreted starting from the form of the Hamiltonian $`𝐍`$ (3). Let’s write it in the block-matrix form:

$$𝐍\left(\begin{array}{cc}𝐀& 𝐁\\ 𝐁^𝐓& 𝐂\end{array}\right),$$

where the diagonal elements of the $`(p\times p)`$-matrix $`𝐀`$ and the $`(q\times q)`$-matrix $`𝐂`$ are equal zero, and

$$\{\begin{array}{cc}a_{ij}=12y,\hfill & i,j=1,2,\mathrm{},p,ij;\hfill \\ b_{ik}=1y,\hfill & i=1,2,\mathrm{},p,k=1,2,\mathrm{},q;\hfill \\ c_{kl}=1,\hfill & k,l=1,2,\mathrm{},q,kl;\hfill \\ y=\frac{x}{p}.\hfill & \end{array}$$

This matrix corresponds to a spin system with the infinitely large interaction radius. The system consists of two subsystems, which are homogeneous with regard to the spin interaction. The interaction between the $`p`$ spins of the first subsystem is equal to $`12y`$; the interaction between the $`q`$ spins of the second subsystem is equal to $`1`$; the crossinteraction between the spins of each subsystems is equal to $`1y`$. When $`p=n`$ all the spins are interacting with each other in the same way. (We would like to remind that the connection matrix can be generalized – see Eqs. (11), (12).)

While $`y<\frac{1}{2}`$ all the spins are interacting in the ferromagnetic way; when $`\frac{1}{2}<y<1`$, the interaction between the spins of the first subsystem becomes of antiferromagnetic type, and when $`1<y`$ the crossinteraction is of antiferromagnetic type too. The Theorem allows to trace how the ground state depends on the variation of the parameter $`y`$.

Let $`p<n`$. For $`y(\mathrm{},\frac{1}{2})`$ the ground state is the ferromagnetic one since $`\frac{1}{2}<y_1=\frac{x_1}{p}`$, and for $`x<x_1`$ the ground state is the standard-vector $`\stackrel{}{\epsilon }^{(+)}(n)`$ (13). But it is interesting that the ground state remains the ferromagnetic one even if $`\frac{1}{2}<y<y_1`$, i.e. when the antiferromagnetic interactions already shown up in the system. In other words, when $`p<n`$ there is ”a gap” between the value of the external parameter $`y`$ which corresponds to the destruction of the ferromagnetic interaction and the value of this parameter which corresponds to the destruction of the ferromagnetic ground state. Only after a ”sufficient amount” of the antiferromagnetic interactions is accumulated, the first jump of the ground state occurs and it ceases to be the ferromagnetic one. Then after another critical ”portion” of the antiferromagnetic interaction is accumulated the next jump of the ground state occurs (it happens when $`y`$ exceeds $`y_2=\frac{x_2}{p}`$), and so on. After the parameter $`y`$ reaches the value $`y^{\prime \prime }=1=\frac{x^{\prime \prime }}{p}`$, the crossinteraction becomes the antiferromagnetic one too. The ground state continues ”to jump” after that, since $`x_{k_{max}}p`$.

The energy $`E=F`$ of the ground state as a function of the parameter $`y`$ has breaks at the points $`y_k=\frac{x_k}{p}`$. It increases till $`yy^{\prime \prime }=1`$ and decreases when $`y>y^{\prime \prime }`$. However, if the memorized patterns are normalized to unit, the energy of the ground state is a monotonically increasing function of the external parameter.

It is natural to treat the case $`p=const,\text{ }n\mathrm{}`$ as the case of an infinitely large sample with a few number of impurities. In this case all $`y_k`$ stick to the point $`y^{\prime \prime }`$ (see Eq.(10)). Depending only on the type of the crossinteraction between the impurities and the rest of the sample, the ground state is either the ferromagnetic one (the vector $`\stackrel{}{\epsilon }^{(+)}(n)`$ (13)), or the spins of the impurities are directed in an opposite way with respect to the other spins of the sample (and the ground state is the vector $`\stackrel{}{\epsilon }^{()}(n)`$ (14)).

Finally, let’s discuss the case $`p=n`$. Then all $`y_k`$ stick to the point $`y^{}=\frac{1}{2}`$ (see Eq.(9)). Here the destruction of the ferromagnetic interaction occurs simultaneously with the change of the ground state ( ”the gap” disappears). As long as the interaction of the spins is ferromagnetic ($`y<\frac{1}{2}`$), the ground state is ferromagnetic too. But when the interaction of the spins becomes antiferromagnetic ($`y>\frac{1}{2}`$), the ground state turns out to be $`C_n^{[\frac{n+1}{2}]}`$ times degenerated. From the right of $`\frac{1}{2}`$ it is natural to associate the state of the system with the spin glass phase. Acknowledgments. The author is grateful to prof. A.A.Ezhov for helpful advices on the substance of the work.