Code repository for the paper Bayesian Experimental Design via Contrastive Diffusions
-
diffuse/
: contains the source code of the Diffuse tool with the following files:mixtures.py
: contains the implementation of the mixture models for the test of toy diffusionsde.py
: Implementation of the Lin stochastic differential equations and its reverse-time counterpart used for samplingimages.py
: tools for image processing and masking for MNISTscore_matching.py
: implementation of the score matching loss used to train Diffusion Modelunet.py
: implementation of the U-Net architecture used for the Diffusion Modelmnist_train.py
: script to train the Diffusion Model on MNISTconditional.py
: implementation of the conditional sampling procedureinference.py
: utilities for conditional sampling procedureoptimizer.py
: joint sampling and optimization procedureplotting.py
: utilities for plotting the results
-
examples/
: contains the examples of use of the Diffuse tool with a test on a toy example with Gaussian Mixturesdesign_mnist.py
: script to run the design optimization on handwritten digits retrievalmixture_evolution.py
: plot evolution of the mixture models with noising and denoising process
-
test/
: contains the tests for the Diffuse tool with a test on a toy example with Gaussian Mixtures
Figure: Image reconstruction. First 6 experiments (rows): image ground truth, measurement at experiment
Figure: Optimized vs. random designs: measured outcome
For tests and plots of the diffusion on mixture of Gaussians:
pytest --plot