Welcome to Mammoth’s documentation!#

logo

Mammoth - An Extendible (General) Continual Learning Framework for Pytorch#

Official repository of Class-Incremental Continual Learning into the eXtended DER-verse and Dark Experience for General Continual Learning: a Strong, Simple Baseline

Mammoth is a framework for continual learning research. It is designed to be modular, easy to extend, and - most importantly - easy to debug. Idelly, all the code necessary to run the experiments is included in the repository, without needing to check out other repositories or install additional packages.

With Mammoth, nothing is set in stone. You can easily add new models, datasets, training strategies, or functionalities.

NEW: Join our Discord Server for all your Mammoth-related questions → ![Discord Shield](https://discordapp.com/api/guilds/1164956257392799860/widget.png?style=shield)

Sequential MNIST Sequential CIFAR-10 Sequential TinyImagenet Permuted MNIST Rotated MNIST MNIST-360

Setup#

  • Use ./utils/main.py to run experiments.

  • Use argument --load_best_args to use the best hyperparameters from the paper.

  • New models can be added to the models/ folder.

  • New datasets can be added to the datasets/ folder.

Models#

  • Efficient Lifelong Learning with A-GEM: (A-GEM), and A-GEM with Reservoir buffer (A-GEM-R)

  • Bias Correction (BiC)

  • Continual Contrastive Interpolation Consistency (CCIC) - Requires pip install kornia

  • CODA-Prompt: COntinual Decomposed Attention-based Prompting for Rehearsal-Free Continual Learning (CODA-Prompt) - Requires pip install timm==0.9.8

  • Dark Experience Replay (DER)

  • Dark Experience Replay++ (DER++)

  • DualPrompt: Complementary Prompting for Rehearsal-free Continual Learning (DualPrompt) - Requires pip install timm==0.9.8

  • Experience Replay (ER)

  • online Elastic Weight Consolidation (oEWC)

  • Function Distance Regularization (FDR)

  • Greedy Sampler and Dumb Learner (GDumb)

  • Gradient Episodic Memory (GEM) - Unavailable on windows

  • Greedy gradient-based Sample Selection (GSS)

  • Hindsight Anchor Learning (HAL)

  • Incremental Classifier and Representation Learning (iCaRL)

  • Joint for General Continual` setting (JointGCL)

  • Learning to Prompt (L2P) - Requires pip install timm==0.9.8

  • LiDER (on DER++, iCaRL, GDumb, and ER-ACE)

  • Learning a Unified Classifier Incrementally via Rebalancing (LUCIR)

  • Learning without Forgetting (LwF)

  • Meta-Experience Replay (MER)

  • Progressive Neural Networks (PNN)

  • Regular Polytope Classifier (RPC)

  • Synaptic Intelligence (SI)

  • SLCA: Slow Learner with Classifier Alignment for Continual Learning on a Pre-trained Model (SLCA) - Requires pip install timm==0.9.8

  • Transfer without Forgetting (TwF)

  • eXtended-DER (X-DER)

Datasets#

NOTE: Datasets are automatically downloaded in the data/. - This can be changed by changing the base_path function in utils/conf.py. - The data/ folder is not tracked by git and is created automatically if missing.

  • Sequential MNIST (Class-Il / Task-IL)

  • Sequential CIFAR-10 (Class-Il / Task-IL)

  • Sequential Tiny ImageNet (Class-Il / Task-IL)

  • Sequential Tiny ImageNet resized 32x32 (Class-Il / Task-IL)

  • Sequential CIFAR-100 (Class-Il / Task-IL)

  • Sequential CIFAR-100 resized 224x224 (ViT version) (Class-Il / Task-IL)

  • Sequential CIFAR-100 resized 224x224 (ResNet50 version) (Class-Il / Task-IL)

  • Permuted MNIST (Domain-IL)

  • Rotated MNIST (Domain-IL)

  • MNIST-360 (General Continual Learning)

  • Sequential CUB-200 (Class-Il / Task-IL)

  • Sequential ImageNet-R (Class-Il / Task-IL)

Pretrained backbones#

Citing these works#

@article{boschini2022class,
    title={Class-Incremental Continual Learning into the eXtended DER-verse},
    author={Boschini, Matteo and Bonicelli, Lorenzo and Buzzega, Pietro and Porrello, Angelo and Calderara, Simone},
    journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
    year={2022},
    publisher={IEEE}
}

@inproceedings{buzzega2020dark,
   author = {Buzzega, Pietro and Boschini, Matteo and Porrello, Angelo and Abati, Davide and Calderara, Simone},
   booktitle = {Advances in Neural Information Processing Systems},
   editor = {H. Larochelle and M. Ranzato and R. Hadsell and M. F. Balcan and H. Lin},
   pages = {15920--15930},
   publisher = {Curran Associates, Inc.},
   title = {Dark Experience for General Continual Learning: a Strong, Simple Baseline},
   volume = {33},
   year = {2020}
}

Awesome Papers using Mammoth#

Our Papers#

Other Awesome CL works using Mammoth#

Update Roadmap#

In the near future, we plan to incorporate the following improvements into this master repository:

  • ER+Tricks (Rethinking Experience Replay: a Bag of Tricks for Continual Learning)

Pull requests welcome! Get in touch

Contributing#

Please use autopep8 with parameters:

  • –aggressive

  • –max-line-length=200

  • –ignore=E402

Previous versions#

If you’re interested in a version of this repo that only includes the original code for Dark Experience for General Continual Learning: a Strong, Simple Baseline or Class-Incremental Continual Learning into the eXtended DER-verse, please use the following tags: