Hopfield recall from a corrupted cue (source code)

= Hopfield recall from a corrupted cue
{c}
{title2=$E(d)=-((M-2d)^2-M)/(2M)$}

Store only $\xi=(1,-1,1,-1,1)$ with $M=5$, zero thresholds, and <Hebbian memory weights for a Hopfield network>. If $d$ bits differ from $\xi$, their <Hamming distance> is $d$ and $\sum_i\xi_ix_i=M-2d$. Squaring this sum and subtracting the $M$ diagonal terms yields the displayed <energy>. Thus $d=0,1,2,3,4,5$ gives $E=-2,-2/5,2/5,2/5,-2/5,-2$.

For the cue $x=(-1,1,1,-1,1)$, the first unit has input $h_1=2/5$ and flips to $1$. The second then has $h_2=-4/5$ and flips to $-1$, completing recall. The <energy> drops $2/5\to-2/5\to-2$. Every cue with at most two wrong bits is corrected under a fair asynchronous schedule: a wrong bit sees the correct majority among the other four, while a correct bit either sees agreement or retains its value at a tie. The opposite pattern $-\xi$ is also stored implicitly, so cues with at least three errors retrieve it. This is a limitation of this symmetric one-pattern construction.

\Image[/hopfield-memory-error-landscape.png]
{title=An exact five-unit memory landscape and correction of two wrong bits}
{description=Each point represents every state at the indicated <Hamming distance>; multiplicities count the states. Arrows follow two actual updates of the illustrated cue under <asynchronous Hopfield energy descent>. This is an original finite calculation.}