**NOTE:** 
Due to large filesizes and requirement for anonymity, 
we are unable to provide the pretrained checkpoints at the
present time.

File Descriptions:

train_quantile : Code to train for quantile representations.
quantile_network : Wrapper around the pre-trained model to train/test/validate
    quantile representations.
quantile_datamodule : Wrapper which creates the quantile datasets with modified labels.
resnet.py, densenet.py : Resnet and Densenet architectures
config.py : configuration to train the pytorch-lightning module
dataset_distorted.py : Pytorch torchvision wrapper for CIFAR10C
utils_train : Required for loading pretrained models, datasets and associated transforms. 
generate_calib_results.py : Used to generate the calibration experiment results.
generate_ood_logistic : Used to generate the OOD results.

The pretrained models have been downloaded from:

wget https://www.dropbox.com/s/ynidbn7n7ccadog/resnet_cifar10.pth
wget https://www.dropbox.com/s/uvgpgy9pu7s9ps2/resnet_svhn.pth

Two datasets are used - CIFAR10 and SVHN. These datasets can be obtained from
pytorch.torchvision.datasets.

Three experiments are performed using the generated quantile representations.

1) Reconstructing the data in input space from quantile representations is
    described in MapQuantiles.ipynb

2) OOD detection and comparing with baseline. 5 OOD datasets are used which can be 
downloaded from sources. 

wget https://www.dropbox.com/s/avgm2u562itwpkl/Imagenet.tar.gz
wget https://www.dropbox.com/s/kp3my3412u5k9rl/Imagenet_resize.tar.gz
wget https://www.dropbox.com/s/fhtsw1m3qxlwj6h/LSUN.tar.gz
wget https://www.dropbox.com/s/moqh2wh8696c3yl/LSUN_resize.tar.gz
wget https://www.dropbox.com/s/ssz7qxfqae0cca5/iSUN.tar.gz

The code for computing the OOD scores is available in 'generate_ood_logistic.py'.

3) For calibration experiment we use the CIFAR10C dataset which can be downloaded from 

wget https://zenodo.org/record/2235448/files/blur.tar?download=1
wget https://zenodo.org/record/2235448/files/digital.tar?download=1
wget https://zenodo.org/record/2235448/files/extra.tar?download=1
wget https://zenodo.org/record/2235448/files/noise.tar?download=1
wget https://zenodo.org/record/2235448/files/weather.tar?download=1


Code for generating the Figure1 of the article can be found 'GenerateFigure1.ipynb'.
Code for generating the Figure4 of the appendix can be found 'GenerateFigure_Appendix.ipynb'.
Code for generating figure6 of the appendix can be found in 'QuantileRepWithShiftV2.ipynb'




