Generative Adversarial Networks

Setup: Assume we have data xi drawn from distribution pdata(x). Want to sample from pdata
Idea: Introduce a latent variable z with simple prior p(z). Sample z ~ p(z) and pass to a Generator Network x = G(z).
Then x is a sample from the Generator distribution pG. Want pG=pdata

Generator Network: Try to fool the discriminator by generating real-looking images
Discriminator Network: Try to distinguish between real and fake images

Pasted image 20241205162806.png
Jointly train Generator network and Discriminator Network
Train jointly in minimax game

Train G and D using alternating gradient updates

Pasted image 20241205165259.png
At start of training, generator is very bad and discriminator can easily tell apart real from fake

Vanishing gradients for G

Train G to maximize -log(D(G(Z)))

  • Instead of minimize log(1-D(G(z)))
  • G gets strong gradients at start of training
    Pasted image 20241205165906.png

Architecture: DC-GAN

Generator is an upsampling convolutional network
Discriminator is a convolutional network
Pasted image 20241205170313.png

Vector Math

Pasted image 20241205170613.png
Pasted image 20241205170621.png