gmumcl 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. gmumcl-1.0.0/LICENSE +21 -0
  2. gmumcl-1.0.0/MANIFEST.in +7 -0
  3. gmumcl-1.0.0/PKG-INFO +141 -0
  4. gmumcl-1.0.0/README.md +88 -0
  5. gmumcl-1.0.0/configs/base.yaml +32 -0
  6. gmumcl-1.0.0/configs/baselines/dreaming.yaml +35 -0
  7. gmumcl-1.0.0/configs/baselines/ewc.yaml +30 -0
  8. gmumcl-1.0.0/configs/baselines/ewc_dr.yaml +32 -0
  9. gmumcl-1.0.0/configs/baselines/gpm.yaml +33 -0
  10. gmumcl-1.0.0/configs/baselines/intact.yaml +32 -0
  11. gmumcl-1.0.0/configs/baselines/kfac.yaml +31 -0
  12. gmumcl-1.0.0/configs/baselines/l2.yaml +29 -0
  13. gmumcl-1.0.0/configs/baselines/lwf.yaml +30 -0
  14. gmumcl-1.0.0/configs/baselines/mas.yaml +29 -0
  15. gmumcl-1.0.0/configs/baselines/naive.yaml +28 -0
  16. gmumcl-1.0.0/configs/baselines/ncl.yaml +36 -0
  17. gmumcl-1.0.0/configs/baselines/online_ewc.yaml +30 -0
  18. gmumcl-1.0.0/configs/baselines/owm.yaml +35 -0
  19. gmumcl-1.0.0/configs/baselines/sharpening.yaml +32 -0
  20. gmumcl-1.0.0/configs/baselines/si.yaml +30 -0
  21. gmumcl-1.0.0/configs/exp/P1.yaml +30 -0
  22. gmumcl-1.0.0/configs/exp/instance_incremental.yaml +29 -0
  23. gmumcl-1.0.0/configs/exp/permuted_mnist.yaml +29 -0
  24. gmumcl-1.0.0/configs/exp/rotated_mnist_di.yaml +28 -0
  25. gmumcl-1.0.0/configs/exp/split_mnist_ci.yaml +28 -0
  26. gmumcl-1.0.0/configs/exp/split_mnist_ti.yaml +29 -0
  27. gmumcl-1.0.0/configs/exp/toy_task_incremental.yaml +28 -0
  28. gmumcl-1.0.0/docs/framework.md +76 -0
  29. gmumcl-1.0.0/docs/methods.md +90 -0
  30. gmumcl-1.0.0/docs/results.md +110 -0
  31. gmumcl-1.0.0/docs/scenarios.md +80 -0
  32. gmumcl-1.0.0/docs/usage.md +87 -0
  33. gmumcl-1.0.0/examples/README.md +10 -0
  34. gmumcl-1.0.0/examples/custom_method.py +71 -0
  35. gmumcl-1.0.0/examples/quickstart.py +41 -0
  36. gmumcl-1.0.0/pyproject.toml +51 -0
  37. gmumcl-1.0.0/scripts/reproduce_baselines.py +145 -0
  38. gmumcl-1.0.0/scripts/run.py +30 -0
  39. gmumcl-1.0.0/setup.cfg +4 -0
  40. gmumcl-1.0.0/src/gmumcl/__init__.py +8 -0
  41. gmumcl-1.0.0/src/gmumcl/cl/__init__.py +4 -0
  42. gmumcl-1.0.0/src/gmumcl/cl/baselines/__init__.py +44 -0
  43. gmumcl-1.0.0/src/gmumcl/cl/baselines/common.py +266 -0
  44. gmumcl-1.0.0/src/gmumcl/cl/baselines/dreaming.py +143 -0
  45. gmumcl-1.0.0/src/gmumcl/cl/baselines/intact.py +252 -0
  46. gmumcl-1.0.0/src/gmumcl/cl/baselines/kfac.py +120 -0
  47. gmumcl-1.0.0/src/gmumcl/cl/baselines/ncl.py +198 -0
  48. gmumcl-1.0.0/src/gmumcl/cl/baselines/penalties.py +247 -0
  49. gmumcl-1.0.0/src/gmumcl/cl/baselines/projection.py +177 -0
  50. gmumcl-1.0.0/src/gmumcl/cl/baselines/sharpening.py +82 -0
  51. gmumcl-1.0.0/src/gmumcl/cl/collect.py +47 -0
  52. gmumcl-1.0.0/src/gmumcl/cl/composer.py +35 -0
  53. gmumcl-1.0.0/src/gmumcl/cl/growth.py +38 -0
  54. gmumcl-1.0.0/src/gmumcl/cl/metrics.py +101 -0
  55. gmumcl-1.0.0/src/gmumcl/cl/models.py +147 -0
  56. gmumcl-1.0.0/src/gmumcl/cl/plugin.py +45 -0
  57. gmumcl-1.0.0/src/gmumcl/cl/rbf.py +54 -0
  58. gmumcl-1.0.0/src/gmumcl/cl/scenarios.py +507 -0
  59. gmumcl-1.0.0/src/gmumcl/cl/trainer.py +121 -0
  60. gmumcl-1.0.0/src/gmumcl/registry.py +186 -0
  61. gmumcl-1.0.0/src/gmumcl/train.py +54 -0
  62. gmumcl-1.0.0/src/gmumcl/util/__init__.py +1 -0
  63. gmumcl-1.0.0/src/gmumcl/util/config.py +59 -0
  64. gmumcl-1.0.0/src/gmumcl.egg-info/PKG-INFO +141 -0
  65. gmumcl-1.0.0/src/gmumcl.egg-info/SOURCES.txt +79 -0
  66. gmumcl-1.0.0/src/gmumcl.egg-info/dependency_links.txt +1 -0
  67. gmumcl-1.0.0/src/gmumcl.egg-info/requires.txt +15 -0
  68. gmumcl-1.0.0/src/gmumcl.egg-info/top_level.txt +1 -0
  69. gmumcl-1.0.0/tests/component/test_baselines.py +88 -0
  70. gmumcl-1.0.0/tests/component/test_framework.py +36 -0
  71. gmumcl-1.0.0/tests/helpers.py +53 -0
  72. gmumcl-1.0.0/tests/smoke/test_quickstart.py +50 -0
  73. gmumcl-1.0.0/tests/unit/test_baseline_configs.py +119 -0
  74. gmumcl-1.0.0/tests/unit/test_common.py +74 -0
  75. gmumcl-1.0.0/tests/unit/test_config.py +21 -0
  76. gmumcl-1.0.0/tests/unit/test_growth.py +77 -0
  77. gmumcl-1.0.0/tests/unit/test_metrics.py +49 -0
  78. gmumcl-1.0.0/tests/unit/test_rbf.py +63 -0
  79. gmumcl-1.0.0/tests/unit/test_registry.py +80 -0
  80. gmumcl-1.0.0/tests/unit/test_scenarios.py +101 -0
  81. gmumcl-1.0.0/tests/unit/test_trainer.py +47 -0
gmumcl-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 GMUM
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ include LICENSE README.md pyproject.toml
2
+ graft configs
3
+ graft docs
4
+ graft examples
5
+ graft scripts
6
+ graft tests
7
+ global-exclude __pycache__ *.pyc .DS_Store
gmumcl-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: gmumcl
3
+ Version: 1.0.0
4
+ Summary: A generic continual-learning framework: scenarios, methods, metrics
5
+ License: MIT License
6
+
7
+ Copyright (c) 2024-2026 GMUM
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Project-URL: Repository, https://github.com/gmum/gmumcl
28
+ Keywords: continual-learning,pytorch,class-incremental,benchmark
29
+ Classifier: Development Status :: 5 - Production/Stable
30
+ Classifier: Intended Audience :: Science/Research
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.10
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
37
+ Requires-Python: >=3.10
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE
40
+ Requires-Dist: torch<2.9,>=2.0
41
+ Requires-Dist: numpy
42
+ Requires-Dist: PyYAML
43
+ Requires-Dist: activationscope>=0.1.4
44
+ Provides-Extra: datasets
45
+ Requires-Dist: torchvision; extra == "datasets"
46
+ Provides-Extra: viz
47
+ Requires-Dist: matplotlib; extra == "viz"
48
+ Provides-Extra: test
49
+ Requires-Dist: pytest>=7; extra == "test"
50
+ Requires-Dist: torchvision; extra == "test"
51
+ Requires-Dist: ruff; extra == "test"
52
+ Dynamic: license-file
53
+
54
+ # gmumcl
55
+
56
+ [![CI](https://github.com/gmum/gmumcl/actions/workflows/ci.yml/badge.svg)](https://github.com/gmum/gmumcl/actions/workflows/ci.yml)
57
+ [![PyPI](https://img.shields.io/pypi/v/gmumcl)](https://pypi.org/project/gmumcl/)
58
+ [![Python](https://img.shields.io/pypi/pyversions/gmumcl)](https://pypi.org/project/gmumcl/)
59
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
60
+
61
+ A small, generic continual-learning framework for PyTorch: five incremental
62
+ scenarios, a five-call plugin API, an accuracy-matrix trainer, and reference
63
+ implementations of the standard CL baselines.
64
+
65
+ ## Install
66
+
67
+ `activationscope` builds a C++ extension with `-std=c++17`, so install torch 2.8
68
+ first (newer torch headers require C++20), then build it against that torch:
69
+
70
+ ```bash
71
+ pip install "torch==2.8.*" --index-url https://download.pytorch.org/whl/cpu # or /cu128
72
+ pip install setuptools wheel ninja numpy
73
+ pip install activationscope --no-build-isolation
74
+ pip install gmumcl # or: pip install "gmumcl[datasets]"
75
+ ```
76
+
77
+ From source: `git clone https://github.com/gmum/gmumcl && cd gmumcl && pip install -e ".[test]"`.
78
+ Full notes (why the pin, why `--no-build-isolation`): `docs/usage.md`.
79
+
80
+ ## Quickstart
81
+
82
+ ```bash
83
+ python scripts/run.py --config configs/base.yaml -O method.name=ewc -O method.lambda=10
84
+ ```
85
+
86
+ ```python
87
+ from gmumcl import train
88
+
89
+ metrics = train.run({
90
+ "data": {"name": "toy", "num_classes": 4, "classes_per_task": 2},
91
+ "model": {"name": "mlp", "hidden": 16},
92
+ "trainer": {"epochs": 1, "lr": 0.01, "device": "cpu"},
93
+ "method": {"name": "ewc", "lambda": 1.0},
94
+ })
95
+ print(metrics["accuracy_matrix"])
96
+ ```
97
+
98
+ ## Scenarios (`data.scenario`)
99
+
100
+ | Key | Tasks | Evaluation |
101
+ |---|---|---|
102
+ | `class_incremental` | disjoint class groups | all classes seen so far |
103
+ | `task_incremental` | disjoint class groups | task oracle (logits masked to the task) |
104
+ | `domain_incremental` | all classes, shifted inputs (rotations) | all classes |
105
+ | `instance_incremental` | random partitions of all instances | all classes |
106
+ | `permuted` | all classes, one fixed input permutation per task | all classes |
107
+
108
+ Dataset names: `toy` (CPU clusters), `mnist`, `cifar10`, `cifar100`, plus
109
+ `rotated_mnist` (domain-incremental) and `permuted_mnist`.
110
+
111
+ ## Methods (`method.name`)
112
+
113
+ | Name | Reference | Source |
114
+ |---|---|---|
115
+ | `naive` | — | plain fine-tuning |
116
+ | `l2` | Hsu et al. 2018 | quadratic anchor |
117
+ | `ewc` | Kirkpatrick et al. 2017 | gmumcl / InTAct-Flex |
118
+ | `ewc_dr` | EWC-DR | `scarlet0703/EWC-DR` (adcaaeb9) |
119
+ | `online_ewc` | Schwarz et al. 2018 | gmumcl / InTAct-Flex |
120
+ | `si` | Zenke et al. 2017 | gmumcl |
121
+ | `mas` | Aljundi et al. 2018 | gmumcl |
122
+ | `lwf` | Li & Hoiem 2017 | gmumcl / `GMvandeVen/continual-learning` |
123
+ | `kfac` | Kao et al. 2021 | `Xin-Jing/K-FAC` (09f4565c) |
124
+ | `ncl` | Kao et al. 2021 | `tachukao/ncl` (92c2ba5e) |
125
+ | `owm` | Zeng et al. 2019 | `GMvandeVen/continual-learning` (e6d795aa) |
126
+ | `gpm` | Saha et al. 2021 | `sahagobinda/GPM` (1a238ec9) |
127
+ | `intact` | Krukowski et al. 2025 | `pkrukowski1/InTAct` (83b90c55) |
128
+ | `sharpening` | gmumcl | `OneAndZero24/local-cl` |
129
+ | `dreaming` | gmumcl | `OneAndZero24/local-cl` (needs `model.head_type: rbf`) |
130
+
131
+ ## Docs
132
+
133
+ - `docs/framework.md` — plugin lifecycle, trainer, metrics, adding a method
134
+ - `docs/scenarios.md` — the five scenarios and their protocols
135
+ - `docs/methods.md` — formulas, defaults and provenance per method
136
+ - `docs/usage.md` — install, CLI, configs, custom components
137
+ - `docs/results.md` — reproduced Split-MNIST table (from AdaReg) and deviations
138
+
139
+ ## License
140
+
141
+ MIT (GMUM). See `LICENSE`.
gmumcl-1.0.0/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # gmumcl
2
+
3
+ [![CI](https://github.com/gmum/gmumcl/actions/workflows/ci.yml/badge.svg)](https://github.com/gmum/gmumcl/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/gmumcl)](https://pypi.org/project/gmumcl/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/gmumcl)](https://pypi.org/project/gmumcl/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ A small, generic continual-learning framework for PyTorch: five incremental
9
+ scenarios, a five-call plugin API, an accuracy-matrix trainer, and reference
10
+ implementations of the standard CL baselines.
11
+
12
+ ## Install
13
+
14
+ `activationscope` builds a C++ extension with `-std=c++17`, so install torch 2.8
15
+ first (newer torch headers require C++20), then build it against that torch:
16
+
17
+ ```bash
18
+ pip install "torch==2.8.*" --index-url https://download.pytorch.org/whl/cpu # or /cu128
19
+ pip install setuptools wheel ninja numpy
20
+ pip install activationscope --no-build-isolation
21
+ pip install gmumcl # or: pip install "gmumcl[datasets]"
22
+ ```
23
+
24
+ From source: `git clone https://github.com/gmum/gmumcl && cd gmumcl && pip install -e ".[test]"`.
25
+ Full notes (why the pin, why `--no-build-isolation`): `docs/usage.md`.
26
+
27
+ ## Quickstart
28
+
29
+ ```bash
30
+ python scripts/run.py --config configs/base.yaml -O method.name=ewc -O method.lambda=10
31
+ ```
32
+
33
+ ```python
34
+ from gmumcl import train
35
+
36
+ metrics = train.run({
37
+ "data": {"name": "toy", "num_classes": 4, "classes_per_task": 2},
38
+ "model": {"name": "mlp", "hidden": 16},
39
+ "trainer": {"epochs": 1, "lr": 0.01, "device": "cpu"},
40
+ "method": {"name": "ewc", "lambda": 1.0},
41
+ })
42
+ print(metrics["accuracy_matrix"])
43
+ ```
44
+
45
+ ## Scenarios (`data.scenario`)
46
+
47
+ | Key | Tasks | Evaluation |
48
+ |---|---|---|
49
+ | `class_incremental` | disjoint class groups | all classes seen so far |
50
+ | `task_incremental` | disjoint class groups | task oracle (logits masked to the task) |
51
+ | `domain_incremental` | all classes, shifted inputs (rotations) | all classes |
52
+ | `instance_incremental` | random partitions of all instances | all classes |
53
+ | `permuted` | all classes, one fixed input permutation per task | all classes |
54
+
55
+ Dataset names: `toy` (CPU clusters), `mnist`, `cifar10`, `cifar100`, plus
56
+ `rotated_mnist` (domain-incremental) and `permuted_mnist`.
57
+
58
+ ## Methods (`method.name`)
59
+
60
+ | Name | Reference | Source |
61
+ |---|---|---|
62
+ | `naive` | — | plain fine-tuning |
63
+ | `l2` | Hsu et al. 2018 | quadratic anchor |
64
+ | `ewc` | Kirkpatrick et al. 2017 | gmumcl / InTAct-Flex |
65
+ | `ewc_dr` | EWC-DR | `scarlet0703/EWC-DR` (adcaaeb9) |
66
+ | `online_ewc` | Schwarz et al. 2018 | gmumcl / InTAct-Flex |
67
+ | `si` | Zenke et al. 2017 | gmumcl |
68
+ | `mas` | Aljundi et al. 2018 | gmumcl |
69
+ | `lwf` | Li & Hoiem 2017 | gmumcl / `GMvandeVen/continual-learning` |
70
+ | `kfac` | Kao et al. 2021 | `Xin-Jing/K-FAC` (09f4565c) |
71
+ | `ncl` | Kao et al. 2021 | `tachukao/ncl` (92c2ba5e) |
72
+ | `owm` | Zeng et al. 2019 | `GMvandeVen/continual-learning` (e6d795aa) |
73
+ | `gpm` | Saha et al. 2021 | `sahagobinda/GPM` (1a238ec9) |
74
+ | `intact` | Krukowski et al. 2025 | `pkrukowski1/InTAct` (83b90c55) |
75
+ | `sharpening` | gmumcl | `OneAndZero24/local-cl` |
76
+ | `dreaming` | gmumcl | `OneAndZero24/local-cl` (needs `model.head_type: rbf`) |
77
+
78
+ ## Docs
79
+
80
+ - `docs/framework.md` — plugin lifecycle, trainer, metrics, adding a method
81
+ - `docs/scenarios.md` — the five scenarios and their protocols
82
+ - `docs/methods.md` — formulas, defaults and provenance per method
83
+ - `docs/usage.md` — install, CLI, configs, custom components
84
+ - `docs/results.md` — reproduced Split-MNIST table (from AdaReg) and deviations
85
+
86
+ ## License
87
+
88
+ MIT (GMUM). See `LICENSE`.
@@ -0,0 +1,32 @@
1
+ # CPU quickstart: tiny Gaussian clusters, class-incremental, EWC.
2
+ # Run: python scripts/run.py --config configs/base.yaml
3
+ seed: 0
4
+
5
+ data:
6
+ name: toy # toy | mnist | cifar10 | cifar100 | permuted_mnist | rotated_mnist
7
+ scenario: class_incremental # class_incremental | task_incremental | domain_incremental | instance_incremental | permuted
8
+ dimension: 8
9
+ num_classes: 6
10
+ classes_per_task: 2
11
+ samples_per_class: 150
12
+ num_tasks: 5 # used by instance_incremental / domain_incremental / permuted
13
+ calibration_fraction: 0.1
14
+ min_calibration: 50
15
+ batch_size: 32
16
+
17
+ model:
18
+ name: mlp # mlp | small_cnn | resnet18 | vit
19
+ hidden: 64
20
+ layers: 2
21
+ head_type: linear # linear | rbf (rbf is required by Dreaming)
22
+ growing_head: true # default: true for class/task-incremental, false otherwise
23
+
24
+ trainer:
25
+ epochs: 1
26
+ lr: 0.01
27
+ device: cpu
28
+ verbose: false # per-task/epoch progress and timing prints
29
+
30
+ method:
31
+ name: ewc # naive | l2 | ewc | ewc_dr | online_ewc | si | mas | lwf |
32
+ lambda: 0.1 # kfac | ncl | owm | gpm | intact | sharpening | dreaming
@@ -0,0 +1,35 @@
1
+ # Dreaming on Split MNIST class-incremental.
2
+ # The Hsu-adapted protocol is reused so the row is comparable; the model uses
3
+ # the RBF head the method replays, and the generation budget follows the
4
+ # original gmumcl defaults. See docs/results.md for the protocol, provenance
5
+ # and documented deviations.
6
+ # Run: python scripts/run.py --config configs/baselines/dreaming.yaml
7
+ seed: 0
8
+
9
+ data:
10
+ name: mnist
11
+ root: data
12
+ classes_per_task: 2
13
+ calibration_fraction: 0.0
14
+ min_calibration: 0
15
+ batch_size: 128
16
+
17
+ model:
18
+ name: mlp
19
+ input_dim: 784
20
+ hidden: 400
21
+ layers: 2
22
+ growing_head: true
23
+ head_type: rbf
24
+
25
+ trainer:
26
+ epochs: 4
27
+ lr: 0.001
28
+ device: cuda
29
+
30
+ method:
31
+ name: dreaming
32
+ alpha: 1.0 # feature-distillation weight
33
+ samples_per_class: 32
34
+ steps: 100 # per-class input optimisation steps
35
+ in_shape: [1, 28, 28]
@@ -0,0 +1,30 @@
1
+ # EWC, Hsu et al. (2018) Split MNIST class-incremental baseline.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # See docs/results.md for the full protocol and documented deviations.
4
+ # Run: python scripts/run.py --config configs/baselines/ewc.yaml
5
+ seed: 0
6
+
7
+ data:
8
+ name: mnist
9
+ root: data
10
+ classes_per_task: 2
11
+ calibration_fraction: 0.0
12
+ min_calibration: 0
13
+ batch_size: 128
14
+
15
+ model:
16
+ name: mlp
17
+ input_dim: 784
18
+ hidden: 400
19
+ layers: 2
20
+ growing_head: true
21
+
22
+ trainer:
23
+ epochs: 4
24
+ lr: 0.001
25
+ device: cuda
26
+
27
+ method:
28
+ name: ewc
29
+ mode: ewc
30
+ lambda: 600.0 # Hsu et al. grid-search optimum
@@ -0,0 +1,32 @@
1
+ # EWC-DR, port of `scarlet0703/EWC-DR` (commit adcaaeb9) on Split MNIST.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # The importance is the reversed-logit gradient squared, averaged over the
4
+ # task loader and clamped at `omegamax`, merged with alpha = known/total.
5
+ # See docs/results.md for the full protocol and documented deviations.
6
+ # Run: python scripts/run.py --config configs/baselines/ewc_dr.yaml
7
+ seed: 0
8
+
9
+ data:
10
+ name: mnist
11
+ root: data
12
+ classes_per_task: 2
13
+ calibration_fraction: 0.0
14
+ min_calibration: 0
15
+ batch_size: 128
16
+
17
+ model:
18
+ name: mlp
19
+ input_dim: 784
20
+ hidden: 400
21
+ layers: 2
22
+ growing_head: true
23
+
24
+ trainer:
25
+ epochs: 4
26
+ lr: 0.001
27
+ device: cuda
28
+
29
+ method:
30
+ name: ewc_dr
31
+ lambda: 1.0
32
+ omegamax: 0.0001 # official clamp
@@ -0,0 +1,33 @@
1
+ # GPM, port of `sahagobinda/GPM` (commit 1a238ec9) on Split MNIST
2
+ # class-incremental. The official thresholds (0.97 + 0.003 * task) and row
3
+ # cap are kept; the training protocol follows the Hsu-adapted setup used by
4
+ # the other rows so the numbers are comparable.
5
+ # See docs/results.md for the full protocol and documented deviations.
6
+ # Run: python scripts/run.py --config configs/baselines/gpm.yaml
7
+ seed: 0
8
+
9
+ data:
10
+ name: mnist
11
+ root: data
12
+ classes_per_task: 2
13
+ calibration_fraction: 0.0
14
+ min_calibration: 0
15
+ batch_size: 128
16
+
17
+ model:
18
+ name: mlp
19
+ input_dim: 784
20
+ hidden: 400
21
+ layers: 2
22
+ growing_head: true
23
+
24
+ trainer:
25
+ epochs: 4
26
+ lr: 0.001
27
+ device: cuda
28
+
29
+ method:
30
+ name: gpm
31
+ threshold_base: 0.97 # official energy thresholds
32
+ threshold_step: 0.003
33
+ max_rows: 125
@@ -0,0 +1,32 @@
1
+ # InTAct, port of `pkrukowski1/InTAct` (commit 83b90c55) on Split MNIST
2
+ # class-incremental. InTAct paper protocol: 2x400 MLP, batch 512, 5 epochs,
3
+ # Adam lr=2e-4, and the published class-IL coefficients.
4
+ # See docs/results.md for the full protocol and documented deviations.
5
+ # Run: python scripts/run.py --config configs/baselines/intact.yaml
6
+ seed: 0
7
+
8
+ data:
9
+ name: mnist
10
+ root: data
11
+ classes_per_task: 2
12
+ calibration_fraction: 0.0
13
+ min_calibration: 0
14
+ batch_size: 512
15
+
16
+ model:
17
+ name: mlp
18
+ input_dim: 784
19
+ hidden: 400
20
+ layers: 2
21
+ growing_head: true
22
+
23
+ trainer:
24
+ epochs: 5
25
+ lr: 0.0002
26
+ device: cuda
27
+
28
+ method:
29
+ name: intact
30
+ var_scale: 4.2 # published class-IL coefficients
31
+ lambda_int_drift: 6.0
32
+ lambda_feat: 779.0
@@ -0,0 +1,31 @@
1
+ # K-FAC, NCL-paper baseline (Kao et al., 2021) on Split MNIST class-incremental.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # `lambda` is not tuned here (the NCL paper tunes it per experiment).
4
+ # See docs/results.md for the full protocol and documented deviations.
5
+ # Run: python scripts/run.py --config configs/baselines/kfac.yaml
6
+ seed: 0
7
+
8
+ data:
9
+ name: mnist
10
+ root: data
11
+ classes_per_task: 2
12
+ calibration_fraction: 0.0
13
+ min_calibration: 0
14
+ batch_size: 128
15
+
16
+ model:
17
+ name: mlp
18
+ input_dim: 784
19
+ hidden: 400
20
+ layers: 2
21
+ growing_head: true
22
+
23
+ trainer:
24
+ epochs: 4
25
+ lr: 0.001
26
+ device: cuda
27
+
28
+ method:
29
+ name: kfac
30
+ lambda: 1.0
31
+ kfac_samples: 256 # output-gradient samples per task
@@ -0,0 +1,29 @@
1
+ # L2, Hsu et al. (2018) Split MNIST class-incremental baseline.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # See docs/results.md for the full protocol and documented deviations.
4
+ # Run: python scripts/run.py --config configs/baselines/l2.yaml
5
+ seed: 0
6
+
7
+ data:
8
+ name: mnist
9
+ root: data
10
+ classes_per_task: 2
11
+ calibration_fraction: 0.0
12
+ min_calibration: 0
13
+ batch_size: 128
14
+
15
+ model:
16
+ name: mlp
17
+ input_dim: 784
18
+ hidden: 400
19
+ layers: 2
20
+ growing_head: true
21
+
22
+ trainer:
23
+ epochs: 4
24
+ lr: 0.001
25
+ device: cuda
26
+
27
+ method:
28
+ name: l2
29
+ lambda: 100.0 # Hsu et al. grid-search optimum
@@ -0,0 +1,30 @@
1
+ # LwF, Hsu et al. (2018) Split MNIST class-incremental baseline.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # See docs/results.md for the full protocol and documented deviations.
4
+ # Run: python scripts/run.py --config configs/baselines/lwf.yaml
5
+ seed: 0
6
+
7
+ data:
8
+ name: mnist
9
+ root: data
10
+ classes_per_task: 2
11
+ calibration_fraction: 0.0
12
+ min_calibration: 0
13
+ batch_size: 128
14
+
15
+ model:
16
+ name: mlp
17
+ input_dim: 784
18
+ hidden: 400
19
+ layers: 2
20
+ growing_head: true
21
+
22
+ trainer:
23
+ epochs: 4
24
+ lr: 0.001
25
+ device: cuda
26
+
27
+ method:
28
+ name: lwf
29
+ lambda: 1.0 # distillation weight (Li and Hoiem default)
30
+ temperature: 2.0
@@ -0,0 +1,29 @@
1
+ # MAS, Hsu et al. (2018) Split MNIST class-incremental baseline.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # See docs/results.md for the full protocol and documented deviations.
4
+ # Run: python scripts/run.py --config configs/baselines/mas.yaml
5
+ seed: 0
6
+
7
+ data:
8
+ name: mnist
9
+ root: data
10
+ classes_per_task: 2
11
+ calibration_fraction: 0.0
12
+ min_calibration: 0
13
+ batch_size: 128
14
+
15
+ model:
16
+ name: mlp
17
+ input_dim: 784
18
+ hidden: 400
19
+ layers: 2
20
+ growing_head: true
21
+
22
+ trainer:
23
+ epochs: 4
24
+ lr: 0.001
25
+ device: cuda
26
+
27
+ method:
28
+ name: mas
29
+ lambda: 1.0 # Hsu et al. grid-search optimum
@@ -0,0 +1,28 @@
1
+ # Naive fine-tuning, Hsu et al. (2018) Split MNIST class-incremental baseline.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # See docs/results.md for the full protocol and documented deviations.
4
+ # Run: python scripts/run.py --config configs/baselines/naive.yaml
5
+ seed: 0
6
+
7
+ data:
8
+ name: mnist
9
+ root: data
10
+ classes_per_task: 2
11
+ calibration_fraction: 0.0
12
+ min_calibration: 0
13
+ batch_size: 128
14
+
15
+ model:
16
+ name: mlp
17
+ input_dim: 784
18
+ hidden: 400
19
+ layers: 2
20
+ growing_head: true
21
+
22
+ trainer:
23
+ epochs: 4
24
+ lr: 0.001
25
+ device: cuda
26
+
27
+ method:
28
+ name: naive
@@ -0,0 +1,36 @@
1
+ # NCL (no opt), NCL-paper baseline (Kao et al., NeurIPS 2021) on Split MNIST
2
+ # class-incremental. Protocol (paper Appendix E): batch 256, 2000 iterations
3
+ # per task, SGD with momentum 0.9 and lr 0.05, single 10-way output layer.
4
+ # Unit Gaussian prior (p_w^-2 = 1), projection stabiliser 1e-10, lambda 1.
5
+ # See docs/results.md for the full protocol and documented deviations.
6
+ # Run: python scripts/run.py --config configs/baselines/ncl.yaml
7
+ seed: 0
8
+
9
+ data:
10
+ name: mnist
11
+ root: data
12
+ classes_per_task: 2
13
+ calibration_fraction: 0.0
14
+ min_calibration: 0
15
+ batch_size: 256
16
+
17
+ model:
18
+ name: mlp
19
+ input_dim: 784
20
+ hidden: 400
21
+ layers: 2
22
+ growing_head: false
23
+
24
+ trainer:
25
+ optimizer: sgd
26
+ momentum: 0.9
27
+ lr: 0.05
28
+ iterations: 2000
29
+ device: cuda
30
+
31
+ method:
32
+ name: ncl
33
+ data_size: 1.0 # unit prior: NCL (no opt)
34
+ projection_alpha: 0.0000000001
35
+ lambda: 1.0
36
+ kfac_samples: 256
@@ -0,0 +1,30 @@
1
+ # Online EWC, Hsu et al. (2018) Split MNIST class-incremental baseline.
2
+ # Protocol: 4 epochs/task, batch 128, Adam lr=1e-3, all training data.
3
+ # See docs/results.md for the full protocol and documented deviations.
4
+ # Run: python scripts/run.py --config configs/baselines/online_ewc.yaml
5
+ seed: 0
6
+
7
+ data:
8
+ name: mnist
9
+ root: data
10
+ classes_per_task: 2
11
+ calibration_fraction: 0.0
12
+ min_calibration: 0
13
+ batch_size: 128
14
+
15
+ model:
16
+ name: mlp
17
+ input_dim: 784
18
+ hidden: 400
19
+ layers: 2
20
+ growing_head: true
21
+
22
+ trainer:
23
+ epochs: 4
24
+ lr: 0.001
25
+ device: cuda
26
+
27
+ method:
28
+ name: online_ewc
29
+ gamma: 1.0 # Hsu et al. accumulate without decay
30
+ lambda: 100.0 # Hsu et al. grid-search optimum