Experiments on MNIST Database

The MNIST database is a large database of handwritten digits commonly used to test image processing systems.

Preparation

Get the raw data

To download the raw MNIST data set with the default parameters, run:

python -m datasets.mnist.get_raw -m sacred

In this case, the process is very simple. We use Keras to download the MNIST data to ~/.keras/datasets/mnist.npz.

Serialize the raw data

To serialize the raw data use:

python -m datasets.mnist.serialize -m sacred

Unconditioned MNIST GAN

The following experiment shows how to generate random numbers between 0 and 9 with the GanEstimator module. For implementation details see Components of Reproducible-ML or API Documentation

To run the code with the default parameters defined in the config function just type from the root directory:

python -m exps.mnist.train

Or use the command line to set different parameters:

python -m exps.mnist.train with mnist_feeder.batch_size=16 gan_type="UNCOND" -m sacred

Example output

With the default parameters we will obtain the following result for training steps 100, 400 and 2000:

Conditioned MNIST GAN

In this experiment, we wish to condition on both the generator and discriminator. We generate MNIST digits conditioned on class labels.

To run the conditioned MNIST GAN use:

python -m exps.mnist.gan with mnist_feeder.batch_size=16 gan_type="COND" -m sacred

Example output

With the default parameters we will obtain the following result for training steps 100, 400 and 2000: