Kostis-S-Z.github.io

Projects | Blog | About

View on GitHub
Analysis Scale: 2

Motivation for Hopfield Networks

The Hebbian rule, the rule that motivated the idea of how the brain neurons work, broadly stated that neurons that wire together, fire together, indicating a symmetry. However, the common feed-forward neural networks (MLP) have a directed flow of information, meaning the value of the neuron B is dependent on the value of neuron A, but not the other way around, which means that the connection between them is asymmetric. The Hopfield networks then are based exactly on the Hebbian’s rule principle by having symmetric weights. This feature seems to be exceptionally useful for the task of creating an associative memory, aka context-addressable memory.

Inside a Hopfield network

This type of memory works by learning a set of patterns and then when a similar pattern is introduced, it reproduces the pattern which resembles it the most. Not only is this useful for identifying already seen objects but also completing or correcting missing or corrupted patterns, also known as pattern completion and pattern denoising respectively.

How it works

Training (Hebbian Learning rule)

w_ij = 1 / N ∑ x_i * x_j

Recall (Finding an attractor)

We can either use the function sign which is like a step function (returns 1 if 0> and -1 otherwise) or we can use a bias node with a constant value (+1 or -1) and use it as usual in a simple MLP. Where N=#patterns to learn and s_i(n) the activation of neuron i for input pattern n. By using 1/N (which takes the place of the learning rate) the maximum size of the weights is independent of N.

Important notes!

Common problems

Sources:

  1. Lecture 8 “Hopfield networks and introduction to stochastic networks” Slides from Artificial Neural Networks and Deep Architectures DD2437 @ KTH Spring 2019

  2. Marsland, Stephen. Machine learning: an algorithmic perspective. Chapman and Hall/CRC, 2011.

  3. A step-by-step analytical example (beware the yellow!) http://web.cs.ucla.edu/~rosen/161/notes/hopfield.html