This repository contains simple implementations of the family of Hopfield Networks discussed in the paper "Hopfield Networks is All You Need" and its associated blog post.
pip install -r requirements.txt
Memory for binary retrieval (see Hopfield, 1982)
python classic_hopfield.py
with output:
Improved memory for binary retrieval (see Demircigil et al., 2017)
python modern_hopfield.py
with output:
The new network proposed in the paper, equivalent to the attention mechanism used in Transformers (up to linear transformations of its inputs)
python continuous_hopfield.py
with output: