
Generative adversarial networks are a machine learning method where two neural networks compete to generate realistic synthetic data.GAN is an architecture of two neural networks playing a minimax game: generator G tries to fool discriminator D by creating plausible data, while D learns to spot fakes. Equilibrium occurs when G reproduces the real data distribution so accurately that D can no longer distinguish—its accuracy drops to random guessing (50%). Like an arms race between a counterfeit bill maker and a bank expert, each side raises the bar.
Proposed by Ian Goodfellow et al. (2014) as a way to train generative models without explicitly modeling the data distribution. The idea traces back to adversarial games and minimax theory. They quickly became popular due to their ability to generate realistic images, sound, and video. Subsequent modifications—DCGAN, StyleGAN, CycleGAN—addressed training instability issues and improved quality.
During training, G and D are updated alternately. The discriminator receives a real sample and the generator's output, computes its loss (logistic loss function). The generator adjusts its weights to maximize the discriminator's error—i.e., to make the fake appear real. Gradients from D flow back through G, shaping the latent representation. Problem: vanishing gradients if D is too strong, so non-standard loss functions (e.g., Wasserstein GAN) are often used.
Generating photorealistic faces, creating clothing designs, enhancing medical images — anywhere that requires plausibly filling in the details.
The most impressive deepfakes and old film restorations owe their existence to GANs.
| x | variable | data sample — sample |
| z | variable | latent variable sample — latent variable |
| D(x) | variable | discriminator output for real data — discriminator output |
| G(z) | variable | generator output for latent variable — generator output |
| V(D,G) | variable | value function of the game — value function |
| min_G | operator | minimize with respect to generator parameters — minimization over generator |
| max_D | operator | maximize with respect to discriminator parameters — maximization over discriminator |
| E_{x~p_data} | operator | expectation over the empirical data distribution — expectation over data distribution |
| E_{z~p_z} | operator | expectation over the latent prior distribution — expectation over latent distribution |
| log | operator | natural logarithm — logarithm |



















