This is a light implementation of the Variational Auto-encoder(VAE) with PyTorch and tested on MNIST dataset.
The code is tested with python 3.7.7 on Ubuntu 18.04. The torch version installed is 1.3.1.
See the Demo.ipynb to find the running configuration options in details.
The first experiment conducted is to test the images reconstruction. A batch of 64 images are drawn from the testing dataset, first pass to the encoder to acquire their latent encodings, then pass to the decoder to see if the VAE could recover the original images properly.
Generate artificial images from standard Gaussian noise. We can see the 'fake' generated images are reasonable. This reveals an important property of VAE which is distribution transformation. VAE transform from a simple (standard Gaussian) distribution to a very complicated distribution exsits in MNIST.