Generative adversarial network (source code)

= Generative adversarial network

A <generative adversarial network> trains a generator $G$ to produce samples and a discriminator $D$ to distinguish generated samples from training data. The original objective is the <minimax> problem
$$
\min_G\max_D\;\mathbb E_{x\sim p_{\rm data}}\log D(x)+\mathbb E_{z\sim p_z}\log(1-D(G(z))).
$$
The discriminator improves at detecting fakes; the generator improves at fooling it. Both can be <neural networks> trained by <backpropagation>.<Generative Adversarial Nets by Ian Goodfellow and others>[§2, equation (1) and Algorithm 1]{ref}

For a toy dataset containing two equally frequent types of images, always producing one type gives the discriminator an exploitable imbalance even if each generated image looks plausible. Under the paper's ideal unrestricted-function analysis, the equilibrium matches the data <probability distribution> and gives $D=1/2$. This ideal result does not ensure convergence for finite networks and alternating numerical updates. <Ian Goodfellow> and coauthors introduced the framework in 2014.<Generative Adversarial Nets by Ian Goodfellow and others>[§4, optimal discriminator and global optimum]{ref}