Hopfield Networks
One of the earliest conceptualization of biological neural networks with feedback architecture.
- Feedforward networks have connections that make up for acyclic graphs
- Feedback networks are networks that are not feedforward
Hopfield networks are:
- Fully connected feedback networks
- Symmetric weights, no self-connections
- Associative (Hebbian) learning
No separation of hidden vs visible
- Neurons (nodes) update themselves
- Based on all other neurons
Hebbian Learning
Inspired by biological neurons. Key idea: Positively correlated neurons reinforce each other's weights
Associative memories <-> No supervision <-> Pattern completion
Hopfield network
Binary Hopfield defines neuron states given neuron activation $a$
Continuous Hopfield defines neuron states given neuron activation $a$
Note the feedback connection!
- Neuron $x_{1}$ influences $x_{3}$, but $x_{3}$ influences $x_{1}$ back
Who influences whom first? - Synchronous updates: $a_{i}=\sum_{j} w_{i j} x_{j}$ Or
- Asynchronous updates: one neuron at a time (fixed or random order)
Hopfield memory
Network updates $x_{i} \in\{-1,1\}$ till convergence to a stable state
- Recurrent inference cyctes
- Not 'single propagation' like feedforward networks
Stable means $x_{i}$ does not flip states anymore.
Energy function
Hopfield networks minimize the quadratic energy function
Hopfield networks are Lyapunov functions meaning:
- Decreases under the dynamical evolution of the system
- Bounded below
Lyapunov functions converge to fixed points. Hopfield energy is a Lyapunov functions:
- Provided asynchronous updates
- Provided symmetric weights
Learning algorithm
Continuous-time continuous Hopfield network
We can replace the state variables with continuous-time variables
At time $t$ we compute instantaneous activations
The neuron response is governed by a differential equation
For steady $a_{i}$ the neuron response goes to stable state.
Hopfield networks for optimization problems
- Optimize function under constraints
- The stable states will be the optimal solution
- In that case the weights must ensure valid and optimal solutions
Hopfield networks is all you need
Ramsauer et al., 2020 https://arxiv.org/abs/2008.02217
- Retrieving from stored memory "patterns" by providing a partial pattern
- Retrieval update rule is equivalent to the Self-Attention Mechanism > Scaled Dot Product Attention mechanism in Transformers
References
- Lecture 8.3, UvA DL course 2020