Skip to content
Variational Resampling Based Assessment of Deep Neural Networks Robustness under Distribution Shift
Python TeX R Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Bayesian_CNN @ 8c05f58
Pytorch-Utils @ 962b9c2
paper_2019_distribution_shift_resample @ 8f09ca0
tensorflow-generative-model-collections @ 3abde8a

Variational Gaussian Mixture model Cross Validation resampling of Bayesian and Frequest Neural Networks


  • pip install Cython
  • pip install pot
  • if you have conda, install pot with: conda install -c conda-forge pot
  • pip install -r requirements.txt

Tips on generating dependencies file

pip freeze

How to run or reproduce the experiment


  • clone a new repository and go to the root directory
  • make build (30mins for the first run on fujitsu-celcius) # equivalent to python --cluster True (train vae on all data and cluster), results could be stored in results/VAE_fashion-mnist_64_62/L-1 for example
  • make label (1 hours on fujitsu-celcius) # equivalent to python --labeled True --cluster True (train vae according to label and cluster each label, then merge), results could be stored in results/VAE_fashion-mnist_64_62/L0 unutil results/VAE_fashion-mnist_64_62/L9 for example
  • results for the two steps are stored in results/VAE_fashion-mnist_64_62 for example, where 62 is the latent space dimension of VAE (see configuration file named, while data is stored in /data/FashionMNIST for example

Evaluate Neural Network

  • change directory to refactor_Bayesian_CNN
  • make rand frand|vgmm|fvgmm_alexnet


  • before you run this command, you should previously run make build and make label
  • change directory to root folder
  • make wasser_cv_emd : compute wasserstein distance for random cross validation
  • make wasser_vgmm_emd: compute wasserstein distance for vgmm-vae cross validation
  • make t-SNE: generate t-SNE plot for all data divided by vgmm-vae (results could be stored in /results/VAE_fashion-mnist_64_62 for example)
  • make distribution_y: plot the histogram of class distribution for each cluster, result is store in distribution_y.txt


  • go to /plots and use the R code to generate the beautiful ggplot

Guide to the code


in root folder and refactor_Bayesian_CNN, files start with config stores global configuration parameters.

arguments for in project root

python --cluster <True,False (default)> --dataset <'mnist', 'fashion-mnist' (default)> --z_dim <1-inf,62(default)> --labeled <True,False (default)>

Misc Resources

Semi-supervised vae

python make

parallel job in python

to avoid no space on device problem when run parallel in pytorch


You can’t perform that action at this time.