Generating new MNIST digits with VAE

In this section, we'll learn how a VAE can generate new digits for the MNIST dataset. We'll use Keras under TF 2.0.0 to do so. We chose MNIST because it will illustrate VAE's generative capabilities well.

Let's go through the implementation, step by step:

  1. Let's start with the imports. We'll use the Keras module, which is integrated in TF:
import matplotlib.pyplot as pltfrom matplotlib.markers import MarkerStyleimport numpy as npimport tensorflow as tffrom tensorflow.keras import backend as Kfrom tensorflow.keras.layers import Lambda, Input, Densefrom tensorflow.keras.losses ...

Get Advanced Deep Learning with Python 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.