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:
- 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
- Next, define a parameter dictionary to hold the weight and bias parameters:
params={}
- Define ...