Implementing a deep convolutional GAN
A GAN is comprised, in its simplest form, of two networks, a generator and a discriminator. The discriminator is just a regular Convolutional Neural Network (CNN) that must solve the binary classification problem of distinguishing real images from fakes. The generator, on the other hand, is similar to the decoder in an autoencoder because it has to produce an image from a seed
, which is just a vector of Gaussian noise.
In this recipe, we'll implement a Deep Convolutional Generative Adversarial Network (DCGAN) to produce images akin to the ones present in EMNIST
, a dataset that extends the well-known MNIST
dataset with uppercase and lowercase handwritten letters on top of the digits from 0 to 9.
Let's begin!
Getting ready
We'll need to install tensorflow-datasets
to access EMNIST
more easily. Also, in order to display a nice progress bar during the training of our GAN, we'll use tqdm
.
Both dependencies can be...