Skip to content

Repository files navigation

Memory-Modular Classification: Learning to Generalize with Memory Replacement

Dahyun Kang     Ahmet Iscen     Eunchan Jo     Sua Choi     Minsu Cho     Cordelia Schmid



teaser

This repo is the official implementation of the TMLR 2025 paper Memory-Modular Classification: Learning to Generalize with Memory Replacement

Conda installation command

conda env create -f environment.yml --prefix $YOURPREFIX

$YOUPREFIX is typically /home/anaconda3

Training command

python main.py \
    --datapath $YOURDATASETPATH \
    --dataset {imagenetunseen/cub200} \
    --logpath $YOURLOGPATH

Eval command

python main.py \
    --datapath $YOURDATASETPATH \
    --dataset {imagenetunseen/cub200} \
    --logpath $YOURLOGPATH
    --eval

ImageNet100 data preparation

Download and extract ImageNet100 from here. Then download and extract the wiki text into the same directory, and the directory tree of data is expected to be like this:

{your root path}/imagenet100/
  train.X1
  train.X2
  train.X3
  train.X4
  val.X
  wiki/
  	desc_1.txt
  labels.txt

Flags

  • Raise --nowandb for no wandb logging
  • Raise --eval for evaluating the best checkpoint of the corresponding --logpath experiment
  • Raise --resume for resume from the last checkpoint of the corresponding --logpath experiment

About

[TMLR'25] Official PyTorch implementation of Memory-Modular Classification: Learning to Generalize with Memory Replacement

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages