Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions PyTorch/build-in/other/continual-learning/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG FROM_IMAGE_NAME=jfrog.tecorigin.net/tecotp-docker/release/ubuntu22.04/x86_64/pytorch:2.1.1-torch_sdaa2.1.1
FROM ${FROM_IMAGE_NAME}

WORKDIR /workspace/
ADD requirements.txt /workspace/
RUN rm -rf /bin/sh && ln -s /bin/bash /bin/sh
RUN source activate torch_env && pip install --no-cache-dir -r requirements.txt
ADD . /workspace/other/continual-learning
WORKDIR /workspace/other/continual-learning

ARG FROM_IMAGE_NAME=jfrog.tecorigin.net/tecotp-docker/release/ubuntu22.04/x86_64/pytorch:2.1.1-torch_sdaa2.1.1
FROM ${FROM_IMAGE_NAME}
54 changes: 54 additions & 0 deletions PyTorch/build-in/other/continual-learning/ICLRblogpost/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# On the computation of the Fisher Information in continual learning (2025, ICLR Blogpost)

The code in this repository is used for the experiments reported in the
[ICLR 2025 blog post "On the computation of the Fisher Information in continual learning"](https://iclr-blogposts.github.io/2025/blog/fisher/)
(or see the arXiv-preprint [here](https://arxiv.org/abs/2502.11756)).

This blog post compares the performance of Elastic Weight Consolidation (EWC) with various different ways of computing the diagonal elements of the Fisher Information matrix.
The following options are considered:
- **EXACT**
The elements of the Fisher Information are computed exactly. All training samples are used.
To use this option: `./main.py --ewc --fisher-labels='all'`

- **EXACT ($n$=500)**
The elements of the Fisher Information are computed exactly. Only 500 training samples are used.
To use this option: `./main.py --ewc --fisher-labels='all' --fisher-n=500`

- **SAMPLE**
The elements of the Fisher Information are estimated using a single Monte Carlo sample. All training samples are used.
To use this option: `./main.py --ewc --fisher-labels='sample'`

- **EMPIRICAL**
The empirical Fisher Information is used. All training samples are used.
To use this option: `./main.py --ewc --fisher-labels='true'`

- **BATCHED ($b$=128)**
The empirical Fisher Information is approximated using mini-batches (see blog post for details).
To use this option: `./main.py --ewc --fisher-labels='true' --fisher-batch=128`


To run the experiments from the blog post, the following lines of code can be used:

```bash
python3 ICLRblogpost/compare_FI.py --seed=1 --n-seeds=30 --experiment=splitMNIST --scenario=task
python3 ICLRblogpost/compare_FI.py --seed=1 --n-seeds=30 --experiment=CIFAR10 --scenario=task --reducedResNet --iters=2000 --lr=0.001
```


### Citation
If this is useful, please consider citing the blog post:
```
@inproceedings{vandeven2025fisher,
title={On the computation of the {F}isher {I}nformation in continual learning},
author={van de Ven, Gido M},
booktitle={ICLR Blogposts 2025},
year={2025},
date={April 28, 2025},
url={https://iclr-blogposts.github.io/2025/blog/fisher/}
}
```


### Acknowledgments
This project has been supported by a senior postdoctoral fellowship from the
Resarch Foundation -- Flanders (FWO) under grant number 1266823N.
Loading