8000 GitHub - RL-VIG/LibContinual: A Framework of Continual Learning
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RL-VIG/LibContinual

Repository files navigation

LibContinual: Make Continual Learning Easy

Introduction

LibContinual is an open-source continual learning toolbox based on PyTorch. The framework currently supports PyTorch 1.13+ (compatibility with earlier versions not fully guaranteed) and provides comprehensive implementations of state-of-the-art continual learning algorithms.

Supported Methods

Conventional methods

Foundation model based methods

Installation

Please refer to install.md
Complete tutorials can be found at ./docs

Datasets

After the dataset is downloaded, please extract the compressed file to the specified path.

unzip cifar100.zip -d /path/to/your/dataset

Set the data_root in .yaml

data_root: /path/to/your/dataset

To add a custom dataset, please refer to dataset.md.

Getting Started

Once you have completed the "Installation" and "Datasets" sections, you can now proceed to demonstrate how to use the "LibContinual" framework with the LUCIR method.

  • Step1: Configure the parameters in the ./config/lucir.yaml file. Please refer to config.md for the meanings of each parameter.
  • Step2: Run code python run_trainer.py --config lucir.yaml
  • Step3: After the training is completed, the log files will be saved in the path specified by the save_path parameter.

Benchmarks

We adopt standardized evaluation metrics from continual learning literature. Given T tasks where $R_{t,i}$ represents the accuracy of model after training on task $t$ when tested on task $i$:

Evaluation Metrics

1. Last Average Accuracy

$$ Acc_T=R_{T, {0\sim T}} \quad (1) $$

2. Backward Transfer (BWT)

$$ BWT_T = \frac{\sum_{i=3}^T\sum_{j=1}^{i-2}R_{i,j}-R{j,j}}{T(T-1)/2} \quad (2) $$

3. Forgetting

$$ Frgt_T = \frac{\sum_{j=1}^{T-2}R_{T-1,j}-R_{j,j}}{T-1} \quad (3) $$

Equivalent to Positive BwT in "new metrics for Continual Learning"

4. Overall Average Accuracy

$$ \overline{Acc_T}=\frac{1}{T}\sum_{t=1}^T(\frac{1}{t}\sum_{i=1}^t R_{t,i}) \quad (4) $$

Acknowledgement

LibContinual is an open source project designed to help continual learning researchers quickly understand the classic methods and code structures. We welcome other contributors to use this framework to implement their own or other impressive methods and add them to LibContinual. This library can only be used for academic research. We welcome any feedback during using LibContinual and will try our best to continually improve the library. Special thanks to the authors of FACIL and PyCIL for their inspiration on framework design.

We have referenced useful modules from these repositories in our work. We deeply appreciate the authors of these repositories.

License

This project is licensed under the MIT License. See LICENSE for more details.

About

A Framework of Continual Learning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 11

Languages

0