Skip to content

sbdzdz/disco

Repository files navigation

🪩 Disco: Disentangled Continual Learning

Code style: black

Infinite dSprites for Disentangled Continual Learning: Separating Memory Edits from Generalization

Published at CoLLAs 2024.

Install

Install the requirements and the package (ideally in a virtual environment):

python -m pip install -r requirements.txt
python -m pip install -e .

Getting started

Here's how to use the dataset:

from torch.utils.data import DataLoader
from disco.data import InfiniteDSprites

dataset = InfiniteDSprites()
dataloader = DataLoader(dataset, batch_size=4)

batch = next(iter(dataloader))
draw_batch(batch, show=True)

For other use cases and a more detailed introduction, see the notebooks in the examples folder.

Plots

To reproduce the paper plots, see plots.sh script.

Rendering the figures requires TeX Live. To install it on macOS, use Homebrew:

brew install --cask mactex

Make sure the executables are in your PATH:

find / -name kpsewhich 2>/dev/null

Add the directory from the output to your PATH, e.g.:

export PATH=/usr/local/texlive/2023/bin/universal-darwin:$PAT