Generative Adversarial Networks

The course material is incorrect because, after some cross-referencing, GANs are a training framework. GANs do not have to use CNNs, they use CNNs when working with images. Actually GANs generating text might use RNNs or Transformers. GANS generating tabular data might use simple fully-connected networks. GANs generating audio might use WaveNet-style architectures.

Actually, on further digging, a GAN has a generator + discriminator. The adversarial set up, the two neural networks of whatever architecture, train together with opposing goals. Once trained, the generator is a generative model and the discriminator can be thrown away.

Why does this matter?
If you say โ€œGANโ€ in casual use, most people mean โ€œa generative model trained adversarially.โ€ If youโ€™re being precise, youโ€™d say โ€œGAN is a generative modeling framework that produces a generative model (the generator).โ€

Like I'm a 10 year old explainer

Imagine you have two friends who are playing a special game together to become brilliant artists!

generative-adversarial-network.png

Friend 1 is the Artist ๐ŸŽจ This friend tries to paint pictures. At first, they're rubbish at it - their cats look like blobs and their trees look like sticks. But they really want to get better!

Friend 2 is the Detective ๐Ÿ” This friend has a very important job: they look at pictures and try to work out if they're real photos or if the Artist friend drew them. They're like a forgery detective!

Here's how they play:

  1. The Artist draws a picture (maybe of a dog)
  2. The Detective looks at it alongside some real photos of dogs
  3. The Detective says "That's fake! The ears are wrong!"
  4. The Artist thinks "Ah, I need to fix the ears!" and tries again

They do this thousands and thousands of times. The Artist keeps getting better because they learn from every mistake the Detective catches. The Detective also gets better at spotting fakes!

Eventually, something amazing happens - the Artist becomes SO good that they can draw pictures that look completely real! The Detective can hardly tell the difference anymore.

That's what a GAN is - two computer programmes playing this exact game. One creates images (the Generator/Artist) and one judges them (the Discriminator/Detective). They compete against each other until the Generator can create incredibly realistic images, videos, or even voices!

It's like having a computer that learned to be an artist by practising with the world's pickiest art critic!