Code for running experiments using the LBCM
This code was made to run on Python 3.7+ and I recommend using conda to create an environment.
You will need the following packages (which I recommend acquiring using conda-forge)
- numpy
- scipy
- pot (Python OT)
- matplotlib
- cvxopt
In addition you will need access to the MNIST dataset which is publicly available. This can be done using either the mnist package which is available here or by using tensorflow. The default location that it is expected to be is inside a folder named mnist in the same folder as the code.
To run the demos, activate the environment with the dependencies installed and run either python mnist_demo.py or python gauss_demo.py or python mnist_diff_base.py
This compares the recovery of a corrupted MNIST digit using either the BCM or the LBCM with two different base measures. It is set to use 20 references on the digit '4'. The two base measures considered are 1. The uniform image over the 28x28 grid or 2. The (Convolutional) Barycenter of the reference images.
This runs a further version of the MNIST Demo using different and more exotic choices of the base measure.
This demo compares the recovery of a Gaussian covariance matrix from samples. There are four recovery methods considered: 1. The empirical covariance, 2. The method considered in The BCM paper 3. The LBCM with identity reference measure 4. The LBCM with the barycenter of the references. The default settings are 10 refefences and 10 dimensions.