Skip to content

jvaquet/Compression-Based-kNN

Repository files navigation

Compression-based kNN for Class Incremental Continual Learning

This repository accompanies the publication [Compression-based kNN for Class Incremental Continual Learning](TODO add link)

Requirements

To preprocess the data, you need python 3.12 with the dependencies listed in requirements_preprocessing.txt.

To run the experiments, you need python 3.7 with the dependencies listed in the requirements_experiments.txt. Additionally, you need to slightly modify the SAM-kNN implementation from scikit-multiflow in order to disable the cleaning step. Sadly, this is not possible without modifying the library code. To disable the cleaning step, in the file skmultiflow/lazy/sam_knn.py add return samplesCl, labelsCl after line 231, such that the clean_samples function cleans no samples:

def clean_samples(self, samplesCl, labelsCl, onlyLast=False):
    return samplesCl, labelsCl
    [...]

Datasets

In order to run the experiments, you need to download two datasets. Download both and place them in the data directory. The datasets required are:

To preprocess the data for our experiments, run the generateEmbeddings.ipynb notebook. This will generate additional files in the data directory.

Run Experiments

To run the experiments, run the runExperimentSAMkNN.ipynb, runExperimentSAMkNN_balanced.ipynb and runExperimentCompressionKNN.ipynb notebooks. For each experiment, the task size can be changed by editing the TASK_SIZE constant at the top of each notebook. For the compression kNN experiment, additionally the number of samples per class can be configured.

Each notebook will save results to disk in a corresponding results folder.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors