GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MAGICS-LAB/UHop: [ICML 2024] Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
utils
utils
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
data.py
data.py
 
 
data_utils.py
data_utils.py
 
 
deep_ViH.py
deep_ViH.py
 
 
download_tinyimagenet.sh
download_tinyimagenet.sh
 
 
functions.py
functions.py
 
 
get_plots.py
get_plots.py
 
 
image_classification.py
image_classification.py
 
 
layers.py
layers.py
 
 
max_loss.sh
max_loss.sh
 
 
memory_capacity.sh
memory_capacity.sh
 
 
memory_contribution.py
memory_contribution.py
 
 
memory_retrieval.py
memory_retrieval.py
 
 
memory_retrieval_max_loss.py
memory_retrieval_max_loss.py
 
 
memory_retrieval_noise.py
memory_retrieval_noise.py
 
 
memory_retrieval_noise_max_loss.py
memory_retrieval_noise_max_loss.py
 
 
models.py
models.py
 
 
noise_max_loss.sh
noise_max_loss.sh
 
 
noise_robustness.sh
noise_robustness.sh
 
 
requirements.txt
requirements.txt
 
 
run_image.sh
run_image.sh
 
 
run_image_bilevel.py
run_image_bilevel.py
 
 

Repository files navigation

Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models

This is the Official Code for the paper: Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models.

Create Environment

conda create -n uhop python=3.8
conda activate uhop
pip3 install -r requirements.txt

Memory Retrieval Task

For U-Hop:

python3 memory_retrieval_max_loss.py --memory_size 100 --kernel_epoch 100 --activation "softmax" --data "cifar10" --mode "UMHN" --seed 42

For Modern Hopfield:

python3 memory_retrieval_max_loss.py --memory_size 100 --activation "softmax" --data "cifar10" --mode "MHN" --seed 42

For Sparse Modern Hopfield:

python3 memory_retrieval_max_loss.py --memory_size 100 --activation "sparsemax" --data "cifar10" --mode "MHN" --seed 42

Noise Robustness Task

For U-Hop:

python3 memory_retrieval_noise.py --noise_level 0.5 --kernel_epoch 100 --activation "softmax" --data "cifar10" --mode "UMHN" --seed 42

For Modern Hopfield:

python3 memory_retrieval_noise.py --noise_level 0.5 --activation "softmax" --data "cifar10" --mode "MHN" --seed 42

For Sparse Modern Hopfield:

python3 memory_retrieval_noise.py --noise_level 0.5 --activation "sparsemax" --data "cifar10" --mode "MHN" --seed 42

Image Classification on CIFAR10 and CIFAR100

python3 image_classification.py --data cifar10 --datasize 10000 --n_class 10

Image Classification on Tiny ImageNet

To run experiments on TinyImageNet, you can use the code download_tinyimagenet.sh to download the dataset. If you have downloaded the dataset already, please see data_utils.py to setup the corresponding directory.

python3 deep_ViH.py --data tiny_imagenet --datasize 60000 --n_class 200 --init_lr 0.0001 --batch_size 1024

Citation

If you find our paper useful, please consider citing our work

@inproceedings{wu2024uniform,
  title={Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models},
  author={Wu, Dennis and Hu, Jerry Yao-Chieh and Hsiao, Teng-Yun and Liu, Han},
  booktitle={Forty-first International Conference on Machine Learning (ICML)},
  year={2024},
  url={https://arxiv.org/abs/2404.03827}
}

About

[ICML 2024] Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models

arxiv.org/abs/2404.03827

Topics

associative-memorygeneralized-sparse-hopfieldhopfieldhopfield-modelhopfield-networkmemory-capacitymodern-hopfield-modelmodern-hopfield-networksnetwork-capacitysparse-hopfield

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

12 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.