Skip to content

johannnamr/Discrepancy-based-inference-using-QMC

Repository files navigation

Discrepancy-based-inference-for-generative-models-using-QMC

This repository contains the python code to recreate the numerical experiments in the paper "Discrepancy-based Inference for Generative Models using QMC" by Ziang Niu, Johanna Meier and François-Xavier Briol published in the Electronic Journal of Statistics (https://doi.org/10.1214/23-EJS2131). It is optimised for the use with Google Colab and mounts the Google drive to load other required notebooks located in the default folder for Colab notebooks. For local use, file paths have to be adjusted where indicated.

Contents of sub-folders:

Generating-vecs-and-mats

Generating vectors and matrices for lattices:

  • lattice_vec.600.20.npy for order-2 lattice
  • lattice_vec.600.13.npy for order-8 lattice

The vectors are taken from Dirk Nuyens' Magic Point Shop.

Helper-functions

Helper functions:

  • Utils.ipynb: functions for convergence and optimisation experiments
  • Plot_fcts.ipynb: plotting funtions
  • ot_slicedW.ipynb: adapted source code of the POT library for sliced Wasserstein distances

The first two notebooks are loaded in all other notebooks listed below, so that their file paths might need to be adjusted where indicated. The third notebook is loaded in all sliced Wasserstein distance applications.

Inference

Bv-beta-distribution

Results for the bivariate beta distribution:

  • bibeta_check.ipynb: test of kernel, generator and all partial derivatives
  • bibeta_conv_mmd2.ipynb: convergence of the squared MMD using MC, QMC and RQMC
  • bibeta_conv_W.ipynb: convergence of the Wasserstein distance using MC, QMC and RQMC
  • bibeta_conv_sink.ipynb: convergence of the Sinkhorn divergence using MC, QMC and RQMC
  • bibeta_conv_slicedW.ipynb: convergence of the sliced Wasserstein distance using MC, QMC and RQMC
  • bibeta_optim.ipynb: optimisation procedure for squared MMD using MC, QMC and RQMC

G-and-k-distribution

Results for the univariate g-and-k distribution:

  • gandk_check.ipynb: test of kernel, generator and all partial derivatives
  • gandk_optim.ipynb: optimisation procedure for squared MMD using MC, QMC and RQMC

Mv-g-and-k-distribution

Results for the multivariate g-and-k distribution:

  • mvgandk_check.ipynb: test of kernel, generator and all partial derivatives
  • mvgandk_conv_mmd2.ipynb: convergence of the squared MMD using MC, QMC and RQMC
  • mvgandk_conv_sink.ipynb: convergence of the Sinkhorn divergence using MC, QMC and RQMC
  • mvgandk_conv_slicedW.ipynb: convergence of the sliced Wasserstein distance using MC, QMC and RQMC
  • mvgandk_times.ipynb: comparison of the computational cost for sampling from the multivariate g-and-k distribution using MC and QMC
  • mvgandk_optim.ipynb: optimisation procedure for squared MMD using MC, QMC and RQMC

Variational autoencoder

Results for the variational autoencoder:

  • vae_optim_mc.ipynb: optimisation procedure for Sinkhorn divergence using MC
  • vae_optim_qmc.ipynb: optimisation procedure for Sinkhorn divergence using RQMC
  • vae_times.ipynb: comparison of the computational cost for sampling from the VAE using MC and QMC
  • vae_sample_complexity.ipynb: convergence of Sinkhorn divergence using MC and RQMC

Sample complexity

Uniform

Results for the uniform distribution:

  • Unif_conv_mmd2.ipynb: convergence of the squared MMD using MC, QMC and RQMC
  • Unif_conv_W.ipynb: convergence of the Wasserstein distance using MC, QMC and RQMC
  • Unif_conv_sink.ipynb: convergence of the Sinkhorn divergence using MC, QMC and RQMC
  • Unif_conv_slicedW.ipynb: convergence of the sliced Wasserstein distance using MC, QMC and RQMC

Gaussian

Results for the Gaussian distribution:

  • Gaussian_conv_mmd2.ipynb: convergence of the squared MMD using MC, QMC and RQMC
  • Gaussian_conv_W.ipynb: convergence of the Wasserstein distance using MC, QMC and RQMC
  • Gaussian_conv_sink.ipynb: convergence of the Sinkhorn divergence using MC, QMC and RQMC
  • Gaussian_conv_slicedW.ipynb: convergence of the sliced Wasserstein distance using MC, QMC and RQMC

Visualisations

Notebooks containing the summarising figures

  • Illustration_QMC.ipynb: comparison of MC and QMC point sets (figure 1)
  • Inference.ipynb: plots for bivariate beta, univariate g-and-k, multivariate g-and-k distributions and the variational autoencoder
  • MC_vs_QMC_times.ipynb: comparison of python libraries for MC and QMC sampling
  • Sample_complexity.ipynb: plots for uniform and Gaussian distributions

About

Python code to recreate the results of the paper "Discrepancy-based Inference for Generative Models using QMC" by Ziang Niu, Johanna Meier and François-Xavier Briol (https://arxiv.org/abs/2106.11561).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published