# Provably Optimal Memory Capacity for Modern Hopfield Models

----------

This code was tested on `Python 3.10.10`. To install, follow these steps:

1. In a virtual environment, first install Cython: `pip install cython`
2. Install the requirements: `pip install -r req2.txt`
3. Run the corresponding scripts

### Reproducibility
<!-- #### MNIST MIL
Run the script `MNIST_bags.py` with the desired parameters (nomenclature can be found in the beginning of the script)

#### Benchmarks MIL

Download and upzip the dataset

```bash
$ wget http://www.cs.columbia.edu/~andrews/mil/data/MIL-Data-2002-Musk-Corel-Trec9-MATLAB.tgz 
```

Run the script `MIL_Data_2002.py` with the desired parameters (nomenclature can be found in the beginning of the script) -->

#### Countours and Basins of Attraction
Run the scripts `countours.py` and `basins.py` 

#### Metastable State Counting
Run the script `MNIST_metastable.py`, `synthetic_metastable.py`
