Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
FNC2 Memory-efficient continual learning
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
V
Vincent Nguyen
Data Efficiency
FNC2 Memory-efficient continual learning
Commits
3f38e094
Commit
3f38e094
authored
Jun 28, 2026
by
dangtrunganh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit
parent
eaea3ef3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
165 deletions
+15
-165
README.md
README.md
+9
-58
run_calibration.sh
scripts/calibration/run_calibration.sh
+0
-8
fc_nccl_cf10.sh
scripts/train/fc_nccl/fc_nccl_cf10.sh
+2
-5
fc_nccl_cf100.sh
scripts/train/fc_nccl/fc_nccl_cf100.sh
+2
-5
fc_nccl_tiny_imagenet.sh
scripts/train/fc_nccl/fc_nccl_tiny_imagenet.sh
+2
-5
ta_nccl_samix_cf10.sh
scripts/train/ta_nccl/ta_nccl_samix_cf10.sh
+0
-28
ta_nccl_samix_cf100.sh
scripts/train/ta_nccl/ta_nccl_samix_cf100.sh
+0
-28
ta_nccl_samix_tiny_imagenet.sh
scripts/train/ta_nccl/ta_nccl_samix_tiny_imagenet.sh
+0
-28
No files found.
README.md
View file @
3f38e094
#
SAMix
#
FC-NCCL
Official code for:
**"
SAMix: Calibrated and Accurate Continual Learning via Sphere-Adaptive Mixup and Neural Collapse"**
**"
Memory-efficient Continual Learning with Neural Collapse Contrastive"**
(WACV2025)
---
## 🛠️ Prerequisites
...
...
@@ -82,59 +82,27 @@ Official code for:
### 4.1. CIFAR-10
- **FC-NCCL with SAMix**
```bash
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/fc_nccl/fc_nccl_samix_cf10.sh
```
- **TA-NCCL with SAMix**
```bash
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/
ta_nccl/ta_nccl_samix
_cf10.sh
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/
fc_nccl/fc_nccl
_cf10.sh
```
### 4.2. CIFAR-100
- **FC-NCCL with SAMix**
```bash
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/fc_nccl/fc_nccl_samix_cf100.sh
```
- **TA-NCCL with SAMix**
```bash
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/
ta_nccl/ta_nccl_samix
_cf100.sh
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/
fc_nccl/fc_nccl
_cf100.sh
```
### 4.3. Tiny-ImageNet
- **FC-NCCL with SAMix**
```bash
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/fc_nccl/fc_nccl_samix_tiny_imagenet.sh
```
- **TA-NCCL with SAMix**
```bash
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/
ta_nccl/ta_nccl_samix
_tiny_imagenet.sh
MEM_SIZE=200 LOG_FOLDER_ZERO_MEM=not-use bash scripts/train/
fc_nccl/fc_nccl
_tiny_imagenet.sh
```
> **Note 1:**
> Set `LOG_FOLDER_ZERO_MEM` to the log folder containing 200 auxiliary samples if `MEM_SIZE=0` (memory-free setting).
> **Note 2:**
> **To run without SAMix:**
> 1. Remove these arguments:
> ```bash
> --samix \
> --loss_normal_samples fnc2 \
> --weight_samix_loss 5.0 \
> ```
> 2. Change `--loss nc_samix` to:
> ```bash
> --loss fnc2
> ```
> or
> ```bash
> --loss dr
> ```
> 3. If using `--loss fnc2`, add `--focal_gamma` and `--main_mark`
> **Note:**
> Set `LOG_FOLDER_ZERO_MEM` to the log folder containing 200 auxiliary samples if `MEM_SIZE=0` (memory-free setting).
---
## 🧪 Evaluation
...
...
@@ -157,22 +125,6 @@ CHECKPOINT_FOLDER=/path/check/point/folder LOG_FOLDER=/path/log/folder/ bash scr
---
## 📊 Network Calibration
**Modify bash file:** "scripts/calibration/run_calibration.sh", and then run:
```
bash
bash scripts/calibration/run_calibration.sh
```
This will compute and display:
- Expected Calibration Error (ECE) each task
- Overconfidence Error (OE) each task
- Average Expected Calibration Error (AECE)
- Average Overconfidence Error (AOE)
---
## 📂 Project Structure
```
...
...
@@ -216,4 +168,3 @@ root_path: in 'root_save_folder' in config/base.yaml
│ │ │ │── prototypes_dim={d}_k={n_cls}_seed={seed}.npy
│ │ │ │── subset_indices_random_{i}.npy
│ │ │ │── replay_indices_random_{i}.npy
scripts/calibration/run_calibration.sh
deleted
100644 → 0
View file @
eaea3ef3
#!/bin/bash
# Run calibration computation
python main_compute_calibration.py
\
--dataset
cifar10
\
--target_task
4
\
--n_bins
10
\
--checkpoint_path
\p
ath
\c
heckpoint_name.pth
\
--classifier_path
\p
ath
\c
lassifier.pth
\ No newline at end of file
scripts/train/fc_nccl/fc_nccl_
samix_
cf10.sh
→
scripts/train/fc_nccl/fc_nccl_cf10.sh
View file @
3f38e094
...
...
@@ -17,14 +17,11 @@ python3 -W ignore main_train.py \
--wandb
\
--wandb_project_name
your_project_name
\
--wandb_entity
your_entity
\
--job_run_name
fcnccl-
samix-
cf10-m-
${
MEM_SIZE
}
\
--job_run_name
fcnccl-cf10-m-
${
MEM_SIZE
}
\
--distillation
hsd
\
--log_folder_zero_mem
${
LOG_FOLDER_ZERO_MEM
}
\
--loss
nc_samix
\
--loss_normal_samples
fnc2
\
--weight_samix_loss
5.0
\
--loss
fnc2
\
--filter_distillation_point
\
--samix
\
--predictor_hidden_dim
128
\
--main_mark
30
\
--focal_gamma
1
\ No newline at end of file
scripts/train/fc_nccl/fc_nccl_
samix_
cf100.sh
→
scripts/train/fc_nccl/fc_nccl_cf100.sh
View file @
3f38e094
...
...
@@ -17,14 +17,11 @@ python3 -W ignore main_train.py \
--wandb
\
--wandb_project_name
your_project_name
\
--wandb_entity
your_entity
\
--job_run_name
fcnccl-
samix-
cf100-m-
${
MEM_SIZE
}
\
--job_run_name
fcnccl-cf100-m-
${
MEM_SIZE
}
\
--distillation
hsd
\
--log_folder_zero_mem
${
LOG_FOLDER_ZERO_MEM
}
\
--loss
nc_samix
\
--loss_normal_samples
fnc2
\
--weight_samix_loss
5.0
\
--loss
fnc2
\
--filter_distillation_point
\
--samix
\
--predictor_hidden_dim
128
\
--main_mark
30
\
--focal_gamma
4
\ No newline at end of file
scripts/train/fc_nccl/fc_nccl_
samix_
tiny_imagenet.sh
→
scripts/train/fc_nccl/fc_nccl_tiny_imagenet.sh
View file @
3f38e094
...
...
@@ -17,14 +17,11 @@ python3 -W ignore main_train.py \
--wandb
\
--wandb_project_name
your_project_name
\
--wandb_entity
your_entity
\
--job_run_name
fcnccl-
samix-
tiny-imagenet-m-
${
MEM_SIZE
}
\
--job_run_name
fcnccl-tiny-imagenet-m-
${
MEM_SIZE
}
\
--distillation
hsd
\
--log_folder_zero_mem
${
LOG_FOLDER_ZERO_MEM
}
\
--loss
nc_samix
\
--loss_normal_samples
fnc2
\
--weight_samix_loss
5.0
\
--loss
fnc2
\
--filter_distillation_point
\
--samix
\
--predictor_hidden_dim
256
\
--main_mark
20
\
--focal_gamma
4
\ No newline at end of file
scripts/train/ta_nccl/ta_nccl_samix_cf10.sh
deleted
100644 → 0
View file @
eaea3ef3
python3
-W
ignore main_train.py
\
--seed
1234
\
--batch_size
512
\
--model
resnet18
\
--dataset
cifar10
\
--mem_size
$MEM_SIZE
\
--epochs
100
\
--start_epoch
500
\
--learning_rate
0.5
\
--temperature
0.5
\
--current_temp
0.2
\
--past_temp
0.01
\
--current_temp_sprd
0.2
\
--past_temp_sprd
0.1
\
--cosine
\
--num_workers
16
\
--wandb
\
--wandb_project_name
your_project_name
\
--wandb_entity
your_entity
\
--job_run_name
tanccl-samix-cf00-m-
${
MEM_SIZE
}
\
--distillation
hsd
\
--log_folder_zero_mem
${
LOG_FOLDER_ZERO_MEM
}
\
--loss
nc_samix
\
--loss_normal_samples
dr
\
--weight_samix_loss
5.0
\
--filter_distillation_point
\
--samix
\
--predictor_hidden_dim
128
scripts/train/ta_nccl/ta_nccl_samix_cf100.sh
deleted
100644 → 0
View file @
eaea3ef3
python3
-W
ignore main_train.py
\
--seed
1234
\
--batch_size
512
\
--model
resnet18
\
--dataset
cifar100
\
--mem_size
$MEM_SIZE
\
--epochs
100
\
--start_epoch
500
\
--learning_rate
0.5
\
--temperature
0.5
\
--current_temp
0.2
\
--past_temp
0.01
\
--current_temp_sprd
0.2
\
--past_temp_sprd
0.1
\
--cosine
\
--num_workers
16
\
--wandb
\
--wandb_project_name
your_project_name
\
--wandb_entity
your_entity
\
--job_run_name
tanccl-samix-cf100-m-
${
MEM_SIZE
}
\
--distillation
hsd
\
--log_folder_zero_mem
${
LOG_FOLDER_ZERO_MEM
}
\
--loss
nc_samix
\
--loss_normal_samples
dr
\
--weight_samix_loss
5.0
\
--filter_distillation_point
\
--samix
\
--predictor_hidden_dim
128
scripts/train/ta_nccl/ta_nccl_samix_tiny_imagenet.sh
deleted
100644 → 0
View file @
eaea3ef3
python3
-W
ignore main_train.py
\
--seed
1234
\
--batch_size
512
\
--model
resnet18
\
--dataset
tiny-imagenet
\
--mem_size
$MEM_SIZE
\
--epochs
50
\
--start_epoch
500
\
--learning_rate
0.1
\
--temperature
0.5
\
--current_temp
0.1
\
--past_temp
0.1
\
--current_temp_sprd
0.2
\
--past_temp_sprd
0.1
\
--cosine
\
--num_workers
16
\
--wandb
\
--wandb_project_name
your_project_name
\
--wandb_entity
your_entity
\
--job_run_name
tanccl-samix-tiny-imagenet-m-
${
MEM_SIZE
}
\
--distillation
hsd
\
--log_folder_zero_mem
${
LOG_FOLDER_ZERO_MEM
}
\
--loss
nc_samix
\
--loss_normal_samples
dr
\
--weight_samix_loss
5.0
\
--filter_distillation_point
\
--samix
\
--predictor_hidden_dim
256
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment