From theory to code – a simple example
So, we've finally got all the right tools to produce a GAN in code. Why is it important that the entry level version of a GAN is small? The goal of this code is to make it as compact as possible to ensure that, as we expand on the concept of a GAN, it becomes obvious what changes need to be made to make improvements on this basic formula.
Getting ready
Did you forget yet? Let's pull up the diagram on GANs so that we can discuss the different parts of the structure we will be producing classes for in this chapter:
This basic structure is what we will be converting to code. The key to this particular recipe is understanding what pieces we need to convert and what pieces are simply going to be wrapped up into a single class. For example, the latent space will be sampled from a Gaussian distribution that's available in the NumPy library. Since we are just sampling from this Gaussian distribution, it is necessary to know the size of the latent space at each...