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:
- 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 ...