Vanilla GAN
We have covered quite a bit of ground in understanding the basics of GANs. In this section, we will apply that understanding and build a GAN from scratch. This generative model will consist of a repeating block architecture, similar to the one presented in the original paper. We will try to replicate the task of generating MNIST digits using our network.
The overall GAN setup can be seen in Figure 6.8. The figure outlines a generator model with noise vector z as input and repeating blocks that transform and scale up the vector to the required dimensions. Each block consists of a dense layer followed by Leaky ReLU activation and a batch-normalization layer. We simply reshape the output from the final block to transform it into the required output image size.
The discriminator, on the other hand, is a simple feedforward network. This model takes an image as input (a real image or the fake output from the generator) and classifies it as real or fake. This simple setup...