Giter Club home page Giter Club logo

libcontinual's Introduction

LibContinual

Make continual learning easy.

Introduction

LibContinual is an open source continual learning toolbox based on PyTorch. The master branch works with PyTorch 1.13. The compatibility to earlier versions of PyTorch is not fully tested.

flowchart

Supported Methods

Conventional methods

Foundation model based methods

Quick Installation

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

Datasets

CIFAR-100 are available at Google Drive

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 "Quick Installation" and "Datasets" sections, we can now proceed to demonstrate how to use the "LibContinual" framework with the LUCIR method.

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

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.

This project has been developed with references to the following repositories:

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.

libcontinual's People

Contributors

fanzhichen avatar kaxuan1135 avatar myscius avatar wenbinlee avatar woodszp avatar yizhibaiwuya avatar yychen016 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

libcontinual's Issues

There is a minor error regarding ResNet.

In the file model/backbone/resnet.py, there are only ResNet18 and ResNet34, but in model/der.py, ResNet50 is referenced. When I change the configuration to lucir.yaml in run_trainer.py and run it, an error occurs.

Similarities Between LibContinual and PyCIL

Hi there,

I'm new to the field of continual learning and have been exploring various toolkits to deepen my understanding. Recently, I came across your LibContinual repository and noticed many similarities with another toolkit I'm familiar with, PyCIL (https://github.com/G-U-N/PyCIL).

While going through both repositories, I couldn't help but notice that significant portions of the code in LibContinual appear to be very similar, if not identical, to those in PyCIL. Below are some examples with screenshots for reference:

(Left: PyCIL, Right: LibContinual)

image

https://github.com/G-U-N/PyCIL/blob/a9b1ec8e3dbbe143cb72b008d7c8f946629d55b1/utils/inc_net.py#L138

def weight_align(self, increment):

(Left: PyCIL, Right: LibContinual)

image

https://github.com/G-U-N/PyCIL/blob/a9b1ec8e3dbbe143cb72b008d7c8f946629d55b1/models/ewc.py#L210

def compute_ewc(self):

(It seems the indentation is directly copied from PyCIL LOL)

(Left: PyCIL, Right: LibContinual)

image

It seems like renaming the functions into a similar one...

These similarities raise some important questions:

Is it necessary to reinvent the wheel by creating a new repository that largely replicates the functionality and code of PyCIL?
Shouldn't there be proper acknowledgment and attribution to PyCIL, considering the significant overlap in code? This includes but is not limited to:

  1. Including PyCIL's original MIT License.
  2. Including commit history from PyCIL.
  3. Featuring the original authors of PyCIL in the License and Contributor sections.
  4. Respect for the original authors and adherence to open-source principles are vital for the community. Proper attribution not only honors the work done by the PyCIL authors but also fosters a collaborative and respectful open-source environment.

Looking forward to your thoughts on this matter.

One possible mistake in file core/data/data.py

I noticed that u apply the code below to define a transformer on dataset Cifar-100, using STD = [0.2009, 0.1984, 0.2023].
However, as far as I know, the standard deviation for Cifar-100 is [0.2675, 0.2565, 0.2761].
Is it a mistake or on purpose? Please let me know. Thx, and nice work!!

MEAN = [0.5071,  0.4866,  0.4409]
STD = [0.2009,  0.1984,  0.2023]

common_trfs = [transforms.ToTensor(),
             transforms.Normalize(mean=MEAN, std=STD)]

resnet_train_transform = transforms.Compose([
  transforms.RandomCrop(32, padding=4),
  transforms.RandomHorizontalFlip(),
  transforms.ColorJitter(brightness=63 / 255),
  *common_trfs
])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.