Vanilla GAN

Learn how to apply a basic understanding of general adversarial networks and build one from scratch.

We'll cover the following...

The vanilla GAN will consist of a repeating block architecture similar to the one presented in the original paper. We’ll try to replicate the task of generating MNIST digits using our network.

The overall GAN setup can be seen in the figure below. The figure outlines a generator model with a noise vector zz 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 LeakyReLU activation and a batch-normalization layer. We simply reshape the output from the final block to transform it into the required output image size.

Press + to interact
Vanilla GAN architecture
Vanilla GAN architecture

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 of two competing models helps us to train the overall GAN.

Implementation

...