Skip to main content

gmumcl

CI PyPI Python License: MIT

A small, generic continual-learning framework for PyTorch: five incremental scenarios, a five-call plugin API, an accuracy-matrix trainer, and reference implementations of the standard CL baselines.

Install

activationscope builds a C++ extension with -std=c++17, so install torch 2.8 first (newer torch headers require C++20), then build it against that torch:

pip install "torch==2.8.*" --index-url https://download.pytorch.org/whl/cpu   # or /cu128
pip install setuptools wheel ninja numpy
pip install activationscope --no-build-isolation
pip install gmumcl              # or: pip install "gmumcl[datasets]"

From source: git clone https://github.com/gmum/gmumcl && cd gmumcl && pip install -e ".[test]". Full notes (why the pin, why --no-build-isolation): docs/usage.md.

Quickstart

python scripts/run.py --config configs/base.yaml -O method.name=ewc -O method.lambda=10
from gmumcl import train

metrics = train.run({
    "data": {"name": "toy", "num_classes": 4, "classes_per_task": 2},
    "model": {"name": "mlp", "hidden": 16},
    "trainer": {"epochs": 1, "lr": 0.01, "device": "cpu"},
    "method": {"name": "ewc", "lambda": 1.0},
})
print(metrics["accuracy_matrix"])

Scenarios (data.scenario)

Key Tasks Evaluation
class_incremental disjoint class groups all classes seen so far
task_incremental disjoint class groups task oracle (logits masked to the task)
domain_incremental all classes, shifted inputs (rotations) all classes
instance_incremental random partitions of all instances all classes
permuted all classes, one fixed input permutation per task all classes

Dataset names: toy (CPU clusters), mnist, cifar10, cifar100, plus rotated_mnist (domain-incremental) and permuted_mnist.

Methods (method.name)

Name Reference Source
naive — plain fine-tuning
l2 Hsu et al. 2018 quadratic anchor
ewc Kirkpatrick et al. 2017 gmumcl / InTAct-Flex
ewc_dr EWC-DR scarlet0703/EWC-DR (adcaaeb9)
online_ewc Schwarz et al. 2018 gmumcl / InTAct-Flex
si Zenke et al. 2017 gmumcl
mas Aljundi et al. 2018 gmumcl
lwf Li & Hoiem 2017 gmumcl / GMvandeVen/continual-learning
kfac Kao et al. 2021 Xin-Jing/K-FAC (09f4565c)
ncl Kao et al. 2021 tachukao/ncl (92c2ba5e)
owm Zeng et al. 2019 GMvandeVen/continual-learning (e6d795aa)
gpm Saha et al. 2021 sahagobinda/GPM (1a238ec9)
intact Krukowski et al. 2025 pkrukowski1/InTAct (83b90c55)
sharpening gmumcl OneAndZero24/local-cl
dreaming gmumcl OneAndZero24/local-cl (needs model.head_type: rbf)

Docs

  • docs/framework.md — plugin lifecycle, trainer, metrics, adding a method
  • docs/scenarios.md — the five scenarios and their protocols
  • docs/methods.md — formulas, defaults and provenance per method
  • docs/usage.md — install, CLI, configs, custom components
  • docs/results.md — reproduced Split-MNIST table (from AdaReg) and deviations

License

MIT (GMUM). See LICENSE.

Metadata

Release files for gmumcl 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gmumcl 1.0.0
File Size Uploaded
gmumcl-1.0.0.tar.gz 60.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gmumcl 1.0.0
File Interpreter ABI Platform
gmumcl-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 104.3 kB

Release files / gmumcl-1.0.0.tar.gz

Download URL gmumcl-1.0.0.tar.gz
Size 60.2 kB
Tags Source
SHA-256 checksum
How to use checksums
08375266423f9ab4f6b3d3b6390fc9609d5c8ae93d885efc6bd11b6dc6094b53
BLAKE2b-256 checksum
How to use checksums
5cd3861c33ca2deccb9afcc0b054489d907ccab6752f875a63f131ac9feb2f7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gmumcl-1.0.0-py3-none-any.whl

Download URL gmumcl-1.0.0-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
048298831026ebe8925524eb98967781e67119b0e981b773b3a01cb642fe8533
BLAKE2b-256 checksum
How to use checksums
278627b8cc678120f9586242210aab9a967ed878f05fe233e7595f3d426afee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page