Skip to content

facebookresearch/difFOCI

difFOCI

Code to replicate the experimental results from A differentiable rank-based objective for better feature learning.

Replicating the main results

Installing dependencies

To set up a working environment for this repository, you can create a conda environment using the following commands:

conda env create -f environment.yaml
conda activate diffoci

If conda is not available, please install the dependencies listed in the requirements.txt file.

Running all experiments

The code for reproducing the experiments and obtaining the numbers in Tables 1-4 can be found in the corresponding ipynb notebooks:

  • Table_1.ipynb -> Synthetic and Toy experiments
  • Table_2.ipynb -> Feature selection and Dimensionality Reduction
  • Table_3.ipynb -> Spurious correlations and Domain Adaptation
  • Table_4.ipynb -> Fairness

Download, extract and generate metadata for Waterbirds dataset

This script downloads, extracts and formats the datasets metadata so that it works with the rest of the code out of the box.

python setup_datasets.py --download --data_path data

Launch jobs for Waterbirds

To reproduce the Waterbirds experiments on a SLURM cluster :

python train.py --data_path data --output_dir main_sweep --partition <slurm_partition>

License

This source code is released under the CC-BY license, included here.

Citations:

  1. Chatterjee (2020). "A new coefficient of correlation"
  2. Azadkia and Chatterjee (2021). "A simple measure of conditional dependence"

About

GitHub repository for the work A Differentiable Rank-Based Objective for Better Feature Learning.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published