From Generative Adversarial Networks Explained with a Classic Spongebob Squarepants Episode by Arthur Juliani

Our Spongebob metaphor only goes so far in helping actually build a GAN. To actually implement one, we need to get a little more formal. The generator (*G*) and discriminator (*D*) are both feedforward neural networks which play a min-max game between one another. The generator takes as input a vector of random numbers (*z*), and transforms it into the form of the data we are interested in imitating. The discriminator takes as input a set of data, either real (*x*) or generated (*G(z)),* and produces a probability of that data being real (*P(x)*).