Official repository of Class-Incremental Learning via Knowledge Amalgamation
To be updated
Execute line by line
conda create -n CFA python=3.8
conda activate CFA
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
conda install tqdm matplotlib
pip install avalanche-lib
Execute line by line
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
pip install tqdm
pip install matplotlib
pip install avalanche-lib
For a list of commands:
python cfa.py --help
For MNIST
python cfa.py --dataset mnist --memory_budget 1000 --memory_strategy fixed
python cfa.py --dataset mnist --memory_budget 1000 --memory_strategy grow
For CIFAR10
python cfa.py --dataset cifar10 --memory_budget 1000 --memory_strategy fixed
python cfa.py --dataset cifar10 --memory_budget 1000 --memory_strategy grow
For CIFAR100
python cfa.py --dataset cifar100 --memory_budget 1000 --memory_strategy fixed
python cfa.py --dataset cifar100 --memory_budget 1000 --memory_strategy grow
For Tiny ImageNet
python cfa.py --dataset tiny10 --memory_budget 1000 --memory_strategy fixed
python cfa.py --dataset tiny10 --memory_budget 1000 --memory_strategy grow
If you are not intersted in evaluating the BWT and FWT metrics, just the ACC, modify the line 721 from:
for n_task in range(2, n_tasks + 1, 1):
to
for n_task in range(n_tasks, n_tasks + 1, 1):
In order to calculate BWT and FWT, we need to run multiple CFA experiments, which can be time-consuming. By making this change, you force the algorithm to just run a full amalgamation of all teachers. This will give you the ACC metric, but BWT and FWT will not be valid.
CFA accuracy (the student model accuracy) is really dependent on the performance of the teacher models.