This repository contains the official source code for the research paper titled "Steering Prototypes with Prompt-tuning for Rehearsal-free Continual Learning". Please refer to the paper https://arxiv.org/abs/2303.09447 for detailed methods
To ensure reproducibility and smooth execution of the code, we recommend setting up a dedicated environment using conda
.
-
Create a new conda environment:
conda create --name your_env_name python=3.9
-
Activate the environment:
conda activate your_env_name
-
Install the required packages:
pip install -r requirements.txt
- For CIFAR-100 and 5datasets, they should download automatically when running the code.
- For ImageNet-R, download and unzip the original data from https://people.eecs.berkeley.edu/~hendrycks/imagenet-r.tar. Please also download the data split from https://drive.google.com/drive/folders/1D5ADrPs9OweevMNA-ZjuAGdbilYfA1io?usp=sharing.
- For ImageNet-Sub, download and unzip from https://drive.google.com/file/d/1n5Xg7Iye_wkzVKc0MTBao5adhYSUlMCL/view?usp=sharing
- Save all dowmloaded contents in the
data/
folder.
-
Navigate to the script directory:
cd script/
-
Run the bash scripts:
bash cifar100.sh # for CIFAR-100
bash imagenet.sh # for ImageNet-R
bash imagenet_sub.sh # for ImageNet-Sub
bash 5datasets.sh # for 5datasets
-
How to run other settings:
Please refer to the "main.py" for the detailed arguments.
If you find our research or this repository useful, please consider citing our work:
@misc{li2023steering,
title={Steering Prototypes with Prompt-tuning for Rehearsal-free Continual Learning},
author={Zhuowei Li and Long Zhao and Zizhao Zhang and Han Zhang and Di Liu and Ting Liu and Dimitris N. Metaxas},
year={2023},
eprint={2303.09447},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
We would like to extend our gratitude to dino, mae and SupContrast which we use partial of their code in our project.