difficulty 4/5
Generative adversarial network
Two networks in a game — one invents samples, the other tries to spot them. The generator never sees the data, only gradients that come back through its opponent.
Intuition
Most models on this site are told what the right answer is. A generative model of images has no such thing — there is no target for "a plausible photograph", only a distribution you would like to sample from.
The adversarial idea supplies a target by inventing an opponent. Train a discriminator that "estimates the probability that a sample came from the training data rather than G", and train the generator to fool it: "the training procedure for G is to maximize the probability of D making a mistake" [1, Abstract]. The loss is not written by hand — it is another network, and it improves as the generator does.
What the generator never gets is the data. It is updated "only with gradients flowing through the discriminator", so "components of the input are not copied directly into the generator's parameters" [1, §6]. Everything it knows about photographs arrives second-hand.
Formal definition
How it works
Where it's used
Why & when
Worked example
Pitfalls
Check yourself
3 questions
The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.
Sources
- Generative Adversarial Nets (2014)paperhttps://ar5iv.labs.arxiv.org/html/1406.2661
- Denoising Diffusion Probabilistic Models (2020)paperhttps://ar5iv.labs.arxiv.org/html/2006.11239
- High-Resolution Image Synthesis with Latent Diffusion Models (2022)paperhttps://arxiv.org/abs/2112.10752