Upload 236 files
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +10 -0
- LICENSE +21 -0
- README.md +178 -3
- README_ZH.md +62 -0
- config/InfLoRA.yaml +64 -0
- config/InfLoRA_opt-vit-cifar100-b10-10-10.yaml +72 -0
- config/InfLoRA_opt-vit-imagenetr-b20-20-10.yaml +73 -0
- config/InfLoRA_opt.yaml +71 -0
- config/InfLoRA_opt_clip.yaml +75 -0
- config/PRAKA.yaml +78 -0
- config/api_til-alexnet-cifar100-b5-5-20.yaml +39 -0
- config/backbones/CifarResnet.yaml +7 -0
- config/backbones/resnet12.yaml +7 -0
- config/codaprompt.yaml +72 -0
- config/dap.yaml +74 -0
- config/der.yaml +59 -0
- config/dmnsp.yaml +71 -0
- config/dmnsp_imgnr.yaml +55 -0
- config/dmnsp_vit.yaml +69 -0
- config/dualprompt.yaml +54 -0
- config/ewc.yaml +41 -0
- config/finetune.yaml +53 -0
- config/headers/data.yaml +7 -0
- config/headers/device.yaml +4 -0
- config/headers/model.yaml +11 -0
- config/headers/optimizer.yaml +11 -0
- config/headers/test.yaml +11 -0
- config/icarl.yaml +68 -0
- config/icarl_5dataset.yaml +72 -0
- config/l2p-vit-cifar100-b10-10-10.yaml +67 -0
- config/lwf.yaml +42 -0
- config/ranpac.yaml +63 -0
- config/ranpac_clip.yaml +66 -0
- config/rapf10-10.yaml +74 -0
- config/rapf50-10.yaml +72 -0
- config/rapf50-5.yaml +71 -0
- config/tam.yaml +70 -0
- config/zz_BIC/bic-resnet32-5dataset-b10-10-5.yaml +65 -0
- config/zz_BIC/bic-resnet32-cifar100-b10-10-10.yaml +77 -0
- config/zz_BIC/bic-resnet32-cifar100-b20-20-5.yaml +77 -0
- config/zz_BIC/bic-resnet32-imagenetr-b20-20-10.yaml +59 -0
- config/zz_BIC/bic-resnet32-tiny-b20-20-10.yaml +59 -0
- config/zz_CL-LoRA/cl_lora-cifar100-b5-5-20.yaml +75 -0
- config/zz_CL-LoRA/cl_lora-imagenetr-b5-5-40.yaml +76 -0
- config/zz_ERACE/erace-resnet18-5dataset-b10-10-5.yaml +46 -0
- config/zz_ERACE/erace-resnet18-imagenetr-b20-20-10.yaml +41 -0
- config/zz_ERACE/erace.yaml +58 -0
- config/zz_ERAML/eraml-resnet18-5dataset-b10-10-5.yaml +46 -0
- config/zz_ERAML/eraml-resnet18-imagenetr-b20-20-10.yaml +41 -0
- config/zz_ERAML/eraml.yaml +58 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,13 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
resources/imgs/cl_lora.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
resources/imgs/codaprompt.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
resources/imgs/dap.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
resources/imgs/flowchart.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
resources/imgs/InfLoRA.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
resources/imgs/LUCIR.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
resources/imgs/moe_adapter4cl.png filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
resources/imgs/praka.png filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
resources/imgs/rapf.png filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
resources/imgs/wa.png filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024 VIG@R&L
|
| 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.
|
README.md
CHANGED
|
@@ -1,3 +1,178 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!--# LibContinual-->
|
| 2 |
+
<div align="center">
|
| 3 |
+
<h1>LibContinual: Make Continual Learning Easy</h1>
|
| 4 |
+
<!-- <h3>Make Continual Learning Easy</h3> -->
|
| 5 |
+
<img src="./resources/imgs/flowchart.png" width="75%"/>
|
| 6 |
+
</div>
|
| 7 |
+
|
| 8 |
+
## Introduction
|
| 9 |
+
<div style="text-align: justify">
|
| 10 |
+
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.
|
| 11 |
+
</div>
|
| 12 |
+
|
| 13 |
+
<!---->
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
## Supported Methods
|
| 17 |
+
### Conventional methods
|
| 18 |
+
+ [LwF (ECCV 2016)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/lwf/README.md): Learning without Forgetting.
|
| 19 |
+
+ [EWC (PNAS 2017)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/ewc/README.md): Overcoming catastrophic forgetting in neural networks.
|
| 20 |
+
+ [iCaRL (CVPR 2017)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/icarl/README.md): Incremental Classifier and Representation Learning.
|
| 21 |
+
+ [BiC (CVPR 2019)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/bic/README.md): Large Scale Incremental Learning.
|
| 22 |
+
+ [LUCIR (CVPR 2019)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/lucir/README.md): Learning a Unified Classifier Incrementally via Rebalancing.
|
| 23 |
+
+ [WA (CVPR 2020)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/wa/README.md): Maintaining Discrimination and Fairness in Class Incremental Learning.
|
| 24 |
+
+ [OCM (ICML 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/ocm/README.md): Online Continual Learning through Mutual Information Maximization.
|
| 25 |
+
+ [ERACE, ERAML (ICLR 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/erace,eraml/README.md): New Insights on reducing abrupt representation change in online continual learning.
|
| 26 |
+
+ [GPM (ICLR 2021)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/gpm/README.md): Gradient Projection Memory for Continual Learning.
|
| 27 |
+
+ [TRGP (ICLR 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/trgp/README.md): Trust Region Gradient Projection for Continual Learning.
|
| 28 |
+
+ [API (CVPR 2023)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/api/README.md): Adaptive Plasticity Improvement for Continual Learning.
|
| 29 |
+
+ [RanPAC (NeurIPS 2023)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/ranpac/README.md): Random Projections and Pre-trained Models for Continual Learning.
|
| 30 |
+
<!-- + [PRAKA (ICCV 2023)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/praka/README.md): Prototype Reminiscence and Augmented Asymmetric Knowledge Aggregation for Non-Exemplar Class-Incremental Learning. -->
|
| 31 |
+
<!-- + [DER (CVPR 2021)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/der/README.md): Dynamically Expandable Representation for Class Incremental Learning. -->
|
| 32 |
+
|
| 33 |
+
### Foundation model based methods
|
| 34 |
+
+ [L2P (CVPR 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/l2p/README.md): Learning to Prompt for Continual Learning.
|
| 35 |
+
+ [DualPrompt (ECCV 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/dualprompt/README.md): Complementary Prompting for Rehearsal-free Continual Learning.
|
| 36 |
+
+ [CodaPrompt (CVPR 2023)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/codaprompt/README.md): COntinual Decomposed Attention-based Prompting for Rehearsal-Free Continual Learning.
|
| 37 |
+
+ [InfLoRA (CVPR 2024)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/inflora/README.md): Interference-Free Low-Rank Adaptation for Continual Learning.
|
| 38 |
+
+ [MoE_Adapter4CL (CVPR 2024)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/moe_adapter4cl/README.md): Boosting Continual Learning of Vision-Language Models via Mixture-of-Experts Adapters.
|
| 39 |
+
+ [RAPF (ECCV 2024)](https://github.com/RL-VIG/LibContinual/tree/master/reproduce/rapf): Class-Incremental Learning with CLIP: Adaptive Representation Adjustment and Parameter Fusion.
|
| 40 |
+
+ [SD_LoRA (ICLR 2025)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/sd_lora/README.md): Scalable Decoupled Low-Rank Adaptation for Class Incremental Learning
|
| 41 |
+
+ [LoRA_Sub_DRS (CVPR 2025)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/lora_sub_drs/README.md): LoRA Subtraction for Drift-Resistant Space in Exemplar-Free Continual Learning
|
| 42 |
+
+ [CL-LoRA (CVPR 2025)](https://github.com/RL-VIG/LibContinual/tree/master/reproduce/cl_lora/README.md): Continual Low-Rank Adaptation for Rehearsal-Free Class-Incremental Learning
|
| 43 |
+
|
| 44 |
+
<!-- ## Quick Installation
|
| 45 |
+
|
| 46 |
+
Please refer to [`install.md`](https://libcontinual.readthedocs.io/en/latest/docs/install.html) <br>
|
| 47 |
+
Complete tutorials can be found at [`./docs`](https://libcontinual.readthedocs.io/en/latest/)
|
| 48 |
+
-->
|
| 49 |
+
|
| 50 |
+
## Installation
|
| 51 |
+
Please refer to [`install.md`](https://libcontinual.readthedocs.io/en/latest/docs/install.html) <br>
|
| 52 |
+
Complete tutorials can be found at [`./docs`](https://libcontinual.readthedocs.io/en/latest/)
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
## Datasets
|
| 56 |
+
- CIFAR-10 is avaliable at [Google Drive](https://drive.google.com/drive/folders/1sl2aW1sRpEfQJuJZwajXO2QhR06gQYZx?usp=drive_link) <br>
|
| 57 |
+
- CIFAR-100 is available at [Google Drive](https://drive.google.com/drive/folders/1EL46LQ3ww-F1NVTwFDPIg-nO198cUqWm?usp=sharing) <br>
|
| 58 |
+
- CUB200, ImageNet-R, Tiny-Imagenet, 5-Dataset are available at [Google Drive](https://drive.google.com/drive/folders/16afRW2952coWJSbiH7cZT1b8pRibA8nH?usp=sharing) <br>
|
| 59 |
+
|
| 60 |
+
After the dataset is downloaded, please extract the compressed file to the specified path.
|
| 61 |
+
```
|
| 62 |
+
unzip cifar100.zip -d /path/to/your/dataset
|
| 63 |
+
```
|
| 64 |
+
Set the `data_root` in `.yaml`:
|
| 65 |
+
```
|
| 66 |
+
data_root: /path/to/your/dataset
|
| 67 |
+
```
|
| 68 |
+
To add a custom dataset, please refer to [`dataset.md`](https://libcontinual.readthedocs.io/en/latest/docs/data_module_en.html).
|
| 69 |
+
|
| 70 |
+
## Getting Started
|
| 71 |
+
|
| 72 |
+
Once you have completed the "Installation" and "Datasets" sections, you can now proceed to demonstrate how to use the "LibContinual" framework with the [`LUCIR`](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/lucir/README.md) method.
|
| 73 |
+
|
| 74 |
+
- **Step1:** Configure the parameters in the `./config/lucir.yaml` file. Please refer to [`config.md`](https://libcontinual.readthedocs.io/en/latest/docs/config_file_en.html) for the meanings of each parameter.
|
| 75 |
+
- **Step2:** Run code `python run_trainer.py --config lucir.yaml`
|
| 76 |
+
- **Step3:** After the training is completed, the log files will be saved in the path specified by the `save_path` parameter.
|
| 77 |
+
|
| 78 |
+
## Benchmarks
|
| 79 |
+
|
| 80 |
+
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$:
|
| 81 |
+
|
| 82 |
+
<!--
|
| 83 |
+
* $T \in [1, \text{task num}]$
|
| 84 |
+
* $R_{t,i}$ be accuracy of **model after training on task $t$ being test on test data of task $i$**
|
| 85 |
+
* $R_{t,{i\sim j}}$ be accuracy of **model after training on task $t$ being test on test data of task $i\sim j$**
|
| 86 |
+
-->
|
| 87 |
+
|
| 88 |
+
### Evaluation Metrics
|
| 89 |
+
|
| 90 |
+
#### **1.** Last Average Accuracy
|
| 91 |
+
$$
|
| 92 |
+
Acc_T=R_{T, {0\sim T}} \quad (1)
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
#### **2.** Backward Transfer (BWT)
|
| 97 |
+
$$
|
| 98 |
+
BWT_T = \frac{\sum_{i=3}^T\sum_{j=1}^{i-2}R_{i,j}-R{j,j}}{T(T-1)/2} \quad (2)
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
#### **3.** Forgetting
|
| 102 |
+
$$
|
| 103 |
+
Frgt_T = \frac{\sum_{j=1}^{T-2}R_{T-1,j}-R_{j,j}}{T-1} \quad (3)
|
| 104 |
+
$$
|
| 105 |
+
> Equivalent to Positive BwT in ["new metrics for Continual Learning"](https://arxiv.org/pdf/1810.13166)
|
| 106 |
+
|
| 107 |
+
<!--
|
| 108 |
+
#### **4.** Overall Average Accuracy (Batch Version)
|
| 109 |
+
$$
|
| 110 |
+
\overline{Acc_T}=\frac{1}{T}\sum_{t=1}^T(R_{t,{0\sim T}}) \quad (4)
|
| 111 |
+
$$
|
| 112 |
+
-->
|
| 113 |
+
#### **4.** Overall Average Accuracy
|
| 114 |
+
$$
|
| 115 |
+
\overline{Acc_T}=\frac{1}{T}\sum_{t=1}^T(\frac{1}{t}\sum_{i=1}^t R_{t,i}) \quad (4)
|
| 116 |
+
$$
|
| 117 |
+
<!--
|
| 118 |
+
> **Note**:
|
| 119 |
+
> - “Overall” and “Batch“ versions are equivalent when initial class count equals incremental class count
|
| 120 |
+
|
| 121 |
+
> - Implementation follows: **Lucir** (Task), **Praka** (Batch)
|
| 122 |
+
-->
|
| 123 |
+
|
| 124 |
+
<!--
|
| 125 |
+
### \[Batch\] Last Average Accuracy
|
| 126 |
+
|
| 127 |
+
> $Acc_T=R_{T, {0\sim T}}$
|
| 128 |
+
|
| 129 |
+
### Backward Transfer
|
| 130 |
+
|
| 131 |
+
> Equivalent to Positive BwT of Continuum
|
| 132 |
+
>
|
| 133 |
+
> https://arxiv.org/pdf/1810.13166
|
| 134 |
+
>
|
| 135 |
+
> $BWT_T = \frac{\sum_{i=3}^T\sum_{j=1}^{i-2}R_{i,j}-R{j,j}}{T(T-1)/2}$
|
| 136 |
+
|
| 137 |
+
### Forgetting
|
| 138 |
+
|
| 139 |
+
> Equivalent to Forgetting of Continuum
|
| 140 |
+
>
|
| 141 |
+
> $Frgt_T = \frac{\sum_{j=1}^{T-2}R_{T-1,j}-R_{j,j}}{T-1}$
|
| 142 |
+
|
| 143 |
+
### \[Batch\] Overall Average Accuracy
|
| 144 |
+
|
| 145 |
+
> $\overline{Acc_T}=\frac{1}{T}\sum_{t=1}^T(R_{t,{0\sim T}})$
|
| 146 |
+
|
| 147 |
+
### \[Task\] Overall Average Accuracy
|
| 148 |
+
|
| 149 |
+
> $\overline{Acc_T}=\frac{1}{T}\sum_{t=1}^T(\frac{1}{t}\sum_{i=1}^t R_{t,i})$
|
| 150 |
+
|
| 151 |
+
Note:
|
| 152 |
+
* \[Batch\] Overall Average Accuracy and \[Task\] Overall Average Accuracy are equal if initial num of classes equal to increment num of classes
|
| 153 |
+
* We keep both implementation of Overall Average Accuracy as **Lucir** use \[Task\] in its original experiment, while **Praka** use \[Batch\].
|
| 154 |
+
|
| 155 |
+
### Overall Forgetting
|
| 156 |
+
|
| 157 |
+
> $\overline{Frgt_T} = \frac{1}{T-2}\sum_{t=3}^TFrgt_{t}$
|
| 158 |
+
|
| 159 |
+
### Overall Backward Transfer
|
| 160 |
+
|
| 161 |
+
> $\overline{BWT_T} = \frac{1}{T-2}\sum_{t=3}^TBWT_{t}$
|
| 162 |
+
-->
|
| 163 |
+
|
| 164 |
+
## Acknowledgement
|
| 165 |
+
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.
|
| 166 |
+
Special thanks to the authors of [FACIL](https://github.com/mmasana/FACIL) and [PyCIL](https://github.com/G-U-N/PyCIL) for their inspiration on framework design.
|
| 167 |
+
|
| 168 |
+
<!--This project has been developed with references to the following repositories:
|
| 169 |
+
|
| 170 |
+
- [FACIL](https://github.com/mmasana/FACIL)
|
| 171 |
+
- [PyCIL](https://github.com/G-U-N/PyCIL)
|
| 172 |
+
-->
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
We have referenced useful modules from these repositories in our work. We deeply appreciate the authors of these repositories.
|
| 176 |
+
|
| 177 |
+
## License
|
| 178 |
+
This project is licensed under the MIT License. See LICENSE for more details.
|
README_ZH.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LibContinual
|
| 2 |
+
Make continual learning easy.
|
| 3 |
+
|
| 4 |
+
## Introduction
|
| 5 |
+
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.
|
| 6 |
+
|
| 7 |
+

|
| 8 |
+
|
| 9 |
+
## Supported Methods
|
| 10 |
+
+ [BiC (CVPR 2019)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/bic/README.md)
|
| 11 |
+
+ [EWC (PNAS 2017)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/ewc/README.md)
|
| 12 |
+
+ [iCaRL (CVPR2017)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/icarl/README.md)
|
| 13 |
+
+ [LUCIR (CVPR 2019)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/lucir/README.md)
|
| 14 |
+
+ [LwF (ECCV 2016)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/lwf/README.md)
|
| 15 |
+
+ [WA (CVPR 2020)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/wa/README.md)
|
| 16 |
+
+ [OCM (PMLR 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/ocm/README.md)
|
| 17 |
+
+ [DER (CVPR 2021)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/der/README.md)
|
| 18 |
+
+ [ERACE,ERAML (ICLR 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/erace,eraml/README.md)
|
| 19 |
+
+ [L2P (CVPR 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/l2p/README.md)
|
| 20 |
+
+ [DualPrompt (ECCV 2022)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/dualprompt/README.md)
|
| 21 |
+
+ [CodaPrompt (CVPR 2023)](https://github.com/RL-VIG/LibContinual/blob/master/reproduce/codaprompt/README.md)
|
| 22 |
+
|
| 23 |
+
## Quick Installation
|
| 24 |
+
(待文档部分完成) <br>
|
| 25 |
+
请参考文档中[`安装`](https://github.com/RL-VIG/LibContinual/blob/master/docs/tutorials/install.md)部分。 <br>
|
| 26 |
+
完整文档:[`./docs`](https://github.com/RL-VIG/LibContinual/tree/master/docs)
|
| 27 |
+
|
| 28 |
+
## Datasets
|
| 29 |
+
[`CIFAR-100`](https://drive.google.com/drive/folders/1EL46LQ3ww-F1NVTwFDPIg-nO198cUqWm?usp=sharing), `miniImageNet(todo)` <br>
|
| 30 |
+
|
| 31 |
+
将对应数据集的压缩包解压至指定路径:
|
| 32 |
+
```
|
| 33 |
+
unzip cifar100.zip -d /path/to/your/dataset
|
| 34 |
+
```
|
| 35 |
+
修改.yaml文件的data_root参数:
|
| 36 |
+
```
|
| 37 |
+
data_root: /path/to/your/dataset
|
| 38 |
+
```
|
| 39 |
+
如何添加自定义数据集请参考文档:[`添加自定义数据集`](https://github.com/RL-VIG/LibContinual/blob/master/docs/tutorials/zh/data_module_zh.md)
|
| 40 |
+
|
| 41 |
+
## Get Start
|
| 42 |
+
|
| 43 |
+
当您已经完成`Quick Installation`和`Datasets`后,我们以`LUCIR`方法为例展示如何使用`LibContinual`。
|
| 44 |
+
- **Step1**: 修改`run_trainer.py`中`Config`参数为`./config/lucir.yaml`
|
| 45 |
+
- **Step2**:配置`./config/lucir.yaml`文件中的参数,各参数含义请参考[配置文件](https://github.com/RL-VIG/LibContinual/blob/master/docs/tutorials/config_file.md)
|
| 46 |
+
- **Step3**: 运行代码`python run_trainer.py`
|
| 47 |
+
- **Step4**:日志保存在配置文件中`save_path`路径下
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
## Acknowledgement
|
| 51 |
+
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.
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
在本项目开发过程中参考了下列仓库:
|
| 55 |
+
|
| 56 |
+
- [FACIL](https://github.com/mmasana/FACIL)
|
| 57 |
+
- [PyCIL](https://github.com/G-U-N/PyCIL)
|
| 58 |
+
|
| 59 |
+
在我们的工作中参考了这些仓库中有用的模块。我们深深感谢这些仓库的作者们。
|
| 60 |
+
|
| 61 |
+
## License
|
| 62 |
+
This project is licensed under the MIT License. See LICENSE for more details.
|
config/InfLoRA.yaml
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
save_path : ""
|
| 2 |
+
|
| 3 |
+
image_size: 224
|
| 4 |
+
save_path: ./
|
| 5 |
+
init_cls_num: 10
|
| 6 |
+
inc_cls_num: 10
|
| 7 |
+
task_num: 10
|
| 8 |
+
val_per_epoch: 20
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
epoch: 20
|
| 12 |
+
n_gpu: 1
|
| 13 |
+
seed: 2
|
| 14 |
+
|
| 15 |
+
shuffle: false
|
| 16 |
+
|
| 17 |
+
batch_size: 128
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
optimizer:
|
| 21 |
+
name: Adam
|
| 22 |
+
kwargs:
|
| 23 |
+
lr: 0.0005
|
| 24 |
+
weight_decay: 0
|
| 25 |
+
betas: [0.9, 0.999]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
lr_scheduler:
|
| 31 |
+
name: CosineSchedule
|
| 32 |
+
kwargs:
|
| 33 |
+
K: 20
|
| 34 |
+
|
| 35 |
+
backbone:
|
| 36 |
+
name: SiNet_vit
|
| 37 |
+
kwargs:
|
| 38 |
+
total_sessions: 10
|
| 39 |
+
rank: 10
|
| 40 |
+
init_cls: 10
|
| 41 |
+
embd_dim: 768
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
buffer:
|
| 45 |
+
name: LinearBuffer
|
| 46 |
+
kwargs:
|
| 47 |
+
buffer_size: 0
|
| 48 |
+
batch_size: 128
|
| 49 |
+
strategy: herding # random, equal_random, reservoir, herding
|
| 50 |
+
|
| 51 |
+
classifier:
|
| 52 |
+
name: InfLoRA
|
| 53 |
+
kwargs:
|
| 54 |
+
feat_dim: 64
|
| 55 |
+
num_class: 100
|
| 56 |
+
inc_cls_num: 10
|
| 57 |
+
# device: 0
|
| 58 |
+
lame: 1.0
|
| 59 |
+
lamb: 0.95
|
| 60 |
+
total_sessions: 10
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
|
config/InfLoRA_opt-vit-cifar100-b10-10-10.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset cifar100
|
| 2 |
+
init_cls_num: &init_cls_num 10
|
| 3 |
+
inc_cls_num: &inc_cls_num 10
|
| 4 |
+
total_cls_num: &total_cls_num 100
|
| 5 |
+
task_num: &task_num 10
|
| 6 |
+
image_size: &image_size 224
|
| 7 |
+
|
| 8 |
+
dataset: *dataset
|
| 9 |
+
init_cls_num: *init_cls_num
|
| 10 |
+
inc_cls_num: *inc_cls_num
|
| 11 |
+
total_cls_num: *total_cls_num
|
| 12 |
+
task_num: *task_num
|
| 13 |
+
|
| 14 |
+
epoch: 20
|
| 15 |
+
val_per_epoch: 20
|
| 16 |
+
|
| 17 |
+
batch_size: 128
|
| 18 |
+
|
| 19 |
+
setting: task-agnostic
|
| 20 |
+
seed: 1993
|
| 21 |
+
|
| 22 |
+
testing_times: 1
|
| 23 |
+
|
| 24 |
+
train_trfms:
|
| 25 |
+
- RandomResizedCrop:
|
| 26 |
+
size: *image_size
|
| 27 |
+
- RandomHorizontalFlip: {}
|
| 28 |
+
- ToTensor: {}
|
| 29 |
+
- Normalize:
|
| 30 |
+
mean: [0., 0., 0.]
|
| 31 |
+
std: [1., 1., 1.]
|
| 32 |
+
|
| 33 |
+
test_trfms:
|
| 34 |
+
- Resize:
|
| 35 |
+
size: *image_size
|
| 36 |
+
- ToTensor: {}
|
| 37 |
+
- Normalize:
|
| 38 |
+
mean: [0., 0., 0.]
|
| 39 |
+
std: [1., 1., 1.]
|
| 40 |
+
|
| 41 |
+
optimizer:
|
| 42 |
+
name: Adam
|
| 43 |
+
kwargs:
|
| 44 |
+
lr: 0.0005
|
| 45 |
+
weight_decay: 0
|
| 46 |
+
betas: [0.9, 0.999]
|
| 47 |
+
|
| 48 |
+
lr_scheduler:
|
| 49 |
+
name: CosineSchedule
|
| 50 |
+
kwargs:
|
| 51 |
+
K: 20
|
| 52 |
+
|
| 53 |
+
backbone:
|
| 54 |
+
name: vit_pt_imnet
|
| 55 |
+
kwargs:
|
| 56 |
+
pretrained: True
|
| 57 |
+
model_name : vit_base_patch16_224_in21k
|
| 58 |
+
attn_layer: MultiHeadAttention_LoRA
|
| 59 |
+
lora_rank: 10
|
| 60 |
+
|
| 61 |
+
classifier:
|
| 62 |
+
name: InfLoRA_OPT
|
| 63 |
+
kwargs:
|
| 64 |
+
use_ca: False
|
| 65 |
+
dataset: *dataset
|
| 66 |
+
init_cls_num: *init_cls_num
|
| 67 |
+
inc_cls_num: *inc_cls_num
|
| 68 |
+
task_num: *task_num
|
| 69 |
+
lame: 1.0
|
| 70 |
+
lamb: 0.95
|
| 71 |
+
embd_dim: 768
|
| 72 |
+
|
config/InfLoRA_opt-vit-imagenetr-b20-20-10.yaml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset "imagenet-r"
|
| 3 |
+
data_root: "/home/lvqiexuan/temp_data/imagenet-r/"
|
| 4 |
+
|
| 5 |
+
init_cls_num: &init_cls_num 20
|
| 6 |
+
inc_cls_num: &inc_cls_num 20
|
| 7 |
+
task_num: &task_num 10
|
| 8 |
+
image_size: &image_size 224
|
| 9 |
+
epoch: &epoch 20
|
| 10 |
+
|
| 11 |
+
dataset: *dataset
|
| 12 |
+
task_num: *task_num
|
| 13 |
+
init_cls_num: *init_cls_num
|
| 14 |
+
inc_cls_num: *inc_cls_num
|
| 15 |
+
epoch: *epoch
|
| 16 |
+
val_per_epoch: *epoch
|
| 17 |
+
|
| 18 |
+
workers: 24
|
| 19 |
+
|
| 20 |
+
seed: 42
|
| 21 |
+
|
| 22 |
+
batch_size: 128
|
| 23 |
+
|
| 24 |
+
setting: task-agnostic
|
| 25 |
+
|
| 26 |
+
testing_times: 1
|
| 27 |
+
|
| 28 |
+
train_trfms:
|
| 29 |
+
- RandomResizedCrop:
|
| 30 |
+
size: *image_size
|
| 31 |
+
scale: [0.05, 1.0]
|
| 32 |
+
ratio: [0.75, 1.333]
|
| 33 |
+
- RandomHorizontalFlip:
|
| 34 |
+
p: 0.5
|
| 35 |
+
- ToTensor: {}
|
| 36 |
+
|
| 37 |
+
test_trfms:
|
| 38 |
+
- Resize:
|
| 39 |
+
size: 256
|
| 40 |
+
interpolation: BICUBIC
|
| 41 |
+
- CenterCrop:
|
| 42 |
+
size: *image_size
|
| 43 |
+
- ToTensor: {}
|
| 44 |
+
|
| 45 |
+
optimizer:
|
| 46 |
+
name: SGD
|
| 47 |
+
kwargs:
|
| 48 |
+
lr: 8e-3
|
| 49 |
+
momentum: 0.9
|
| 50 |
+
|
| 51 |
+
lr_scheduler:
|
| 52 |
+
name: Constant
|
| 53 |
+
|
| 54 |
+
backbone:
|
| 55 |
+
name: vit_pt_imnet
|
| 56 |
+
kwargs:
|
| 57 |
+
pretrained: True
|
| 58 |
+
model_name : vit_base_patch16_224_in21k # vit_base_patch16_224
|
| 59 |
+
attn_layer: MultiHeadAttention_LoRA
|
| 60 |
+
lora_rank: 10
|
| 61 |
+
|
| 62 |
+
classifier:
|
| 63 |
+
name: InfLoRA_OPT
|
| 64 |
+
kwargs:
|
| 65 |
+
use_ca: False
|
| 66 |
+
dataset: *dataset
|
| 67 |
+
init_cls_num: *init_cls_num
|
| 68 |
+
inc_cls_num: *inc_cls_num
|
| 69 |
+
task_num: *task_num
|
| 70 |
+
lame: 1.0
|
| 71 |
+
lamb: 0.95
|
| 72 |
+
embd_dim: 768
|
| 73 |
+
|
config/InfLoRA_opt.yaml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset cifar100
|
| 2 |
+
init_cls_num: &init_cls_num 10
|
| 3 |
+
inc_cls_num: &inc_cls_num 10
|
| 4 |
+
total_cls_num: &total_cls_num 100
|
| 5 |
+
task_num: &task_num 10
|
| 6 |
+
image_size: &image_size 224
|
| 7 |
+
|
| 8 |
+
dataset: *dataset
|
| 9 |
+
init_cls_num: *init_cls_num
|
| 10 |
+
inc_cls_num: *inc_cls_num
|
| 11 |
+
total_cls_num: *total_cls_num
|
| 12 |
+
task_num: *task_num
|
| 13 |
+
|
| 14 |
+
epoch: 20
|
| 15 |
+
val_per_epoch: 20
|
| 16 |
+
|
| 17 |
+
batch_size: 128 # 128
|
| 18 |
+
|
| 19 |
+
setting: task-agnostic
|
| 20 |
+
|
| 21 |
+
testing_times: 5
|
| 22 |
+
|
| 23 |
+
train_trfms:
|
| 24 |
+
- RandomResizedCrop:
|
| 25 |
+
size: *image_size
|
| 26 |
+
- RandomHorizontalFlip: {}
|
| 27 |
+
- ToTensor: {}
|
| 28 |
+
- Normalize:
|
| 29 |
+
mean: [0., 0., 0.]
|
| 30 |
+
std: [1., 1., 1.]
|
| 31 |
+
|
| 32 |
+
test_trfms:
|
| 33 |
+
- Resize:
|
| 34 |
+
size: *image_size
|
| 35 |
+
- ToTensor: {}
|
| 36 |
+
- Normalize:
|
| 37 |
+
mean: [0., 0., 0.]
|
| 38 |
+
std: [1., 1., 1.]
|
| 39 |
+
|
| 40 |
+
optimizer:
|
| 41 |
+
name: Adam
|
| 42 |
+
kwargs:
|
| 43 |
+
lr: 0.0005
|
| 44 |
+
weight_decay: 0
|
| 45 |
+
betas: [0.9, 0.999]
|
| 46 |
+
|
| 47 |
+
lr_scheduler:
|
| 48 |
+
name: CosineSchedule
|
| 49 |
+
kwargs:
|
| 50 |
+
K: 20
|
| 51 |
+
|
| 52 |
+
backbone:
|
| 53 |
+
name: vit_pt_imnet
|
| 54 |
+
kwargs:
|
| 55 |
+
pretrained: True
|
| 56 |
+
model_name : vit_base_patch16_224_in21k
|
| 57 |
+
attn_layer: MultiHeadAttention_LoRA
|
| 58 |
+
lora_rank: 10
|
| 59 |
+
|
| 60 |
+
classifier:
|
| 61 |
+
name: InfLoRA_OPT
|
| 62 |
+
kwargs:
|
| 63 |
+
use_ca: False
|
| 64 |
+
dataset: *dataset
|
| 65 |
+
init_cls_num: *init_cls_num
|
| 66 |
+
inc_cls_num: *inc_cls_num
|
| 67 |
+
task_num: *task_num
|
| 68 |
+
lame: 1.0
|
| 69 |
+
lamb: 0.95
|
| 70 |
+
embd_dim: 768
|
| 71 |
+
|
config/InfLoRA_opt_clip.yaml
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset cifar100
|
| 2 |
+
init_cls_num: &init_cls_num 20
|
| 3 |
+
inc_cls_num: &inc_cls_num 20
|
| 4 |
+
total_cls_num: &total_cls_num 100
|
| 5 |
+
task_num: &task_num 5
|
| 6 |
+
image_size: &image_size 224
|
| 7 |
+
|
| 8 |
+
dataset: *dataset
|
| 9 |
+
init_cls_num: *init_cls_num
|
| 10 |
+
inc_cls_num: *inc_cls_num
|
| 11 |
+
total_cls_num: *total_cls_num
|
| 12 |
+
task_num: *task_num
|
| 13 |
+
|
| 14 |
+
epoch: 20 # 20
|
| 15 |
+
val_per_epoch: 20
|
| 16 |
+
|
| 17 |
+
batch_size: 128 # 128
|
| 18 |
+
|
| 19 |
+
setting: task-agnostic
|
| 20 |
+
|
| 21 |
+
testing_times: 5
|
| 22 |
+
|
| 23 |
+
train_trfms:
|
| 24 |
+
- RandomResizedCrop:
|
| 25 |
+
size: *image_size
|
| 26 |
+
- RandomHorizontalFlip: {}
|
| 27 |
+
- ToTensor: {}
|
| 28 |
+
- Normalize:
|
| 29 |
+
mean: [0., 0., 0.]
|
| 30 |
+
std: [1., 1., 1.]
|
| 31 |
+
|
| 32 |
+
test_trfms:
|
| 33 |
+
- Resize:
|
| 34 |
+
size: *image_size
|
| 35 |
+
- ToTensor: {}
|
| 36 |
+
- Normalize:
|
| 37 |
+
mean: [0., 0., 0.]
|
| 38 |
+
std: [1., 1., 1.]
|
| 39 |
+
|
| 40 |
+
optimizer:
|
| 41 |
+
name: Adam
|
| 42 |
+
kwargs:
|
| 43 |
+
lr: 0.0005
|
| 44 |
+
weight_decay: 0
|
| 45 |
+
betas: [0.9, 0.999]
|
| 46 |
+
|
| 47 |
+
lr_scheduler:
|
| 48 |
+
name: CosineSchedule
|
| 49 |
+
kwargs:
|
| 50 |
+
K: 20
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
backbone:
|
| 54 |
+
name: clip
|
| 55 |
+
kwargs:
|
| 56 |
+
pretrained : True
|
| 57 |
+
model_name : ViT-B/16
|
| 58 |
+
experts_num: 0
|
| 59 |
+
act_layer: QuickGELU
|
| 60 |
+
norm_layer: LayerNorm
|
| 61 |
+
attn_layer: MultiHeadAttention_LoRA
|
| 62 |
+
|
| 63 |
+
classifier:
|
| 64 |
+
name: InfLoRA_OPT
|
| 65 |
+
kwargs:
|
| 66 |
+
use_ca: False
|
| 67 |
+
dataset: *dataset
|
| 68 |
+
init_cls_num: *init_cls_num
|
| 69 |
+
inc_cls_num: *inc_cls_num
|
| 70 |
+
task_num: *task_num
|
| 71 |
+
lame: 1.0
|
| 72 |
+
lamb: 0.95
|
| 73 |
+
embd_dim: 768
|
| 74 |
+
prompt_template : "a bad photo of a {}." # For CLIP
|
| 75 |
+
visual_only: True # For CLIP, apply lora to only visual encoder or visual and text encoder
|
config/PRAKA.yaml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset cifar100
|
| 3 |
+
init_cls_num: &init_cls_num 50 # 50 50
|
| 4 |
+
inc_cls_num: &inc_cls_num 10 # 5 10
|
| 5 |
+
total_cls_num: &total_cls_num 100
|
| 6 |
+
task_num: &task_num 6 # 11 6
|
| 7 |
+
image_size: &image_size 32
|
| 8 |
+
|
| 9 |
+
image_size: *image_size
|
| 10 |
+
# data
|
| 11 |
+
init_cls_num: *init_cls_num
|
| 12 |
+
inc_cls_num: *inc_cls_num
|
| 13 |
+
task_num: *task_num
|
| 14 |
+
batch_size: 128 # 128
|
| 15 |
+
epoch: 100 # 100
|
| 16 |
+
|
| 17 |
+
val_per_epoch: 100
|
| 18 |
+
seed: 2
|
| 19 |
+
|
| 20 |
+
testing_times: 10 # 10
|
| 21 |
+
|
| 22 |
+
train_trfms:
|
| 23 |
+
- RandomCrop:
|
| 24 |
+
size: [*image_size, *image_size]
|
| 25 |
+
padding: 4
|
| 26 |
+
- RandomHorizontalFlip:
|
| 27 |
+
p: 0.5
|
| 28 |
+
- ColorJitter:
|
| 29 |
+
brightness: 0.24705882352941178
|
| 30 |
+
- ToTensor: {}
|
| 31 |
+
- Normalize:
|
| 32 |
+
mean: [0.5071, 0.4866, 0.4409] # don't change
|
| 33 |
+
std: [0.2675, 0.2565, 0.2761] # don't change
|
| 34 |
+
#mean: [0.5071, 0.4867, 0.4408]
|
| 35 |
+
#std: [0.2675, 0.2565, 0.2761]
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
test_trfms:
|
| 39 |
+
- ToTensor: {}
|
| 40 |
+
- Normalize:
|
| 41 |
+
mean: [0.5071, 0.4866, 0.4409] # don't change
|
| 42 |
+
std: [0.2675, 0.2565, 0.2761] # don't change
|
| 43 |
+
#mean: [0.5071, 0.4867, 0.4408]
|
| 44 |
+
#std: [0.2675, 0.2565, 0.2761]
|
| 45 |
+
|
| 46 |
+
optimizer:
|
| 47 |
+
name: Adam
|
| 48 |
+
kwargs:
|
| 49 |
+
lr: 0.001
|
| 50 |
+
#betas: [0.9, 0.999]
|
| 51 |
+
weight_decay: 2e-4
|
| 52 |
+
#eps: 1e-8
|
| 53 |
+
|
| 54 |
+
lr_scheduler:
|
| 55 |
+
name: CosineAnnealingLR
|
| 56 |
+
kwargs:
|
| 57 |
+
T_max: 32
|
| 58 |
+
|
| 59 |
+
backbone:
|
| 60 |
+
name: resnet18_cbam
|
| 61 |
+
kwargs:
|
| 62 |
+
num_classes: *total_cls_num
|
| 63 |
+
args:
|
| 64 |
+
dataset: *dataset
|
| 65 |
+
|
| 66 |
+
classifier:
|
| 67 |
+
name: PRAKA
|
| 68 |
+
kwargs:
|
| 69 |
+
num_class: *total_cls_num
|
| 70 |
+
init_cls_num: *init_cls_num
|
| 71 |
+
inc_cls_num: *inc_cls_num
|
| 72 |
+
feat_dim: 512
|
| 73 |
+
|
| 74 |
+
log_root: log
|
| 75 |
+
total_nc: *total_cls_num
|
| 76 |
+
protoAug_weight: 15.0
|
| 77 |
+
kd_weight: 15.0
|
| 78 |
+
temp: 0.1
|
config/api_til-alexnet-cifar100-b5-5-20.yaml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
init_cls_num: &init_cls_num 5
|
| 2 |
+
inc_cls_num: &inc_cls_num 5
|
| 3 |
+
total_cls_num: &total_cls_num 100
|
| 4 |
+
task_num: &task_num 20
|
| 5 |
+
|
| 6 |
+
task_num: *task_num
|
| 7 |
+
init_cls_num: *init_cls_num
|
| 8 |
+
inc_cls_num: *inc_cls_num
|
| 9 |
+
total_cls_num: *total_cls_num
|
| 10 |
+
epoch: 200
|
| 11 |
+
batch_size: 64
|
| 12 |
+
val_per_epoch: 200
|
| 13 |
+
|
| 14 |
+
setting: task-aware # task-aware
|
| 15 |
+
seed: 2
|
| 16 |
+
testing_times: 1 # Don't set too high, it will take eternity
|
| 17 |
+
|
| 18 |
+
optimizer:
|
| 19 |
+
name: SGD
|
| 20 |
+
kwargs:
|
| 21 |
+
lr: 0.01
|
| 22 |
+
|
| 23 |
+
lr_scheduler:
|
| 24 |
+
name: PatienceSchedule
|
| 25 |
+
kwargs:
|
| 26 |
+
patience: 6
|
| 27 |
+
factor: 2
|
| 28 |
+
stopping_lr: 1e-5
|
| 29 |
+
|
| 30 |
+
backbone:
|
| 31 |
+
name: AlexNet_API
|
| 32 |
+
kwargs:
|
| 33 |
+
|
| 34 |
+
classifier:
|
| 35 |
+
name: API
|
| 36 |
+
kwargs:
|
| 37 |
+
init_cls_num: *init_cls_num
|
| 38 |
+
inc_cls_num: *inc_cls_num
|
| 39 |
+
task_num: *task_num
|
config/backbones/CifarResnet.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone:
|
| 2 |
+
name: CifarResnet
|
| 3 |
+
kwargs:
|
| 4 |
+
keep_prob: 0.0
|
| 5 |
+
avg_pool: True
|
| 6 |
+
is_flatten: True
|
| 7 |
+
maxpool_last2: True
|
config/backbones/resnet12.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone:
|
| 2 |
+
name: resnet12
|
| 3 |
+
kwargs:
|
| 4 |
+
keep_prob: 0.0
|
| 5 |
+
avg_pool: True
|
| 6 |
+
is_flatten: True
|
| 7 |
+
maxpool_last2: True
|
config/codaprompt.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset cifar100
|
| 3 |
+
init_cls_num: &init_cls_num 10
|
| 4 |
+
inc_cls_num: &inc_cls_num 10
|
| 5 |
+
total_cls_num: &total_cls_num 100
|
| 6 |
+
task_num: &task_num 10
|
| 7 |
+
image_size: &image_size 224
|
| 8 |
+
|
| 9 |
+
image_size: *image_size
|
| 10 |
+
init_cls_num: *init_cls_num
|
| 11 |
+
inc_cls_num: *inc_cls_num
|
| 12 |
+
task_num: *task_num
|
| 13 |
+
|
| 14 |
+
epoch: 20
|
| 15 |
+
val_per_epoch: 20
|
| 16 |
+
|
| 17 |
+
batch_size: 128
|
| 18 |
+
|
| 19 |
+
train_trfms:
|
| 20 |
+
- RandomResizedCrop:
|
| 21 |
+
size: *image_size
|
| 22 |
+
- RandomHorizontalFlip: {}
|
| 23 |
+
- ToTensor: {}
|
| 24 |
+
- Normalize:
|
| 25 |
+
mean: [0., 0., 0.]
|
| 26 |
+
std: [1., 1., 1.]
|
| 27 |
+
|
| 28 |
+
test_trfms:
|
| 29 |
+
- Resize:
|
| 30 |
+
size: *image_size
|
| 31 |
+
- ToTensor: {}
|
| 32 |
+
- Normalize:
|
| 33 |
+
mean: [0., 0., 0.]
|
| 34 |
+
std: [1., 1., 1.]
|
| 35 |
+
|
| 36 |
+
optimizer:
|
| 37 |
+
name: Adam
|
| 38 |
+
kwargs:
|
| 39 |
+
lr: 0.001
|
| 40 |
+
betas: [0.9, 0.999]
|
| 41 |
+
weight_decay: 0
|
| 42 |
+
|
| 43 |
+
#lr_scheduler:
|
| 44 |
+
# name: MultiStepLR
|
| 45 |
+
# kwargs:
|
| 46 |
+
# gamma: 0.1
|
| 47 |
+
# milestones: [80, 120]
|
| 48 |
+
|
| 49 |
+
lr_scheduler:
|
| 50 |
+
name: CosineSchedule
|
| 51 |
+
kwargs:
|
| 52 |
+
K: 20
|
| 53 |
+
|
| 54 |
+
backbone:
|
| 55 |
+
name: vit_pt_imnet
|
| 56 |
+
kwargs:
|
| 57 |
+
num_classes: *total_cls_num
|
| 58 |
+
pretrained: true
|
| 59 |
+
model_name : vit_base_patch16_224
|
| 60 |
+
|
| 61 |
+
classifier:
|
| 62 |
+
name: CodaPrompt
|
| 63 |
+
kwargs:
|
| 64 |
+
num_class: *total_cls_num
|
| 65 |
+
task_num: *task_num
|
| 66 |
+
init_cls_num: *init_cls_num
|
| 67 |
+
inc_cls_num: *inc_cls_num
|
| 68 |
+
feat_dim: 768
|
| 69 |
+
prompt_length: 8
|
| 70 |
+
pool_size: 100
|
| 71 |
+
mu: 0.0
|
| 72 |
+
|
config/dap.yaml
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
|
| 6 |
+
data_root: data/cifar100/
|
| 7 |
+
image_size: 224
|
| 8 |
+
save_path: ./
|
| 9 |
+
init_cls_num: 10
|
| 10 |
+
inc_cls_num: 10
|
| 11 |
+
task_num: 10
|
| 12 |
+
|
| 13 |
+
epoch: 5
|
| 14 |
+
n_gpu: 1
|
| 15 |
+
seed: 42
|
| 16 |
+
val_per_epoch: 5
|
| 17 |
+
|
| 18 |
+
imb_type: exp_re
|
| 19 |
+
imb_factor: 0.002
|
| 20 |
+
shuffle: false
|
| 21 |
+
|
| 22 |
+
batch_size: 64
|
| 23 |
+
|
| 24 |
+
optimizer:
|
| 25 |
+
name: Adam
|
| 26 |
+
kwargs:
|
| 27 |
+
lr: 0.01
|
| 28 |
+
eps: 1e-8
|
| 29 |
+
weight_decay: 0.0
|
| 30 |
+
betas: [0.9, 0.9]
|
| 31 |
+
|
| 32 |
+
lr_scheduler:
|
| 33 |
+
name: MultiStepLR
|
| 34 |
+
kwargs:
|
| 35 |
+
gamma: 0.1
|
| 36 |
+
milestones: [80, 120]
|
| 37 |
+
|
| 38 |
+
backbone:
|
| 39 |
+
name: vit_pt_imnet_dap
|
| 40 |
+
kwargs:
|
| 41 |
+
pretrained: true
|
| 42 |
+
model_name: vit_base_patch16_224_dap
|
| 43 |
+
num_classes: 100
|
| 44 |
+
drop: 0.0
|
| 45 |
+
drop_path: 0.0
|
| 46 |
+
length: 5
|
| 47 |
+
embedding_key: cls
|
| 48 |
+
prompt_key_init: uniform
|
| 49 |
+
prompt_pool: true
|
| 50 |
+
prompt_key: true
|
| 51 |
+
size: 10
|
| 52 |
+
top_k: 5
|
| 53 |
+
batchwise_prompt: true
|
| 54 |
+
head_type: prompt
|
| 55 |
+
use_prompt_mask: false
|
| 56 |
+
|
| 57 |
+
classifier:
|
| 58 |
+
name: DAP
|
| 59 |
+
kwargs:
|
| 60 |
+
num_class: 100
|
| 61 |
+
feat_dim: 768
|
| 62 |
+
task_num: 10
|
| 63 |
+
init_cls_num: 10
|
| 64 |
+
inc_cls_num: 10
|
| 65 |
+
train_mask: true
|
| 66 |
+
task_inc: false
|
| 67 |
+
freeze:
|
| 68 |
+
- blocks
|
| 69 |
+
- patch_embed
|
| 70 |
+
- cls_token
|
| 71 |
+
- norm
|
| 72 |
+
- pos_embed
|
| 73 |
+
pull_constraint: true
|
| 74 |
+
pull_constraint_coeff: 0.1
|
config/der.yaml
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
- headers/optimizer.yaml
|
| 6 |
+
- backbones/resnet12.yaml
|
| 7 |
+
|
| 8 |
+
image_size: 32
|
| 9 |
+
|
| 10 |
+
save_path: ./
|
| 11 |
+
# data
|
| 12 |
+
init_cls_num: 10
|
| 13 |
+
inc_cls_num: 10
|
| 14 |
+
task_num: 10
|
| 15 |
+
|
| 16 |
+
# init_epoch can be none
|
| 17 |
+
init_epoch: 170 #200
|
| 18 |
+
epoch: 170 #170
|
| 19 |
+
device_ids: 2
|
| 20 |
+
n_gpu: 1
|
| 21 |
+
val_per_epoch: 170
|
| 22 |
+
|
| 23 |
+
batch_size: 128
|
| 24 |
+
|
| 25 |
+
optimizer:
|
| 26 |
+
name: SGD
|
| 27 |
+
kwargs:
|
| 28 |
+
momentum: 0.9
|
| 29 |
+
lr: 0.1
|
| 30 |
+
weight_decay: 2e-4
|
| 31 |
+
|
| 32 |
+
lr_scheduler:
|
| 33 |
+
name: MultiStepLR
|
| 34 |
+
kwargs:
|
| 35 |
+
gamma: 0.1
|
| 36 |
+
milestones: [70, 100, 150]
|
| 37 |
+
|
| 38 |
+
backbone:
|
| 39 |
+
name: resnet18
|
| 40 |
+
kwargs:
|
| 41 |
+
num_classes: 10
|
| 42 |
+
args:
|
| 43 |
+
dataset: cifar100
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
buffer:
|
| 47 |
+
name: LinearBuffer
|
| 48 |
+
kwargs:
|
| 49 |
+
buffer_size: 0 # 2000
|
| 50 |
+
batch_size: 32
|
| 51 |
+
strategy: random # random, equal_random, reservoir, herding
|
| 52 |
+
|
| 53 |
+
classifier:
|
| 54 |
+
name: DER
|
| 55 |
+
kwargs:
|
| 56 |
+
num_class: 100
|
| 57 |
+
feat_dim: 512
|
| 58 |
+
init_cls_num: 10
|
| 59 |
+
inc_cls_num: 10
|
config/dmnsp.yaml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
init_cls_num: &init_cls_num 5
|
| 3 |
+
inc_cls_num: &inc_cls_num 5
|
| 4 |
+
total_cls_num: &total_cls_num 100
|
| 5 |
+
task_num: &task_num 20
|
| 6 |
+
|
| 7 |
+
image_size: &image_size 224
|
| 8 |
+
|
| 9 |
+
task_num: *task_num
|
| 10 |
+
init_cls_num: *init_cls_num
|
| 11 |
+
inc_cls_num: *inc_cls_num
|
| 12 |
+
total_cls_num: *total_cls_num
|
| 13 |
+
epoch: 4
|
| 14 |
+
val_per_epoch: 4
|
| 15 |
+
|
| 16 |
+
train_batch_size: 128
|
| 17 |
+
test_batch_size: 64
|
| 18 |
+
|
| 19 |
+
testing_times: 10
|
| 20 |
+
|
| 21 |
+
# setting: task-agnostic # class-incremental settings
|
| 22 |
+
setting: task-aware # task-incremental settings
|
| 23 |
+
|
| 24 |
+
train_trfms:
|
| 25 |
+
- RandomResizedCrop :
|
| 26 |
+
size: *image_size
|
| 27 |
+
scale: [0.9, 1.0]
|
| 28 |
+
interpolation: BICUBIC
|
| 29 |
+
- ToTensor: {}
|
| 30 |
+
- Normalize:
|
| 31 |
+
mean: [0.48145466, 0.4578275, 0.40821073]
|
| 32 |
+
std: [0.26862954, 0.26130258, 0.27577711]
|
| 33 |
+
|
| 34 |
+
test_trfms:
|
| 35 |
+
- Resize :
|
| 36 |
+
size: *image_size
|
| 37 |
+
interpolation: BICUBIC
|
| 38 |
+
- ToTensor: {}
|
| 39 |
+
- Normalize:
|
| 40 |
+
mean: [0.48145466, 0.4578275, 0.40821073]
|
| 41 |
+
std: [0.26862954, 0.26130258, 0.27577711]
|
| 42 |
+
|
| 43 |
+
optimizer:
|
| 44 |
+
name: AdamW
|
| 45 |
+
kwargs:
|
| 46 |
+
lr: 1e-3
|
| 47 |
+
weight_decay: 0.
|
| 48 |
+
|
| 49 |
+
lr_scheduler:
|
| 50 |
+
name: CosineAnnealingWarmUp
|
| 51 |
+
kwargs:
|
| 52 |
+
T_max: 0 # Will be replaced in trainter.py with epoch * len(dataloader)
|
| 53 |
+
warmup_length: 30
|
| 54 |
+
|
| 55 |
+
backbone:
|
| 56 |
+
name: clip
|
| 57 |
+
kwargs:
|
| 58 |
+
model_name : ViT-B/16
|
| 59 |
+
pretrained : True
|
| 60 |
+
block_layer: ResidualAttentionBlock_MLP
|
| 61 |
+
act_layer: QuickGELU
|
| 62 |
+
norm_layer: LayerNorm
|
| 63 |
+
|
| 64 |
+
classifier:
|
| 65 |
+
name: DMNSP
|
| 66 |
+
kwargs:
|
| 67 |
+
init_cls_num: *init_cls_num
|
| 68 |
+
inc_cls_num: *inc_cls_num
|
| 69 |
+
prompt_template : "a bad photo of a {}."
|
| 70 |
+
label_smoothing: 0.
|
| 71 |
+
lamda_scale: 30
|
config/dmnsp_imgnr.yaml
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset "imagenet-r"
|
| 3 |
+
data_root: "/home/lvqiexuan/temp_data/imagenet-r/"
|
| 4 |
+
|
| 5 |
+
init_cls_num: &init_cls_num 10
|
| 6 |
+
inc_cls_num: &inc_cls_num 10
|
| 7 |
+
total_cls_num: &total_cls_num 200
|
| 8 |
+
task_num: &task_num 20
|
| 9 |
+
image_size: &image_size 224
|
| 10 |
+
|
| 11 |
+
dataset: *dataset
|
| 12 |
+
task_num: *task_num
|
| 13 |
+
init_cls_num: *init_cls_num
|
| 14 |
+
inc_cls_num: *inc_cls_num
|
| 15 |
+
total_cls_num: *total_cls_num
|
| 16 |
+
epoch: 4
|
| 17 |
+
val_per_epoch: 4
|
| 18 |
+
|
| 19 |
+
train_batch_size: 128
|
| 20 |
+
test_batch_size: 64
|
| 21 |
+
|
| 22 |
+
testing_times: 10
|
| 23 |
+
|
| 24 |
+
#setting: task-agnostic
|
| 25 |
+
setting: task-aware
|
| 26 |
+
|
| 27 |
+
optimizer:
|
| 28 |
+
name: AdamW
|
| 29 |
+
kwargs:
|
| 30 |
+
lr: 1e-3
|
| 31 |
+
weight_decay: 0.
|
| 32 |
+
|
| 33 |
+
lr_scheduler:
|
| 34 |
+
name: CosineAnnealingWarmUp
|
| 35 |
+
kwargs:
|
| 36 |
+
T_max: 0 # Will be replaced in trainter.py with epoch * len(dataloader)
|
| 37 |
+
warmup_length: 30
|
| 38 |
+
|
| 39 |
+
backbone:
|
| 40 |
+
name: clip
|
| 41 |
+
kwargs:
|
| 42 |
+
model_name : ViT-B/16
|
| 43 |
+
pretrained : True
|
| 44 |
+
block_layer: ResidualAttentionBlock_MLP
|
| 45 |
+
act_layer: QuickGELU
|
| 46 |
+
norm_layer: LayerNorm
|
| 47 |
+
|
| 48 |
+
classifier:
|
| 49 |
+
name: DMNSP
|
| 50 |
+
kwargs:
|
| 51 |
+
init_cls_num: *init_cls_num
|
| 52 |
+
inc_cls_num: *inc_cls_num
|
| 53 |
+
prompt_template : "a bad photo of a {}."
|
| 54 |
+
label_smoothing: 0.
|
| 55 |
+
lamda_scale: 30
|
config/dmnsp_vit.yaml
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
init_cls_num: &init_cls_num 20
|
| 2 |
+
inc_cls_num: &inc_cls_num 20
|
| 3 |
+
total_cls_num: &total_cls_num 100
|
| 4 |
+
task_num: &task_num 5
|
| 5 |
+
image_size: &image_size 224
|
| 6 |
+
|
| 7 |
+
task_num: *task_num
|
| 8 |
+
init_cls_num: *init_cls_num
|
| 9 |
+
inc_cls_num: *inc_cls_num
|
| 10 |
+
total_cls_num: *total_cls_num
|
| 11 |
+
epoch: 4 # 4
|
| 12 |
+
val_per_epoch: 4 # 4
|
| 13 |
+
|
| 14 |
+
train_batch_size: 128
|
| 15 |
+
test_batch_size: 64
|
| 16 |
+
|
| 17 |
+
testing_times: 10
|
| 18 |
+
|
| 19 |
+
setting: task-agnostic
|
| 20 |
+
|
| 21 |
+
train_trfms:
|
| 22 |
+
- RandomResizedCrop :
|
| 23 |
+
size: *image_size
|
| 24 |
+
scale: [0.9, 1.0]
|
| 25 |
+
interpolation: BICUBIC
|
| 26 |
+
- ToTensor: {}
|
| 27 |
+
- Normalize:
|
| 28 |
+
mean: [0.48145466, 0.4578275, 0.40821073]
|
| 29 |
+
std: [0.26862954, 0.26130258, 0.27577711]
|
| 30 |
+
|
| 31 |
+
test_trfms:
|
| 32 |
+
- Resize :
|
| 33 |
+
size: *image_size
|
| 34 |
+
interpolation: BICUBIC
|
| 35 |
+
- ToTensor: {}
|
| 36 |
+
- Normalize:
|
| 37 |
+
mean: [0.48145466, 0.4578275, 0.40821073]
|
| 38 |
+
std: [0.26862954, 0.26130258, 0.27577711]
|
| 39 |
+
|
| 40 |
+
optimizer:
|
| 41 |
+
name: AdamW
|
| 42 |
+
kwargs:
|
| 43 |
+
lr: 1e-3
|
| 44 |
+
weight_decay: 0.
|
| 45 |
+
|
| 46 |
+
lr_scheduler:
|
| 47 |
+
name: CosineAnnealingWarmUp
|
| 48 |
+
kwargs:
|
| 49 |
+
T_max: 0 # Will be replaced in trainter.py with epoch * len(dataloader)
|
| 50 |
+
warmup_length: 30
|
| 51 |
+
|
| 52 |
+
backbone:
|
| 53 |
+
name: vit_pt_imnet
|
| 54 |
+
kwargs:
|
| 55 |
+
pretrained: True
|
| 56 |
+
model_name : vit_base_patch16_224_in21k
|
| 57 |
+
experts_num: 1
|
| 58 |
+
act_layer: QuickGELU
|
| 59 |
+
norm_layer: LayerNorm
|
| 60 |
+
|
| 61 |
+
classifier:
|
| 62 |
+
name: DMNSP
|
| 63 |
+
kwargs:
|
| 64 |
+
init_cls_num: *init_cls_num
|
| 65 |
+
inc_cls_num: *inc_cls_num
|
| 66 |
+
task_num: *task_num
|
| 67 |
+
embd_dim: 768
|
| 68 |
+
prompt_template : "a bad photo of a {}."
|
| 69 |
+
label_smoothing: 0.
|
config/dualprompt.yaml
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
# - headers/optimizer.yaml
|
| 6 |
+
- backbones/resnet12.yaml
|
| 7 |
+
|
| 8 |
+
image_size: 32
|
| 9 |
+
|
| 10 |
+
# data
|
| 11 |
+
init_cls_num: 10
|
| 12 |
+
inc_cls_num: 10
|
| 13 |
+
task_num: 10
|
| 14 |
+
|
| 15 |
+
epoch: 10 #160
|
| 16 |
+
device_ids: 0
|
| 17 |
+
n_gpu: 1
|
| 18 |
+
val_per_epoch: 5
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
batch_size: 128
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
optimizer:
|
| 25 |
+
name: Adam
|
| 26 |
+
kwargs:
|
| 27 |
+
lr: 0.001
|
| 28 |
+
betas: [0.9, 0.999]
|
| 29 |
+
weight_decay: 0
|
| 30 |
+
|
| 31 |
+
lr_scheduler:
|
| 32 |
+
name: MultiStepLR
|
| 33 |
+
kwargs:
|
| 34 |
+
gamma: 0.1
|
| 35 |
+
milestones: [80, 120]
|
| 36 |
+
|
| 37 |
+
backbone:
|
| 38 |
+
name: vit_pt_imnet
|
| 39 |
+
kwargs:
|
| 40 |
+
num_classes: 100
|
| 41 |
+
pretrained: true
|
| 42 |
+
model_name : vit_base_patch16_224
|
| 43 |
+
|
| 44 |
+
classifier:
|
| 45 |
+
name: DualPrompt
|
| 46 |
+
kwargs:
|
| 47 |
+
num_class: 100
|
| 48 |
+
feat_dim: 768
|
| 49 |
+
task_num: 10
|
| 50 |
+
init_cls_num: 10
|
| 51 |
+
inc_cls_num: 10
|
| 52 |
+
g_prompt_length: 6
|
| 53 |
+
e_prompt_length: 20
|
| 54 |
+
|
config/ewc.yaml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
image_size: 32
|
| 2 |
+
|
| 3 |
+
# data
|
| 4 |
+
init_cls_num: 10 # 50
|
| 5 |
+
inc_cls_num: 10 # 25
|
| 6 |
+
task_num: 10 # 3
|
| 7 |
+
|
| 8 |
+
epoch: 100 # 100
|
| 9 |
+
n_gpu: 1
|
| 10 |
+
val_per_epoch: 50
|
| 11 |
+
|
| 12 |
+
batch_size: 128
|
| 13 |
+
|
| 14 |
+
optimizer:
|
| 15 |
+
name: SGD
|
| 16 |
+
kwargs:
|
| 17 |
+
lr: 0.1
|
| 18 |
+
momentum: 0.9
|
| 19 |
+
weight_decay: 0.0005
|
| 20 |
+
|
| 21 |
+
lr_scheduler:
|
| 22 |
+
name: MultiStepLR
|
| 23 |
+
kwargs:
|
| 24 |
+
gamma: 0.1
|
| 25 |
+
milestones: [60, 120, 170]
|
| 26 |
+
|
| 27 |
+
backbone:
|
| 28 |
+
name: resnet34 # cifar_resnet32
|
| 29 |
+
kwargs:
|
| 30 |
+
num_classes: 100
|
| 31 |
+
args:
|
| 32 |
+
dataset: cifar100
|
| 33 |
+
|
| 34 |
+
classifier:
|
| 35 |
+
name: EWC
|
| 36 |
+
kwargs:
|
| 37 |
+
num_class: 100
|
| 38 |
+
feat_dim: 512 # 64 for backbone cifar_resnet32
|
| 39 |
+
init_cls_num: 10
|
| 40 |
+
inc_cls_num: 10
|
| 41 |
+
lamda: 1000
|
config/finetune.yaml
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
- headers/optimizer.yaml
|
| 6 |
+
- backbones/resnet12.yaml
|
| 7 |
+
|
| 8 |
+
data_root: /home/xiongyakun/cifar10
|
| 9 |
+
image_size: 32
|
| 10 |
+
|
| 11 |
+
save_path: ./
|
| 12 |
+
# data
|
| 13 |
+
init_cls_num: 2
|
| 14 |
+
inc_cls_num: 2
|
| 15 |
+
task_num: 5
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
epoch: 3
|
| 19 |
+
device_ids: 5
|
| 20 |
+
n_gpu: 1
|
| 21 |
+
val_per_epoch: 1
|
| 22 |
+
|
| 23 |
+
optimizer:
|
| 24 |
+
name: SGD
|
| 25 |
+
kwargs:
|
| 26 |
+
lr: 0.1
|
| 27 |
+
|
| 28 |
+
lr_scheduler:
|
| 29 |
+
name: StepLR
|
| 30 |
+
kwargs:
|
| 31 |
+
gamma: 0.5
|
| 32 |
+
step_size: 10
|
| 33 |
+
|
| 34 |
+
backbone:
|
| 35 |
+
name: resnet18
|
| 36 |
+
kwargs:
|
| 37 |
+
num_classes: 10
|
| 38 |
+
args:
|
| 39 |
+
dataset: cifar10
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
buffer:
|
| 43 |
+
name: LinearBuffer
|
| 44 |
+
kwargs:
|
| 45 |
+
buffer_size: 500
|
| 46 |
+
batch_size: 32
|
| 47 |
+
strategy: random # random, equal_random, reservoir, herding
|
| 48 |
+
|
| 49 |
+
classifier:
|
| 50 |
+
name: Finetune
|
| 51 |
+
kwargs:
|
| 52 |
+
num_class: 10
|
| 53 |
+
feat_dim: 512
|
config/headers/data.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
save_path: ''
|
| 2 |
+
dataset: cifar100 # [cifar100, binary_cifar100, ...]
|
| 3 |
+
data_root: /data/lqx/cifar100
|
| 4 |
+
image_size: 32
|
| 5 |
+
pin_memory: False
|
| 6 |
+
augment: True
|
| 7 |
+
num_workers: 24
|
config/headers/device.yaml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
device_ids: 'auto' # determine GPU ids in bus order, auto for automatic select gpu, or number to specify device
|
| 2 |
+
n_gpu: 1 # select the number of gpus to use
|
| 3 |
+
seed: 1993 # random seed for numpy, torch and cuda
|
| 4 |
+
deterministic: True # option for torch.backends.cudnn.benchmark and torch.backends.cudnn.deterministic
|
config/headers/model.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch: 50
|
| 2 |
+
|
| 3 |
+
batch_size: 64
|
| 4 |
+
val_per_epoch: 1
|
| 5 |
+
|
| 6 |
+
buffer: # By default Buffer is not used, set buffer_size to 0
|
| 7 |
+
name: LinearBuffer
|
| 8 |
+
kwargs:
|
| 9 |
+
buffer_size: 0
|
| 10 |
+
batch_size: 128
|
| 11 |
+
strategy: herding # random, equal_random, reservoir, herding
|
config/headers/optimizer.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# optimizer info
|
| 2 |
+
optimizer:
|
| 3 |
+
name: SGD
|
| 4 |
+
kwargs:
|
| 5 |
+
lr: 0.1
|
| 6 |
+
|
| 7 |
+
# lr_scheduler info
|
| 8 |
+
lr_scheduler: # By Default, No LR Scheduler is used
|
| 9 |
+
name: Constant
|
| 10 |
+
|
| 11 |
+
warmup: 3
|
config/headers/test.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Testing Settings
|
| 2 |
+
testing_times: 10 # Take average of 10 testings
|
| 3 |
+
setting: task-agnostic # Task ID is not provided during inference
|
| 4 |
+
# or task-aware, provide Task ID during inference
|
| 5 |
+
|
| 6 |
+
testing_per_task: True # Test data comes in per task (Each batch of test data will belongs to same task)
|
| 7 |
+
# False, each batch of test data is not assure to be in same task
|
| 8 |
+
# Not yet Implemented
|
| 9 |
+
|
| 10 |
+
eval_with_test: True # Use Test data for in-epoch validation, If False
|
| 11 |
+
# Another eval dateset will seperated from train dataset for in-epoch validation
|
config/icarl.yaml
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
# - headers/model.yaml
|
| 5 |
+
# - headers/optimizer.yaml
|
| 6 |
+
# - backbones/resnet12.yaml
|
| 7 |
+
|
| 8 |
+
# data_root: /data/fanzhichen/continual/cifar100
|
| 9 |
+
data_root: ~/datasets/cifar100
|
| 10 |
+
image_size: 32
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
warmup: 3
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
save_path: ./
|
| 17 |
+
# data
|
| 18 |
+
init_cls_num: 10
|
| 19 |
+
inc_cls_num: 10
|
| 20 |
+
task_num: 10
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
batch_size: 128
|
| 24 |
+
|
| 25 |
+
init_epoch: 200 #100
|
| 26 |
+
epoch: 170 #100
|
| 27 |
+
|
| 28 |
+
device_ids: 2
|
| 29 |
+
n_gpu: 1
|
| 30 |
+
val_per_epoch: 1
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
optimizer:
|
| 34 |
+
name: SGD
|
| 35 |
+
kwargs:
|
| 36 |
+
lr: 0.1
|
| 37 |
+
momentum: 0.9
|
| 38 |
+
weight_decay: 0.0005
|
| 39 |
+
|
| 40 |
+
lr_scheduler:
|
| 41 |
+
name: CosineAnnealingLR
|
| 42 |
+
kwargs:
|
| 43 |
+
T_max: 100
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
backbone:
|
| 47 |
+
name: cifar_resnet32
|
| 48 |
+
kwargs:
|
| 49 |
+
num_classes: 100
|
| 50 |
+
args:
|
| 51 |
+
dataset: cifar100
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
buffer:
|
| 55 |
+
name: LinearHerdingBuffer
|
| 56 |
+
kwargs:
|
| 57 |
+
buffer_size: 2000
|
| 58 |
+
batch_size: 64
|
| 59 |
+
# strategy: herding # random, equal_random, reservoir, herding
|
| 60 |
+
|
| 61 |
+
classifier:
|
| 62 |
+
name: ICarl
|
| 63 |
+
kwargs:
|
| 64 |
+
num_class: 100
|
| 65 |
+
feat_dim: 64
|
| 66 |
+
init_cls_num: 10
|
| 67 |
+
inc_cls_num: 10
|
| 68 |
+
task_num: 10
|
config/icarl_5dataset.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
# - headers/model.yaml
|
| 5 |
+
# - headers/optimizer.yaml
|
| 6 |
+
# - backbones/resnet12.yaml
|
| 7 |
+
|
| 8 |
+
warmup: 0
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
dataset: &dataset 5-datasets
|
| 12 |
+
data_root: /data/Dataset/5-dataset
|
| 13 |
+
class_order: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
| 14 |
+
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
| 15 |
+
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
| 16 |
+
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
|
| 17 |
+
40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
|
| 18 |
+
testing_times: 1
|
| 19 |
+
|
| 20 |
+
save_path: ./
|
| 21 |
+
# data
|
| 22 |
+
init_cls_num: 10
|
| 23 |
+
inc_cls_num: 10
|
| 24 |
+
task_num: 5
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
batch_size: 128
|
| 28 |
+
|
| 29 |
+
init_epoch: 1 #100
|
| 30 |
+
epoch: 1 #100
|
| 31 |
+
|
| 32 |
+
device_ids: 2
|
| 33 |
+
n_gpu: 1
|
| 34 |
+
val_per_epoch: 1
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
optimizer:
|
| 38 |
+
name: SGD
|
| 39 |
+
kwargs:
|
| 40 |
+
lr: 0.1
|
| 41 |
+
momentum: 0.9
|
| 42 |
+
weight_decay: 0.0005
|
| 43 |
+
|
| 44 |
+
lr_scheduler:
|
| 45 |
+
name: CosineAnnealingLR
|
| 46 |
+
kwargs:
|
| 47 |
+
T_max: 100
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
backbone:
|
| 51 |
+
name: cifar_resnet32
|
| 52 |
+
kwargs:
|
| 53 |
+
num_classes: 100
|
| 54 |
+
args:
|
| 55 |
+
dataset: cifar100
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
buffer:
|
| 59 |
+
name: LinearHerdingBuffer
|
| 60 |
+
kwargs:
|
| 61 |
+
buffer_size: 2000
|
| 62 |
+
batch_size: 64
|
| 63 |
+
# strategy: herding # random, equal_random, reservoir, herding
|
| 64 |
+
|
| 65 |
+
classifier:
|
| 66 |
+
name: ICarl
|
| 67 |
+
kwargs:
|
| 68 |
+
num_class: 50
|
| 69 |
+
feat_dim: 64
|
| 70 |
+
init_cls_num: 10
|
| 71 |
+
inc_cls_num: 10
|
| 72 |
+
task_num: 5
|
config/l2p-vit-cifar100-b10-10-10.yaml
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset cifar100
|
| 3 |
+
init_cls_num: &init_cls_num 10
|
| 4 |
+
inc_cls_num: &inc_cls_num 10
|
| 5 |
+
total_cls_num: &total_cls_num 100
|
| 6 |
+
task_num: &task_num 10
|
| 7 |
+
image_size: &image_size 224
|
| 8 |
+
|
| 9 |
+
init_cls_num: *init_cls_num
|
| 10 |
+
inc_cls_num: *inc_cls_num
|
| 11 |
+
task_num: *task_num
|
| 12 |
+
epoch: 1 # 5
|
| 13 |
+
val_per_epoch: 5
|
| 14 |
+
|
| 15 |
+
batch_size: 16 # Source code is 16 per device * 8 devices, since we don't use distribution device, set batch_size to 16
|
| 16 |
+
testing_times: 1
|
| 17 |
+
|
| 18 |
+
seed: 2
|
| 19 |
+
|
| 20 |
+
train_trfms:
|
| 21 |
+
- RandomResizedCrop:
|
| 22 |
+
size: *image_size
|
| 23 |
+
scale: [0.05, 1.0]
|
| 24 |
+
ratio: [0.75, 1.3333] # [0.75, 1.3333333333]
|
| 25 |
+
interpolation: BILINEAR
|
| 26 |
+
- RandomHorizontalFlip:
|
| 27 |
+
p: 0.5
|
| 28 |
+
- ToTensor: {}
|
| 29 |
+
|
| 30 |
+
test_trfms:
|
| 31 |
+
- Resize:
|
| 32 |
+
size: 256 # Stated in source code of L2P
|
| 33 |
+
interpolation: BICUBIC # 3 # LANCZOS
|
| 34 |
+
- CenterCrop:
|
| 35 |
+
size: *image_size
|
| 36 |
+
- ToTensor: {}
|
| 37 |
+
|
| 38 |
+
optimizer:
|
| 39 |
+
name: Adam
|
| 40 |
+
kwargs:
|
| 41 |
+
lr: 0.001875 # 0.03
|
| 42 |
+
betas: [0.9, 0.999]
|
| 43 |
+
weight_decay: 0
|
| 44 |
+
|
| 45 |
+
lr_scheduler:
|
| 46 |
+
name: Constant
|
| 47 |
+
|
| 48 |
+
backbone:
|
| 49 |
+
name: vit_pt_imnet
|
| 50 |
+
kwargs:
|
| 51 |
+
num_classes: 100
|
| 52 |
+
pretrained: true
|
| 53 |
+
model_name : vit_base_patch16_224
|
| 54 |
+
|
| 55 |
+
classifier:
|
| 56 |
+
name: L2P
|
| 57 |
+
kwargs:
|
| 58 |
+
init_cls_num: *init_cls_num
|
| 59 |
+
inc_cls_num: *inc_cls_num
|
| 60 |
+
num_class: *total_cls_num
|
| 61 |
+
task_num: *task_num
|
| 62 |
+
feat_dim: 768
|
| 63 |
+
prompt_length: 5 # L_p in paper
|
| 64 |
+
pool_size: 10 # M in paper
|
| 65 |
+
top_k: 5 # N in paper
|
| 66 |
+
pull_constraint_coeff: 1.0 # -0.5 in paper, 1.0 in source code
|
| 67 |
+
|
config/lwf.yaml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
image_size: 32
|
| 2 |
+
|
| 3 |
+
# data
|
| 4 |
+
init_cls_num: 20 # 10
|
| 5 |
+
inc_cls_num: 20 # 10
|
| 6 |
+
task_num: 5 # 10
|
| 7 |
+
|
| 8 |
+
epoch: 100 # 100
|
| 9 |
+
n_gpu: 1
|
| 10 |
+
val_per_epoch: 10
|
| 11 |
+
|
| 12 |
+
batch_size: 128
|
| 13 |
+
|
| 14 |
+
optimizer:
|
| 15 |
+
name: SGD
|
| 16 |
+
kwargs:
|
| 17 |
+
lr: 0.1
|
| 18 |
+
|
| 19 |
+
lr_scheduler:
|
| 20 |
+
name: StepLR
|
| 21 |
+
kwargs:
|
| 22 |
+
gamma: 0.5
|
| 23 |
+
step_size: 30
|
| 24 |
+
|
| 25 |
+
backbone:
|
| 26 |
+
name: resnet34 # resnet18
|
| 27 |
+
kwargs:
|
| 28 |
+
num_classes: 100
|
| 29 |
+
args:
|
| 30 |
+
dataset: cifar100
|
| 31 |
+
|
| 32 |
+
classifier:
|
| 33 |
+
name: LWF
|
| 34 |
+
kwargs:
|
| 35 |
+
num_class: 100
|
| 36 |
+
feat_dim: 512
|
| 37 |
+
init_cls_num: 20 #10
|
| 38 |
+
inc_cls_num: 20 #10
|
| 39 |
+
dist: 0.5
|
| 40 |
+
lamda: 10
|
| 41 |
+
K: 2
|
| 42 |
+
lw_mr: 1
|
config/ranpac.yaml
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
init_cls_num: &init_cls_num 10
|
| 2 |
+
inc_cls_num: &inc_cls_num 10
|
| 3 |
+
total_cls_num: &total_cls_num 100
|
| 4 |
+
task_num: &task_num 10
|
| 5 |
+
image_size: &image_size 224
|
| 6 |
+
|
| 7 |
+
task_num: *task_num
|
| 8 |
+
init_cls_num: *init_cls_num
|
| 9 |
+
inc_cls_num: *inc_cls_num
|
| 10 |
+
total_cls_num: *total_cls_num
|
| 11 |
+
init_epoch: 20 # 20
|
| 12 |
+
epoch: 1 # 1
|
| 13 |
+
batch_size: 48 # 128
|
| 14 |
+
val_per_epoch: 20
|
| 15 |
+
|
| 16 |
+
seed: 2
|
| 17 |
+
|
| 18 |
+
train_trfms:
|
| 19 |
+
- RandomResizedCrop:
|
| 20 |
+
size: *image_size
|
| 21 |
+
scale: [0.05, 1.0]
|
| 22 |
+
ratio: [0.75, 1.33333333] # [3./4., 4./3.]
|
| 23 |
+
- RandomHorizontalFlip:
|
| 24 |
+
p: 0.5
|
| 25 |
+
- ToTensor: {}
|
| 26 |
+
|
| 27 |
+
test_trfms:
|
| 28 |
+
- Resize:
|
| 29 |
+
size: *image_size
|
| 30 |
+
interpolation: BICUBIC
|
| 31 |
+
- CenterCrop:
|
| 32 |
+
size: *image_size
|
| 33 |
+
- ToTensor: {}
|
| 34 |
+
|
| 35 |
+
optimizer:
|
| 36 |
+
name: SGD
|
| 37 |
+
kwargs:
|
| 38 |
+
momentum: 0.9
|
| 39 |
+
lr: 0.01
|
| 40 |
+
weight_decay: 0.0005
|
| 41 |
+
|
| 42 |
+
lr_scheduler:
|
| 43 |
+
name: CosineAnnealingLR
|
| 44 |
+
kwargs:
|
| 45 |
+
T_max: 20
|
| 46 |
+
eta_min: 0.0
|
| 47 |
+
|
| 48 |
+
backbone:
|
| 49 |
+
name: vit_pt_imnet_in21k_adapter
|
| 50 |
+
kwargs:
|
| 51 |
+
pretrained: true
|
| 52 |
+
model_name : vit_base_patch16_224_in21k
|
| 53 |
+
|
| 54 |
+
classifier:
|
| 55 |
+
name: RanPAC
|
| 56 |
+
kwargs:
|
| 57 |
+
use_RP: True
|
| 58 |
+
M: 10000
|
| 59 |
+
first_session_training: True
|
| 60 |
+
init_cls_num: *init_cls_num
|
| 61 |
+
inc_cls_num: *inc_cls_num
|
| 62 |
+
task_num: *task_num
|
| 63 |
+
total_cls_num: *total_cls_num
|
config/ranpac_clip.yaml
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
init_cls_num: &init_cls_num 20
|
| 2 |
+
inc_cls_num: &inc_cls_num 20
|
| 3 |
+
total_cls_num: &total_cls_num 100
|
| 4 |
+
task_num: &task_num 5
|
| 5 |
+
image_size: &image_size 224
|
| 6 |
+
|
| 7 |
+
task_num: *task_num
|
| 8 |
+
init_cls_num: *init_cls_num
|
| 9 |
+
inc_cls_num: *inc_cls_num
|
| 10 |
+
total_cls_num: *total_cls_num
|
| 11 |
+
init_epoch: 20 # 20
|
| 12 |
+
epoch: 1 # 1
|
| 13 |
+
batch_size: 48 # 128
|
| 14 |
+
val_per_epoch: 20
|
| 15 |
+
|
| 16 |
+
train_trfms:
|
| 17 |
+
- RandomResizedCrop:
|
| 18 |
+
size: *image_size
|
| 19 |
+
scale: [0.05, 1.0]
|
| 20 |
+
ratio: [0.75, 1.33333333] # [3./4., 4./3.]
|
| 21 |
+
- RandomHorizontalFlip:
|
| 22 |
+
p: 0.5
|
| 23 |
+
- ToTensor: {}
|
| 24 |
+
|
| 25 |
+
test_trfms:
|
| 26 |
+
- Resize:
|
| 27 |
+
size: *image_size
|
| 28 |
+
interpolation: BICUBIC
|
| 29 |
+
- CenterCrop:
|
| 30 |
+
size: *image_size
|
| 31 |
+
- ToTensor: {}
|
| 32 |
+
|
| 33 |
+
optimizer:
|
| 34 |
+
name: AdamW
|
| 35 |
+
kwargs:
|
| 36 |
+
lr: 1e-3
|
| 37 |
+
weight_decay: 0.
|
| 38 |
+
|
| 39 |
+
lr_scheduler:
|
| 40 |
+
name: CosineAnnealingWarmUp
|
| 41 |
+
kwargs:
|
| 42 |
+
T_max: 0 # Will be replaced in trainter.py with epoch * len(dataloader)
|
| 43 |
+
warmup_length: 30
|
| 44 |
+
|
| 45 |
+
backbone:
|
| 46 |
+
name: clip
|
| 47 |
+
kwargs:
|
| 48 |
+
model_name : ViT-B/16
|
| 49 |
+
pretrained : True
|
| 50 |
+
block_layer: ResidualAttentionBlock_MoE_MLP
|
| 51 |
+
experts_num: 1
|
| 52 |
+
step: -1 # think again
|
| 53 |
+
act_layer: QuickGELU
|
| 54 |
+
norm_layer: LayerNorm
|
| 55 |
+
|
| 56 |
+
classifier:
|
| 57 |
+
name: RanPAC
|
| 58 |
+
kwargs:
|
| 59 |
+
use_RP: True
|
| 60 |
+
M: 10000
|
| 61 |
+
first_session_training: True
|
| 62 |
+
init_cls_num: *init_cls_num
|
| 63 |
+
inc_cls_num: *inc_cls_num
|
| 64 |
+
task_num: *task_num
|
| 65 |
+
total_cls_num: *total_cls_num
|
| 66 |
+
prompt_template : "a bad photo of a {}."
|
config/rapf10-10.yaml
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includesL:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
|
| 6 |
+
data_root: /home/xtx/datasets/cifar100
|
| 7 |
+
image_size: &image_size 224
|
| 8 |
+
num_workers: &num_workers 16
|
| 9 |
+
|
| 10 |
+
save_path: ./
|
| 11 |
+
|
| 12 |
+
seed: &seed 1993
|
| 13 |
+
|
| 14 |
+
is_rapf: True
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# Control B and
|
| 18 |
+
init_cls_num: &init_cls_num 10
|
| 19 |
+
inc_cls_num: &inc_cls_num 10
|
| 20 |
+
task_num: &task_num 10
|
| 21 |
+
|
| 22 |
+
epoch: &epoch 15
|
| 23 |
+
batch_size: &batch_size 128
|
| 24 |
+
train_batch_size: &train_batch_size 100
|
| 25 |
+
n_gpu: 1
|
| 26 |
+
beta: &beta 2
|
| 27 |
+
shrinkage: &shrinkage False
|
| 28 |
+
threshold: &threshold 0.55
|
| 29 |
+
val_per_epoch: &val_per_epoch 10
|
| 30 |
+
|
| 31 |
+
optimizer:
|
| 32 |
+
name: Adam
|
| 33 |
+
kwargs:
|
| 34 |
+
lr: 0.001
|
| 35 |
+
weight_decay: 0.0000
|
| 36 |
+
|
| 37 |
+
lr_scheduler:
|
| 38 |
+
name: MultiStepLR
|
| 39 |
+
kwargs:
|
| 40 |
+
gamma: 0.1
|
| 41 |
+
milestones: [4, 10]
|
| 42 |
+
last_epoch: -1
|
| 43 |
+
|
| 44 |
+
backbone:
|
| 45 |
+
name: clip
|
| 46 |
+
kwargs:
|
| 47 |
+
model_name: ViT-B/16
|
| 48 |
+
device: cuda
|
| 49 |
+
experts_num: 1
|
| 50 |
+
block_layer: ResidualAttentionBlock_MoE_MLP
|
| 51 |
+
top_k : 1
|
| 52 |
+
step: 1
|
| 53 |
+
act_layer: QuickGELU
|
| 54 |
+
norm_layer: LayerNorm
|
| 55 |
+
|
| 56 |
+
classifier:
|
| 57 |
+
name: RAPF
|
| 58 |
+
kwargs:
|
| 59 |
+
init_cls_num: *init_cls_num
|
| 60 |
+
inc_cls_num: *inc_cls_num
|
| 61 |
+
threshold: *threshold
|
| 62 |
+
beta: *beta
|
| 63 |
+
shrinkage: *shrinkage
|
| 64 |
+
train_batch_size: *train_batch_size
|
| 65 |
+
batch_size: *batch_size
|
| 66 |
+
num_workers: *num_workers
|
| 67 |
+
prompt_template: "a good photo of a {}"
|
| 68 |
+
seed: *seed
|
| 69 |
+
fp16: False
|
| 70 |
+
# class_order: *class_order
|
| 71 |
+
mix_bias: 0.6
|
| 72 |
+
feat_dim: 64
|
| 73 |
+
num_class: 100
|
| 74 |
+
|
config/rapf50-10.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includesL:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
|
| 6 |
+
data_root: /home/xtx/datasets/cifar100
|
| 7 |
+
image_size: &image_size 224
|
| 8 |
+
num_workers: &num_workers 16
|
| 9 |
+
|
| 10 |
+
save_path: ./
|
| 11 |
+
|
| 12 |
+
class_order: &class_order [87, 0, 52, 58, 44, 91, 68, 97, 51, 15, 94, 92, 10, 72, 49, 78, 61, 14, 8, 86, 84, 96, 18, 24, 32, 45, 88, 11, 4, 67, 69, 66, 77, 47, 79, 93, 29, 50, 57, 83, 17, 81, 41, 12, 37, 59, 25, 20, 80, 73, 1, 28, 6, 46, 62, 82, 53, 9, 31, 75, 38, 63, 33, 74, 27, 22, 36, 3, 16, 21, 60, 19, 70, 90, 89, 43, 5, 42, 65, 76, 40, 30, 23, 85, 2, 95, 56, 48, 71, 64, 98, 13, 99, 7, 34, 55, 54, 26, 35, 39]
|
| 13 |
+
seed: &seed 1919810
|
| 14 |
+
|
| 15 |
+
is_rapf: True
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# Control B and
|
| 19 |
+
init_cls_num: &init_cls_num 50
|
| 20 |
+
inc_cls_num: &inc_cls_num 10
|
| 21 |
+
task_num: &task_num 6
|
| 22 |
+
|
| 23 |
+
epoch: &epoch 15
|
| 24 |
+
batch_size: &batch_size 128
|
| 25 |
+
train_batch_size: &train_batch_size 100
|
| 26 |
+
n_gpu: 1
|
| 27 |
+
beta: &beta 2
|
| 28 |
+
shrinkage: &shrinkage False
|
| 29 |
+
threshold: &threshold 0.55
|
| 30 |
+
val_per_epoch: &val_per_epoch 10
|
| 31 |
+
|
| 32 |
+
optimizer:
|
| 33 |
+
name: Adam
|
| 34 |
+
kwargs:
|
| 35 |
+
lr: 0.001
|
| 36 |
+
weight_decay: 0.0000
|
| 37 |
+
|
| 38 |
+
lr_scheduler:
|
| 39 |
+
name: MultiStepLR
|
| 40 |
+
kwargs:
|
| 41 |
+
gamma: 0.1
|
| 42 |
+
milestones: [4, 10]
|
| 43 |
+
last_epoch: -1
|
| 44 |
+
|
| 45 |
+
backbone:
|
| 46 |
+
name: clip
|
| 47 |
+
kwargs:
|
| 48 |
+
model_name: ViT-B/16
|
| 49 |
+
device: cuda
|
| 50 |
+
experts_num: 1
|
| 51 |
+
block_layer: ResidualAttentionBlock_MoE_MLP
|
| 52 |
+
top_k : 1
|
| 53 |
+
step: 1
|
| 54 |
+
act_layer: QuickGELU
|
| 55 |
+
norm_layer: LayerNorm
|
| 56 |
+
|
| 57 |
+
classifier:
|
| 58 |
+
name: RAPF
|
| 59 |
+
kwargs:
|
| 60 |
+
init_cls_num: *init_cls_num
|
| 61 |
+
inc_cls_num: *inc_cls_num
|
| 62 |
+
threshold: *threshold
|
| 63 |
+
beta: *beta
|
| 64 |
+
shrinkage: *shrinkage
|
| 65 |
+
train_batch_size: *train_batch_size
|
| 66 |
+
batch_size: *batch_size
|
| 67 |
+
num_workers: *num_workers
|
| 68 |
+
prompt_template: "a good photo of a {}"
|
| 69 |
+
seed: *seed
|
| 70 |
+
fp16: False
|
| 71 |
+
class_order: *class_order
|
| 72 |
+
mix_bias: 0.6
|
config/rapf50-5.yaml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includesL:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
|
| 6 |
+
data_root: /home/xtx/datasets/cifar100
|
| 7 |
+
image_size: &image_size 224
|
| 8 |
+
num_workers: &num_workers 16
|
| 9 |
+
|
| 10 |
+
save_path: ./
|
| 11 |
+
|
| 12 |
+
seed: &seed 1919810
|
| 13 |
+
|
| 14 |
+
is_rapf: True
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# Control B and
|
| 18 |
+
init_cls_num: &init_cls_num 50
|
| 19 |
+
inc_cls_num: &inc_cls_num 5
|
| 20 |
+
task_num: &task_num 11
|
| 21 |
+
|
| 22 |
+
epoch: &epoch 15
|
| 23 |
+
batch_size: &batch_size 128
|
| 24 |
+
train_batch_size: &train_batch_size 100
|
| 25 |
+
n_gpu: 1
|
| 26 |
+
beta: &beta 2
|
| 27 |
+
shrinkage: &shrinkage False
|
| 28 |
+
threshold: &threshold 0.65
|
| 29 |
+
val_per_epoch: &val_per_epoch 10
|
| 30 |
+
|
| 31 |
+
optimizer:
|
| 32 |
+
name: Adam
|
| 33 |
+
kwargs:
|
| 34 |
+
lr: 0.001
|
| 35 |
+
weight_decay: 0.0000
|
| 36 |
+
|
| 37 |
+
lr_scheduler:
|
| 38 |
+
name: MultiStepLR
|
| 39 |
+
kwargs:
|
| 40 |
+
gamma: 0.1
|
| 41 |
+
milestones: [4, 10]
|
| 42 |
+
last_epoch: -1
|
| 43 |
+
|
| 44 |
+
backbone:
|
| 45 |
+
name: clip
|
| 46 |
+
kwargs:
|
| 47 |
+
model_name: ViT-B/16
|
| 48 |
+
device: cuda
|
| 49 |
+
experts_num: 1
|
| 50 |
+
block_layer: ResidualAttentionBlock_MoE_MLP
|
| 51 |
+
top_k : 1
|
| 52 |
+
step: 1
|
| 53 |
+
act_layer: QuickGELU
|
| 54 |
+
norm_layer: LayerNorm
|
| 55 |
+
|
| 56 |
+
classifier:
|
| 57 |
+
name: RAPF
|
| 58 |
+
kwargs:
|
| 59 |
+
init_cls_num: *init_cls_num
|
| 60 |
+
inc_cls_num: *inc_cls_num
|
| 61 |
+
threshold: *threshold
|
| 62 |
+
beta: *beta
|
| 63 |
+
shrinkage: *shrinkage
|
| 64 |
+
train_batch_size: *train_batch_size
|
| 65 |
+
batch_size: *batch_size
|
| 66 |
+
num_workers: *num_workers
|
| 67 |
+
prompt_template: "a good photo of a {}"
|
| 68 |
+
seed: *seed
|
| 69 |
+
fp16: False
|
| 70 |
+
class_order: *class_order
|
| 71 |
+
mix_bias: 0.6
|
config/tam.yaml
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
includes:
|
| 2 |
+
- headers/data.yaml
|
| 3 |
+
- headers/device.yaml
|
| 4 |
+
- headers/model.yaml
|
| 5 |
+
# - headers/optimizer.yaml
|
| 6 |
+
- backbones/resnet12.yaml
|
| 7 |
+
|
| 8 |
+
data_root: /data/fanzhichen/continual/cifar100
|
| 9 |
+
image_size: 32
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
save_path: ./
|
| 13 |
+
# data
|
| 14 |
+
init_cls_num: 20
|
| 15 |
+
inc_cls_num: 20
|
| 16 |
+
task_num: 5
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
epoch: 0 # 160
|
| 20 |
+
device_ids: 4
|
| 21 |
+
n_gpu: 1
|
| 22 |
+
val_per_epoch: 1
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
batch_size: 128
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
optimizer:
|
| 29 |
+
name: SGD
|
| 30 |
+
kwargs:
|
| 31 |
+
lr: 0.03
|
| 32 |
+
momentum: 0.9
|
| 33 |
+
weight_decay: 0.0005
|
| 34 |
+
|
| 35 |
+
lr_scheduler:
|
| 36 |
+
name: MultiStepLR
|
| 37 |
+
kwargs:
|
| 38 |
+
gamma: 0.1
|
| 39 |
+
milestones: [60, 120, 170]
|
| 40 |
+
|
| 41 |
+
backbone:
|
| 42 |
+
name: resnet18
|
| 43 |
+
kwargs:
|
| 44 |
+
num_classes: 100
|
| 45 |
+
args:
|
| 46 |
+
dataset: cifar100
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
buffer:
|
| 50 |
+
name: LinearBuffer
|
| 51 |
+
kwargs:
|
| 52 |
+
buffer_size: 1000
|
| 53 |
+
batch_size: 128
|
| 54 |
+
strategy: herding # random, equal_random, reservoir, herding
|
| 55 |
+
|
| 56 |
+
classifier:
|
| 57 |
+
name: TAM
|
| 58 |
+
kwargs:
|
| 59 |
+
num_class: 100
|
| 60 |
+
feat_dim: 512
|
| 61 |
+
init_cls_num: 20
|
| 62 |
+
inc_cls_num: 20
|
| 63 |
+
lamda: 1000
|
| 64 |
+
reg_weight: 0.1
|
| 65 |
+
ema_update_freq: 0.05
|
| 66 |
+
ema_alpha: 0.999
|
| 67 |
+
pairwise_weight: 0.1
|
| 68 |
+
alpha: 0.2
|
| 69 |
+
beta: 0.5
|
| 70 |
+
code_dims: 64
|
config/zz_BIC/bic-resnet32-5dataset-b10-10-5.yaml
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset 5-datasets
|
| 2 |
+
data_root: /data/Dataset/5-dataset
|
| 3 |
+
class_order: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
| 4 |
+
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
| 5 |
+
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
| 6 |
+
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
|
| 7 |
+
40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
|
| 8 |
+
|
| 9 |
+
total_cls_num: &total_cls_num 50
|
| 10 |
+
init_cls_num: &init_cls_num 10
|
| 11 |
+
inc_cls_num: &inc_cls_num 10
|
| 12 |
+
task_num: &task_num 5
|
| 13 |
+
image_size: &image_size 32
|
| 14 |
+
|
| 15 |
+
init_cls_num: *init_cls_num
|
| 16 |
+
inc_cls_num: *inc_cls_num
|
| 17 |
+
task_num: *task_num
|
| 18 |
+
|
| 19 |
+
epoch: 250
|
| 20 |
+
stage2_epoch: 250
|
| 21 |
+
val_per_epoch: 50
|
| 22 |
+
batch_size: 128
|
| 23 |
+
|
| 24 |
+
testing_times: 1
|
| 25 |
+
|
| 26 |
+
seed: 0
|
| 27 |
+
|
| 28 |
+
num_workers: 0
|
| 29 |
+
|
| 30 |
+
optimizer:
|
| 31 |
+
name: SGD
|
| 32 |
+
kwargs:
|
| 33 |
+
lr: 0.1
|
| 34 |
+
momentum: 0.9
|
| 35 |
+
weight_decay: 2e-4
|
| 36 |
+
|
| 37 |
+
lr_scheduler:
|
| 38 |
+
name: MultiStepLR
|
| 39 |
+
kwargs:
|
| 40 |
+
gamma: 0.1
|
| 41 |
+
milestones: [100, 150, 200]
|
| 42 |
+
|
| 43 |
+
# done
|
| 44 |
+
backbone:
|
| 45 |
+
name: cifar_resnet32_V2 # cifar_resnet32_V2 , resnet32 for dataset cifar100, see original paper
|
| 46 |
+
kwargs:
|
| 47 |
+
num_classes: *total_cls_num
|
| 48 |
+
args:
|
| 49 |
+
dataset: *dataset
|
| 50 |
+
|
| 51 |
+
buffer:
|
| 52 |
+
name: LinearSpiltBuffer
|
| 53 |
+
kwargs:
|
| 54 |
+
buffer_size: 1000
|
| 55 |
+
batch_size: 128
|
| 56 |
+
strategy: balance_random # random, equal_random, reservoir, herding
|
| 57 |
+
val_ratio: 0.1
|
| 58 |
+
|
| 59 |
+
classifier:
|
| 60 |
+
name: bic
|
| 61 |
+
kwargs:
|
| 62 |
+
num_class: *total_cls_num
|
| 63 |
+
init_cls_num: *init_cls_num
|
| 64 |
+
inc_cls_num: *inc_cls_num
|
| 65 |
+
task_num: *task_num
|
config/zz_BIC/bic-resnet32-cifar100-b10-10-10.yaml
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset binary_cifar100
|
| 3 |
+
data_root: /home/lvqiexuan/temp_data/binary_cifar100
|
| 4 |
+
|
| 5 |
+
total_cls_num: &total_cls_num 100
|
| 6 |
+
init_cls_num: &init_cls_num 10
|
| 7 |
+
inc_cls_num: &inc_cls_num 10
|
| 8 |
+
task_num: &task_num 10
|
| 9 |
+
image_size: &image_size 32
|
| 10 |
+
|
| 11 |
+
init_cls_num: *init_cls_num
|
| 12 |
+
inc_cls_num: *inc_cls_num
|
| 13 |
+
task_num: *task_num
|
| 14 |
+
|
| 15 |
+
epoch: 1 # normally 250, 1 for online setting
|
| 16 |
+
stage2_epoch: 1 # normally 250, 1 for online setting
|
| 17 |
+
val_per_epoch: 50
|
| 18 |
+
batch_size: 10 # normally 128, 10 for online setting
|
| 19 |
+
|
| 20 |
+
testing_times: 1
|
| 21 |
+
|
| 22 |
+
seed: 1993
|
| 23 |
+
|
| 24 |
+
num_workers: 0
|
| 25 |
+
|
| 26 |
+
train_trfms:
|
| 27 |
+
- RandomHorizontalFlip: {}
|
| 28 |
+
- RandomCrop:
|
| 29 |
+
size : *image_size
|
| 30 |
+
padding : 4
|
| 31 |
+
- ToTensor: {}
|
| 32 |
+
- Normalize:
|
| 33 |
+
mean: [0.5071, 0.4866, 0.4409]
|
| 34 |
+
std: [0.2673, 0.2564, 0.2762]
|
| 35 |
+
|
| 36 |
+
test_trfms:
|
| 37 |
+
- ToTensor: {}
|
| 38 |
+
- Normalize:
|
| 39 |
+
mean: [0.5071, 0.4866, 0.4409]
|
| 40 |
+
std: [0.2673, 0.2564, 0.2762]
|
| 41 |
+
|
| 42 |
+
optimizer:
|
| 43 |
+
name: SGD
|
| 44 |
+
kwargs:
|
| 45 |
+
lr: 0.1
|
| 46 |
+
momentum: 0.9
|
| 47 |
+
weight_decay: 2e-4
|
| 48 |
+
|
| 49 |
+
lr_scheduler:
|
| 50 |
+
name: MultiStepLR
|
| 51 |
+
kwargs:
|
| 52 |
+
gamma: 0.1
|
| 53 |
+
milestones: [100, 150, 200]
|
| 54 |
+
|
| 55 |
+
# done
|
| 56 |
+
backbone:
|
| 57 |
+
name: cifar_resnet32_V2 # cifar_resnet32_V2 , resnet32 for dataset cifar100, see original paper
|
| 58 |
+
kwargs:
|
| 59 |
+
num_classes: *total_cls_num
|
| 60 |
+
args:
|
| 61 |
+
dataset: *dataset
|
| 62 |
+
|
| 63 |
+
buffer:
|
| 64 |
+
name: LinearSpiltBuffer
|
| 65 |
+
kwargs:
|
| 66 |
+
buffer_size: 2000
|
| 67 |
+
batch_size: 128
|
| 68 |
+
strategy: balance_random # random, equal_random, reservoir, herding
|
| 69 |
+
val_ratio: 0.1
|
| 70 |
+
|
| 71 |
+
classifier:
|
| 72 |
+
name: bic
|
| 73 |
+
kwargs:
|
| 74 |
+
num_class: *total_cls_num
|
| 75 |
+
init_cls_num: *init_cls_num
|
| 76 |
+
inc_cls_num: *inc_cls_num
|
| 77 |
+
task_num: *task_num
|
config/zz_BIC/bic-resnet32-cifar100-b20-20-5.yaml
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset binary_cifar100
|
| 3 |
+
data_root: /home/lvqiexuan/temp_data/binary_cifar100
|
| 4 |
+
|
| 5 |
+
total_cls_num: &total_cls_num 100
|
| 6 |
+
init_cls_num: &init_cls_num 20
|
| 7 |
+
inc_cls_num: &inc_cls_num 20
|
| 8 |
+
task_num: &task_num 5
|
| 9 |
+
image_size: &image_size 32
|
| 10 |
+
|
| 11 |
+
init_cls_num: *init_cls_num
|
| 12 |
+
inc_cls_num: *inc_cls_num
|
| 13 |
+
task_num: *task_num
|
| 14 |
+
|
| 15 |
+
epoch: 250
|
| 16 |
+
stage2_epoch: 250
|
| 17 |
+
val_per_epoch: 50
|
| 18 |
+
batch_size: 128
|
| 19 |
+
|
| 20 |
+
testing_times: 5
|
| 21 |
+
|
| 22 |
+
seed: 2
|
| 23 |
+
|
| 24 |
+
num_workers: 0
|
| 25 |
+
|
| 26 |
+
train_trfms:
|
| 27 |
+
- RandomHorizontalFlip: {}
|
| 28 |
+
- RandomCrop:
|
| 29 |
+
size : *image_size
|
| 30 |
+
padding : 4
|
| 31 |
+
- ToTensor: {}
|
| 32 |
+
- Normalize:
|
| 33 |
+
mean: [0.5071, 0.4866, 0.4409]
|
| 34 |
+
std: [0.2673, 0.2564, 0.2762]
|
| 35 |
+
|
| 36 |
+
test_trfms:
|
| 37 |
+
- ToTensor: {}
|
| 38 |
+
- Normalize:
|
| 39 |
+
mean: [0.5071, 0.4866, 0.4409]
|
| 40 |
+
std: [0.2673, 0.2564, 0.2762]
|
| 41 |
+
|
| 42 |
+
optimizer:
|
| 43 |
+
name: SGD
|
| 44 |
+
kwargs:
|
| 45 |
+
lr: 0.1
|
| 46 |
+
momentum: 0.9
|
| 47 |
+
weight_decay: 2e-4
|
| 48 |
+
|
| 49 |
+
lr_scheduler:
|
| 50 |
+
name: MultiStepLR
|
| 51 |
+
kwargs:
|
| 52 |
+
gamma: 0.1
|
| 53 |
+
milestones: [100, 150, 200]
|
| 54 |
+
|
| 55 |
+
# done
|
| 56 |
+
backbone:
|
| 57 |
+
name: cifar_resnet32_V2 # cifar_resnet32_V2 , resnet32 for dataset cifar100, see original paper
|
| 58 |
+
kwargs:
|
| 59 |
+
num_classes: *total_cls_num
|
| 60 |
+
args:
|
| 61 |
+
dataset: *dataset
|
| 62 |
+
|
| 63 |
+
buffer:
|
| 64 |
+
name: LinearSpiltBuffer
|
| 65 |
+
kwargs:
|
| 66 |
+
buffer_size: 2000
|
| 67 |
+
batch_size: 128
|
| 68 |
+
strategy: balance_random # random, equal_random, reservoir, herding
|
| 69 |
+
val_ratio: 0.1
|
| 70 |
+
|
| 71 |
+
classifier:
|
| 72 |
+
name: bic
|
| 73 |
+
kwargs:
|
| 74 |
+
num_class: *total_cls_num
|
| 75 |
+
init_cls_num: *init_cls_num
|
| 76 |
+
inc_cls_num: *inc_cls_num
|
| 77 |
+
task_num: *task_num
|
config/zz_BIC/bic-resnet32-imagenetr-b20-20-10.yaml
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset imagenet-r
|
| 2 |
+
data_root: /data/Dataset/imagenet-r
|
| 3 |
+
|
| 4 |
+
total_cls_num: &total_cls_num 200
|
| 5 |
+
init_cls_num: &init_cls_num 20
|
| 6 |
+
inc_cls_num: &inc_cls_num 20
|
| 7 |
+
task_num: &task_num 10
|
| 8 |
+
|
| 9 |
+
init_cls_num: *init_cls_num
|
| 10 |
+
inc_cls_num: *inc_cls_num
|
| 11 |
+
task_num: *task_num
|
| 12 |
+
|
| 13 |
+
epoch: 1 #250
|
| 14 |
+
stage2_epoch: 1 #250
|
| 15 |
+
val_per_epoch: 50
|
| 16 |
+
batch_size: 10 #128
|
| 17 |
+
|
| 18 |
+
testing_times: 1
|
| 19 |
+
|
| 20 |
+
seed: 0
|
| 21 |
+
|
| 22 |
+
num_workers: 0
|
| 23 |
+
|
| 24 |
+
optimizer:
|
| 25 |
+
name: SGD
|
| 26 |
+
kwargs:
|
| 27 |
+
lr: 0.1
|
| 28 |
+
momentum: 0.9
|
| 29 |
+
weight_decay: 2e-4
|
| 30 |
+
|
| 31 |
+
lr_scheduler:
|
| 32 |
+
name: MultiStepLR
|
| 33 |
+
kwargs:
|
| 34 |
+
gamma: 0.1
|
| 35 |
+
milestones: [100, 150, 200]
|
| 36 |
+
|
| 37 |
+
# done
|
| 38 |
+
backbone:
|
| 39 |
+
name: cifar_resnet32_V2 # cifar_resnet32_V2 , resnet32 for dataset cifar100, see original paper
|
| 40 |
+
kwargs:
|
| 41 |
+
num_classes: *total_cls_num
|
| 42 |
+
args:
|
| 43 |
+
dataset: *dataset
|
| 44 |
+
|
| 45 |
+
buffer:
|
| 46 |
+
name: LinearSpiltBuffer
|
| 47 |
+
kwargs:
|
| 48 |
+
buffer_size: 2000
|
| 49 |
+
batch_size: 128
|
| 50 |
+
strategy: balance_random # random, equal_random, reservoir, herding
|
| 51 |
+
val_ratio: 0.1
|
| 52 |
+
|
| 53 |
+
classifier:
|
| 54 |
+
name: bic
|
| 55 |
+
kwargs:
|
| 56 |
+
num_class: *total_cls_num
|
| 57 |
+
init_cls_num: *init_cls_num
|
| 58 |
+
inc_cls_num: *inc_cls_num
|
| 59 |
+
task_num: *task_num
|
config/zz_BIC/bic-resnet32-tiny-b20-20-10.yaml
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset tiny-imagenet
|
| 2 |
+
data_root: /data/Dataset/
|
| 3 |
+
|
| 4 |
+
total_cls_num: &total_cls_num 200
|
| 5 |
+
init_cls_num: &init_cls_num 20
|
| 6 |
+
inc_cls_num: &inc_cls_num 20
|
| 7 |
+
task_num: &task_num 10
|
| 8 |
+
|
| 9 |
+
init_cls_num: *init_cls_num
|
| 10 |
+
inc_cls_num: *inc_cls_num
|
| 11 |
+
task_num: *task_num
|
| 12 |
+
|
| 13 |
+
epoch: 1 #250
|
| 14 |
+
stage2_epoch: 1 #250
|
| 15 |
+
val_per_epoch: 50
|
| 16 |
+
batch_size: 10 #128
|
| 17 |
+
|
| 18 |
+
testing_times: 1
|
| 19 |
+
|
| 20 |
+
seed: 0
|
| 21 |
+
|
| 22 |
+
num_workers: 0
|
| 23 |
+
|
| 24 |
+
optimizer:
|
| 25 |
+
name: SGD
|
| 26 |
+
kwargs:
|
| 27 |
+
lr: 0.1
|
| 28 |
+
momentum: 0.9
|
| 29 |
+
weight_decay: 2e-4
|
| 30 |
+
|
| 31 |
+
lr_scheduler:
|
| 32 |
+
name: MultiStepLR
|
| 33 |
+
kwargs:
|
| 34 |
+
gamma: 0.1
|
| 35 |
+
milestones: [100, 150, 200]
|
| 36 |
+
|
| 37 |
+
# done
|
| 38 |
+
backbone:
|
| 39 |
+
name: cifar_resnet32_V2 # cifar_resnet32_V2 , resnet32 for dataset cifar100, see original paper
|
| 40 |
+
kwargs:
|
| 41 |
+
num_classes: *total_cls_num
|
| 42 |
+
args:
|
| 43 |
+
dataset: *dataset
|
| 44 |
+
|
| 45 |
+
buffer:
|
| 46 |
+
name: LinearSpiltBuffer
|
| 47 |
+
kwargs:
|
| 48 |
+
buffer_size: 2000
|
| 49 |
+
batch_size: 128
|
| 50 |
+
strategy: balance_random # random, equal_random, reservoir, herding
|
| 51 |
+
val_ratio: 0.1
|
| 52 |
+
|
| 53 |
+
classifier:
|
| 54 |
+
name: bic
|
| 55 |
+
kwargs:
|
| 56 |
+
num_class: *total_cls_num
|
| 57 |
+
init_cls_num: *init_cls_num
|
| 58 |
+
inc_cls_num: *inc_cls_num
|
| 59 |
+
task_num: *task_num
|
config/zz_CL-LoRA/cl_lora-cifar100-b5-5-20.yaml
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# cl_lora-cifar100-b5-5-20
|
| 2 |
+
|
| 3 |
+
dataset: &dataset cifar100
|
| 4 |
+
data_root: /data/lqx/cifar100
|
| 5 |
+
init_cls_num: &init_cls_num 5
|
| 6 |
+
inc_cls_num: &inc_cls_num 5
|
| 7 |
+
total_cls_num: &total_cls_num 100
|
| 8 |
+
task_num: &task_num 20
|
| 9 |
+
image_size: &image_size 224
|
| 10 |
+
epoch: &epoch 30
|
| 11 |
+
|
| 12 |
+
dataset: *dataset
|
| 13 |
+
init_cls_num: *init_cls_num
|
| 14 |
+
inc_cls_num: *inc_cls_num
|
| 15 |
+
total_cls_num: *total_cls_num
|
| 16 |
+
task_num: *task_num
|
| 17 |
+
|
| 18 |
+
epoch: *epoch
|
| 19 |
+
val_per_epoch: *epoch
|
| 20 |
+
|
| 21 |
+
batch_size: 64
|
| 22 |
+
|
| 23 |
+
setting: task-agnostic
|
| 24 |
+
|
| 25 |
+
testing_times: 1
|
| 26 |
+
testing_per_task: False
|
| 27 |
+
|
| 28 |
+
seed: 1993
|
| 29 |
+
|
| 30 |
+
train_trfms:
|
| 31 |
+
- RandomResizedCrop:
|
| 32 |
+
size: *image_size
|
| 33 |
+
scale: [0.05, 1.0]
|
| 34 |
+
ratio: [0.75, 1.3333]
|
| 35 |
+
- RandomHorizontalFlip: {}
|
| 36 |
+
- ToTensor: {}
|
| 37 |
+
|
| 38 |
+
test_trfms:
|
| 39 |
+
- Resize:
|
| 40 |
+
size: 256
|
| 41 |
+
interpolation: 3 # BICUBIC
|
| 42 |
+
- CenterCrop:
|
| 43 |
+
size: [*image_size, *image_size]
|
| 44 |
+
- ToTensor: {}
|
| 45 |
+
|
| 46 |
+
optimizer:
|
| 47 |
+
name: SGD
|
| 48 |
+
kwargs:
|
| 49 |
+
lr: 0.03
|
| 50 |
+
momentum: 0.9
|
| 51 |
+
weight_decay: 0.0001
|
| 52 |
+
|
| 53 |
+
lr_scheduler:
|
| 54 |
+
name: CosineAnnealingLR
|
| 55 |
+
kwargs:
|
| 56 |
+
T_max: *epoch
|
| 57 |
+
eta_min: 0
|
| 58 |
+
|
| 59 |
+
backbone:
|
| 60 |
+
name: vit_cl_lora
|
| 61 |
+
kwargs:
|
| 62 |
+
pretrained: True
|
| 63 |
+
model_name : vit_base_patch16_224_in21k
|
| 64 |
+
attn_layer: MultiHeadAttention_CL_LoRA
|
| 65 |
+
transformer_layer: Transformer_CL_LoRA
|
| 66 |
+
lora_rank: 8
|
| 67 |
+
norm_layer_eps: 1e-6
|
| 68 |
+
|
| 69 |
+
classifier:
|
| 70 |
+
name: CL_LoRA
|
| 71 |
+
kwargs:
|
| 72 |
+
init_cls_num: *init_cls_num
|
| 73 |
+
inc_cls_num: *inc_cls_num
|
| 74 |
+
task_num: *task_num
|
| 75 |
+
embd_dim: 768
|
config/zz_CL-LoRA/cl_lora-imagenetr-b5-5-40.yaml
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
dataset: &dataset imagenet-r
|
| 4 |
+
data_root: /data/lqx/imagenet-r
|
| 5 |
+
|
| 6 |
+
init_cls_num: &init_cls_num 5
|
| 7 |
+
inc_cls_num: &inc_cls_num 5
|
| 8 |
+
total_cls_num: &total_cls_num 200
|
| 9 |
+
task_num: &task_num 40
|
| 10 |
+
image_size: &image_size 224
|
| 11 |
+
epoch: &epoch 20
|
| 12 |
+
|
| 13 |
+
dataset: *dataset
|
| 14 |
+
init_cls_num: *init_cls_num
|
| 15 |
+
inc_cls_num: *inc_cls_num
|
| 16 |
+
total_cls_num: *total_cls_num
|
| 17 |
+
task_num: *task_num
|
| 18 |
+
|
| 19 |
+
epoch: *epoch
|
| 20 |
+
val_per_epoch: *epoch
|
| 21 |
+
|
| 22 |
+
batch_size: 32
|
| 23 |
+
seed: 1993
|
| 24 |
+
|
| 25 |
+
setting: task-agnostic
|
| 26 |
+
|
| 27 |
+
testing_times: 1
|
| 28 |
+
testing_per_task: False
|
| 29 |
+
|
| 30 |
+
train_trfms:
|
| 31 |
+
- RandomResizedCrop:
|
| 32 |
+
size: *image_size
|
| 33 |
+
scale: [0.05, 1.0]
|
| 34 |
+
ratio: [0.75, 1.3333]
|
| 35 |
+
- RandomHorizontalFlip: {}
|
| 36 |
+
- ToTensor: {}
|
| 37 |
+
|
| 38 |
+
test_trfms:
|
| 39 |
+
- Resize:
|
| 40 |
+
size: 256
|
| 41 |
+
interpolation: 3 # BICUBIC
|
| 42 |
+
- CenterCrop:
|
| 43 |
+
size: [*image_size, *image_size]
|
| 44 |
+
- ToTensor: {}
|
| 45 |
+
|
| 46 |
+
optimizer:
|
| 47 |
+
name: SGD
|
| 48 |
+
kwargs:
|
| 49 |
+
lr: 0.05
|
| 50 |
+
momentum: 0.9
|
| 51 |
+
weight_decay: 0.0005
|
| 52 |
+
|
| 53 |
+
lr_scheduler:
|
| 54 |
+
name: CosineAnnealingLR
|
| 55 |
+
kwargs:
|
| 56 |
+
T_max: *epoch
|
| 57 |
+
eta_min: 0
|
| 58 |
+
|
| 59 |
+
backbone:
|
| 60 |
+
name: vit_cl_lora
|
| 61 |
+
kwargs:
|
| 62 |
+
pretrained: True
|
| 63 |
+
model_name : vit_base_patch16_224
|
| 64 |
+
attn_layer: MultiHeadAttention_CL_LoRA
|
| 65 |
+
transformer_layer: Transformer_CL_LoRA
|
| 66 |
+
lora_rank: 10
|
| 67 |
+
norm_layer_eps: 1e-6
|
| 68 |
+
|
| 69 |
+
classifier:
|
| 70 |
+
name: CL_LoRA
|
| 71 |
+
kwargs:
|
| 72 |
+
init_cls_num: *init_cls_num
|
| 73 |
+
inc_cls_num: *inc_cls_num
|
| 74 |
+
task_num: *task_num
|
| 75 |
+
embd_dim: 768
|
| 76 |
+
|
config/zz_ERACE/erace-resnet18-5dataset-b10-10-5.yaml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
dataset: &dataset 5-datasets
|
| 4 |
+
data_root: /data/Dataset/5-dataset
|
| 5 |
+
class_order: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
| 6 |
+
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
| 7 |
+
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
| 8 |
+
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
|
| 9 |
+
40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
|
| 10 |
+
|
| 11 |
+
total_cls_num: &total_cls_num 50
|
| 12 |
+
init_cls_num: &init_cls_num 10
|
| 13 |
+
inc_cls_num: &inc_cls_num 10
|
| 14 |
+
task_num: &task_num 5
|
| 15 |
+
image_size: &image_size 32
|
| 16 |
+
|
| 17 |
+
epoch: 1
|
| 18 |
+
seed: 2
|
| 19 |
+
|
| 20 |
+
batch_size: 10
|
| 21 |
+
testing_times: 1
|
| 22 |
+
|
| 23 |
+
optimizer:
|
| 24 |
+
name: SGD
|
| 25 |
+
kwargs:
|
| 26 |
+
lr: 0.1
|
| 27 |
+
|
| 28 |
+
buffer:
|
| 29 |
+
name: ERBuffer
|
| 30 |
+
kwargs:
|
| 31 |
+
capacity: 10000 # num_classes * M
|
| 32 |
+
|
| 33 |
+
backbone:
|
| 34 |
+
name: resnet18_AML
|
| 35 |
+
kwargs:
|
| 36 |
+
dataset: *dataset
|
| 37 |
+
num_classes: *total_cls_num
|
| 38 |
+
|
| 39 |
+
classifier:
|
| 40 |
+
name: ERACE
|
| 41 |
+
kwargs:
|
| 42 |
+
num_classes: *total_cls_num
|
| 43 |
+
init_cls_num: *init_cls_num
|
| 44 |
+
inc_cls_num: *inc_cls_num
|
| 45 |
+
task_free: True
|
| 46 |
+
use_augs: False
|
config/zz_ERACE/erace-resnet18-imagenetr-b20-20-10.yaml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset imagenet-r
|
| 3 |
+
data_root: /data/Dataset/imagenet-r
|
| 4 |
+
|
| 5 |
+
total_cls_num: &total_cls_num 200
|
| 6 |
+
init_cls_num: &init_cls_num 20
|
| 7 |
+
inc_cls_num: &inc_cls_num 20
|
| 8 |
+
task_num: &task_num 10
|
| 9 |
+
image_size: &image_size 224
|
| 10 |
+
|
| 11 |
+
epoch: 1
|
| 12 |
+
seed: 2
|
| 13 |
+
|
| 14 |
+
batch_size: 10
|
| 15 |
+
testing_times: 1
|
| 16 |
+
|
| 17 |
+
optimizer:
|
| 18 |
+
name: SGD
|
| 19 |
+
kwargs:
|
| 20 |
+
lr: 0.1
|
| 21 |
+
|
| 22 |
+
buffer:
|
| 23 |
+
name: ERBuffer
|
| 24 |
+
kwargs:
|
| 25 |
+
capacity: 20000 # num_classes * M
|
| 26 |
+
|
| 27 |
+
backbone:
|
| 28 |
+
name: resnet18_AML
|
| 29 |
+
kwargs:
|
| 30 |
+
dataset: *dataset
|
| 31 |
+
num_classes: *total_cls_num
|
| 32 |
+
input_size: [3, *image_size, *image_size]
|
| 33 |
+
|
| 34 |
+
classifier:
|
| 35 |
+
name: ERACE
|
| 36 |
+
kwargs:
|
| 37 |
+
num_classes: *total_cls_num
|
| 38 |
+
init_cls_num: *init_cls_num
|
| 39 |
+
inc_cls_num: *inc_cls_num
|
| 40 |
+
task_free: True
|
| 41 |
+
use_augs: False
|
config/zz_ERACE/erace.yaml
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
dataset: &dataset binary_cifar100
|
| 3 |
+
data_root: /home/lvqiexuan/temp_data/binary_cifar100
|
| 4 |
+
|
| 5 |
+
total_cls_num: &total_cls_num 100
|
| 6 |
+
init_cls_num: &init_cls_num 5
|
| 7 |
+
inc_cls_num: &inc_cls_num 5
|
| 8 |
+
task_num: &task_num 20
|
| 9 |
+
image_size: &image_size 32
|
| 10 |
+
|
| 11 |
+
epoch: 1
|
| 12 |
+
seed: 2
|
| 13 |
+
|
| 14 |
+
batch_size: 10
|
| 15 |
+
testing_times: 1
|
| 16 |
+
|
| 17 |
+
train_trfms:
|
| 18 |
+
- ToTensor: {}
|
| 19 |
+
- Normalize:
|
| 20 |
+
mean: [0.5, 0.5, 0.5]
|
| 21 |
+
std: [0.5, 0.5, 0.5]
|
| 22 |
+
- RandomCrop:
|
| 23 |
+
size: *image_size
|
| 24 |
+
padding: 4
|
| 25 |
+
padding_mode: constant
|
| 26 |
+
fill: -1
|
| 27 |
+
- RandomHorizontalFlip: {}
|
| 28 |
+
|
| 29 |
+
test_trfms:
|
| 30 |
+
- ToTensor: {}
|
| 31 |
+
- Normalize:
|
| 32 |
+
mean: [0.5, 0.5, 0.5]
|
| 33 |
+
std: [0.5, 0.5, 0.5]
|
| 34 |
+
|
| 35 |
+
optimizer:
|
| 36 |
+
name: SGD
|
| 37 |
+
kwargs:
|
| 38 |
+
lr: 0.1
|
| 39 |
+
|
| 40 |
+
buffer:
|
| 41 |
+
name: ERBuffer
|
| 42 |
+
kwargs:
|
| 43 |
+
capacity: 10000 # num_classes * M
|
| 44 |
+
|
| 45 |
+
backbone:
|
| 46 |
+
name: resnet18_AML
|
| 47 |
+
kwargs:
|
| 48 |
+
dataset: *dataset
|
| 49 |
+
num_classes: *total_cls_num
|
| 50 |
+
|
| 51 |
+
classifier:
|
| 52 |
+
name: ERACE
|
| 53 |
+
kwargs:
|
| 54 |
+
num_classes: *total_cls_num
|
| 55 |
+
init_cls_num: *init_cls_num
|
| 56 |
+
inc_cls_num: *inc_cls_num
|
| 57 |
+
task_free: True
|
| 58 |
+
use_augs: False
|
config/zz_ERAML/eraml-resnet18-5dataset-b10-10-5.yaml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset 5-datasets
|
| 2 |
+
data_root: /data/Dataset/5-dataset
|
| 3 |
+
class_order: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
| 4 |
+
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
| 5 |
+
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
| 6 |
+
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
|
| 7 |
+
40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
total_cls_num: &total_cls_num 50
|
| 11 |
+
init_cls_num: &init_cls_num 10
|
| 12 |
+
inc_cls_num: &inc_cls_num 10
|
| 13 |
+
task_num: &task_num 5
|
| 14 |
+
image_size: &image_size 32
|
| 15 |
+
|
| 16 |
+
epoch: 1
|
| 17 |
+
|
| 18 |
+
batch_size: 10
|
| 19 |
+
testing_times: 1
|
| 20 |
+
|
| 21 |
+
optimizer:
|
| 22 |
+
name: SGD
|
| 23 |
+
kwargs:
|
| 24 |
+
lr: 0.1
|
| 25 |
+
|
| 26 |
+
buffer:
|
| 27 |
+
name: ERBuffer
|
| 28 |
+
kwargs:
|
| 29 |
+
capacity: 10000 # num_classes * M
|
| 30 |
+
|
| 31 |
+
backbone:
|
| 32 |
+
name: resnet18_AML
|
| 33 |
+
kwargs:
|
| 34 |
+
dataset: *dataset
|
| 35 |
+
num_classes: *total_cls_num
|
| 36 |
+
|
| 37 |
+
classifier:
|
| 38 |
+
name: ERAML
|
| 39 |
+
kwargs:
|
| 40 |
+
num_classes: *total_cls_num
|
| 41 |
+
init_cls_num: *init_cls_num
|
| 42 |
+
inc_cls_num: *inc_cls_num
|
| 43 |
+
task_free: True
|
| 44 |
+
use_augs: False
|
| 45 |
+
supcon_temperature: 0.2
|
| 46 |
+
use_minimal_selection: False
|
config/zz_ERAML/eraml-resnet18-imagenetr-b20-20-10.yaml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset imagenet-r
|
| 2 |
+
data_root: /data/Dataset/imagenet-r
|
| 3 |
+
|
| 4 |
+
total_cls_num: &total_cls_num 200
|
| 5 |
+
init_cls_num: &init_cls_num 20
|
| 6 |
+
inc_cls_num: &inc_cls_num 20
|
| 7 |
+
task_num: &task_num 10
|
| 8 |
+
image_size: &image_size 224
|
| 9 |
+
|
| 10 |
+
epoch: 1
|
| 11 |
+
|
| 12 |
+
batch_size: 10
|
| 13 |
+
testing_times: 1
|
| 14 |
+
|
| 15 |
+
optimizer:
|
| 16 |
+
name: SGD
|
| 17 |
+
kwargs:
|
| 18 |
+
lr: 0.1
|
| 19 |
+
|
| 20 |
+
buffer:
|
| 21 |
+
name: ERBuffer
|
| 22 |
+
kwargs:
|
| 23 |
+
capacity: 20000 # num_classes * M
|
| 24 |
+
|
| 25 |
+
backbone:
|
| 26 |
+
name: resnet18_AML
|
| 27 |
+
kwargs:
|
| 28 |
+
dataset: *dataset
|
| 29 |
+
num_classes: *total_cls_num
|
| 30 |
+
input_size: [3, *image_size, *image_size]
|
| 31 |
+
|
| 32 |
+
classifier:
|
| 33 |
+
name: ERAML
|
| 34 |
+
kwargs:
|
| 35 |
+
num_classes: *total_cls_num
|
| 36 |
+
init_cls_num: *init_cls_num
|
| 37 |
+
inc_cls_num: *inc_cls_num
|
| 38 |
+
task_free: True
|
| 39 |
+
use_augs: False
|
| 40 |
+
supcon_temperature: 0.2
|
| 41 |
+
use_minimal_selection: False
|
config/zz_ERAML/eraml.yaml
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset: &dataset binary_cifar100
|
| 2 |
+
total_cls_num: &total_cls_num 100
|
| 3 |
+
init_cls_num: &init_cls_num 5
|
| 4 |
+
inc_cls_num: &inc_cls_num 5
|
| 5 |
+
task_num: &task_num 20
|
| 6 |
+
image_size: &image_size 32
|
| 7 |
+
|
| 8 |
+
data_root: /home/lvqiexuan/temp_data/binary_cifar100
|
| 9 |
+
|
| 10 |
+
epoch: 1
|
| 11 |
+
|
| 12 |
+
batch_size: 10
|
| 13 |
+
testing_times: 1
|
| 14 |
+
|
| 15 |
+
train_trfms:
|
| 16 |
+
- ToTensor: {}
|
| 17 |
+
- Normalize:
|
| 18 |
+
mean: [0.5, 0.5, 0.5]
|
| 19 |
+
std: [0.5, 0.5, 0.5]
|
| 20 |
+
- RandomCrop:
|
| 21 |
+
size: *image_size
|
| 22 |
+
padding: 4
|
| 23 |
+
padding_mode: constant
|
| 24 |
+
fill: -1
|
| 25 |
+
- RandomHorizontalFlip: {}
|
| 26 |
+
|
| 27 |
+
test_trfms:
|
| 28 |
+
- ToTensor: {}
|
| 29 |
+
- Normalize:
|
| 30 |
+
mean: [0.5, 0.5, 0.5]
|
| 31 |
+
std: [0.5, 0.5, 0.5]
|
| 32 |
+
|
| 33 |
+
optimizer:
|
| 34 |
+
name: SGD
|
| 35 |
+
kwargs:
|
| 36 |
+
lr: 0.1
|
| 37 |
+
|
| 38 |
+
buffer:
|
| 39 |
+
name: ERBuffer
|
| 40 |
+
kwargs:
|
| 41 |
+
capacity: 10000 # num_classes * M
|
| 42 |
+
|
| 43 |
+
backbone:
|
| 44 |
+
name: resnet18_AML
|
| 45 |
+
kwargs:
|
| 46 |
+
dataset: *dataset
|
| 47 |
+
num_classes: *total_cls_num
|
| 48 |
+
|
| 49 |
+
classifier:
|
| 50 |
+
name: ERAML
|
| 51 |
+
kwargs:
|
| 52 |
+
num_classes: *total_cls_num
|
| 53 |
+
init_cls_num: *init_cls_num
|
| 54 |
+
inc_cls_num: *inc_cls_num
|
| 55 |
+
task_free: True
|
| 56 |
+
use_augs: False
|
| 57 |
+
supcon_temperature: 0.2
|
| 58 |
+
use_minimal_selection: False
|