Variational autoencoder in TensorFlow

Variational autoencoders are the modern generative version of autoencoders. Let's build a variational autoencoder for the same preceding problem. We will test the autoencoder by providing images from the original and noisy test set.

We will use a different coding style to build this autoencoder for the purpose of demonstrating the different styles of coding with TensorFlow:

  1. Start by defining the hyper-parameters:
learning_rate = 0.001n_epochs = 20batch_size = 100n_batches = int(mnist.train.num_examples/batch_size)# number of pixels in the MNIST image as number of inputsn_inputs = 784n_outputs = n_inputs
  1. Next, define a parameter dictionary to hold the weight and bias parameters: 
params={}
  1. Define ...

Get Python: Advanced Guide to Artificial Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.