Requires Python 3.7+.
One of the dependencies is PyTorch. If your system is not compatible with the default torch installation (for example if you require a specific CUDA installation), then please install this from pytorch.org as required. If so, it's recommended that you do this first.
We have provided a setup.py
file with the dependencies.
To install this package, pip install -e /path/to/this/dir
The compare.sh
script runs all the variants of our method.
This dataset is included in the repository.
bash scripts/compare.sh data=adult/gender bias=adult/partial_outcome enc=adult adapt=adult/on_enc_with_bags clust=adult
For the "no-cluster" baseline, the bag size needs to be changed:
python run_ss.py adapt.balanced_context=false misc.log_method=no-cluster-fdm data=adult/gender bias=adult/partial_outcome enc=adult adapt=adult/on_enc_with_bags clust=adult adapt.bag_size=32 adapt.batch_size=16
bash scripts/compare.sh data=adult/gender bias=adult/missing_demo enc=adult adapt=adult/on_enc_with_bags clust=adult
For the "no-cluster" baseline, the bag size needs to be changed:
python run_ss.py adapt.balanced_context=false misc.log_method=no-cluster-fdm data=adult/gender bias=adult/missing_demo enc=adult adapt=adult/on_enc_with_bags clust=adult adapt.bag_size=32 adapt.batch_size=16
This dataset will be downloaded automatically.
bash scripts/compare.sh +experiment=cmnist_subgroup_bias
bash scripts/compare.sh +experiment=cmnist_missing_subgroup
bash scripts/compare.sh data=cmnist/3dig bias=cmnist/3dig/4miss enc=mnist adapt=cmnist/mostly_traditional clust=vague_spaceship_improved adapt.iters=20000 adapt.zs_dim=2
The code will try to download this, but the download quota is often saturated, so it might not work immediately.
bash scripts/compare.sh +experiment=celeba_gender