Skip to content

Minimal library to construct Hierarchical Associative Memories (i.e., Super-powered Hopfield Networks). Research code designed to be easy to use.

License

Notifications You must be signed in to change notification settings

dtadpole/barebones-hamux

 
 

Repository files navigation

Barebones-HAMUX

HAMUX built using equinox, minimal implementation. A temporary solution as HAMUX is being rebuilt. See the original HAMUX documentation for explanation.

Consists of 1 main file bbhamux.py (<200 lines of important code) and 1 demo notebook: demo.ipynb

All other files are scaffolding for e.g., docs, tests, pypi.

The documentation is designed to be a thorough but gentle introduction to everything you need to know about (energy-based) Associative Memories and Hopfield Networks.

bbhamux is pronounced as "barebones hamux" or "baby hamux".

Install with pip

pip install bbhamux

Install by copying bbhamux.py

All logic is in one file: bbhamux.py. Copy this file into your project, modify as needed. The best kind of research code.

You will need to manually install dependencies:

pip install equinox jax

Install correct version of jaxlib for your hardware (e.g., to run on GPUs).

Quickstart

Run demo.ipynb for an example training on MNIST. Works best with GPU

Testing

pip install pytest
pytest test.py

Writing docs

Development

pip install nbdev
# Edit documentation in `nbs/`
nbdev_preview

Deploying

nbdev_docs
# git commit & push `docs/` folder

Contributing

We use poetry to manage dependencies. Install all dependencies (including nbdev and pytest) with:

poetry install --with docs --with test

Citation

If this repository is useful for this work, please cite the following:

@inproceedings{
hoover2022universal,
title={A Universal Abstraction for Hierarchical Hopfield Networks},
author={Benjamin Hoover and Duen Horng Chau and Hendrik Strobelt and Dmitry Krotov},
booktitle={The Symbiosis of Deep Learning and Differential Equations II},
year={2022},
url={https://openreview.net/forum?id=SAv3nhzNWhw}
}

About

Minimal library to construct Hierarchical Associative Memories (i.e., Super-powered Hopfield Networks). Research code designed to be easy to use.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 92.0%
  • Python 7.9%
  • CSS 0.1%