Skip to content

Reproducibility code for Robust Kernel Hypothesis Testing under Data Corruption, by Schrab and Kim

License

Notifications You must be signed in to change notification settings

antoninschrab/dckernel-paper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reproducibility code for dcMMD & dcHSIC

Robust Kernel Hypothesis Testing under Data Corruption

This GitHub repository contains the code for the reproducible experiments presented in our paper Robust Kernel Hypothesis Testing under Data Corruption.

The code is written in JAX which can leverage the architecture of GPUs to provide considerable computational speedups.

Installation

In a chosen directory, clone the repository and change to its directory by executing

git clone git@github.com:antoninschrab/dckernel-paper.git
cd dckernel-paper

We then recommend creating a conda environment with the required dependencies:

conda create -n dckernel-env
conda activate dckernel-env
# install JAX for GPU:
pip install -U "jax[cuda12]"
# or install JAX for CPU:
pip install -U "jax[cpu]"
# install all other dependencies
conda install numpy scipy scikit-learn matplotlib tqdm

To run only dcMMD and dcHSIC it is sufficient to only install JAX as explained in our dckernel repository.

Reproducibility of the experiments

The code to reproduce the experiments of the paper can be found in the experiments.ipynb notebook.

For the experiments, the results and figures are saved in the results and figures directories, respectively.

How to use dcMMD and dcHSIC in practice?

Our proposed dcMMD and dcHSIC tests are implemented in dctests.py.

To use our tests in practice, we recommend using our dckernel package which is available on the dckernel repository. It can be installed by running

pip install git+https://github.com/antoninschrab/dckernel.git

Installation instructions and example code are available on the dckernel repository.

We also illustrate how to use the tests in the demo section of the notebook experiments.ipynb.

References

Contact

If you have any issues running our code, please do not hesitate to contact Antonin Schrab.

Affiliations

Centre for Artificial Intelligence, Department of Computer Science, University College London

Gatsby Computational Neuroscience Unit, University College London

Inria London

Bibtex

@unpublished{schrab2024robust,
title={Robust Kernel Hypothesis Testing under Data Corruption}, 
author={Antonin Schrab and Ilmun Kim},
year={2024},
url = {https://arxiv.org/abs/2405.19912},
eprint={2405.19912},
archivePrefix={arXiv},
primaryClass={stat.ML}
}

License

MIT License (see LICENSE).

Related tests

  • mmdagg: MMD Aggregated MMDAgg test
  • ksdagg: KSD Aggregated KSDAgg test
  • agginc: Efficient MMDAggInc HSICAggInc KSDAggInc tests
  • mmdfuse: MMD-Fuse test
  • dpkernel: Differentially private dpMMD dpHSIC tests