For the minimax GAN objective , how do you derive the optimal discriminator for a fixed generator , and show that substituting reduces the generator objective to ?
Deep learning, Generative adversarial networks
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can carry out Goodfellow et al.’s classic two-step proof connecting GAN training to Jensen–Shannon divergence.
Key idea
Rewrite the generator expectation over as an expectation over (the induced generator distribution), maximise the integrand pointwise in to find , and substitute back to get a sum of two KLs.
Steps
- Rewrite as a single integral over : , where is the distribution of when .
- Maximise pointwise over for fixed and (with , since points with contribute nothing to the integral): set , giving , i.e. . The second derivative confirms a maximum.
- Substitute into and introduce : , and .
- Integrate: .
- Conclude: since Jensen–Shannon divergence with equality if and only if , the global minimum of is , attained uniquely at (where everywhere).
Common mistakes
- Forgetting to change variables from to before differentiating pointwise with respect to .
- Missing the factor of in front of (Jensen–Shannon divergence is , so the sum without equals ).
- Confusing (base ) with ; when , , so .
How long your answer should be
One page; 6–8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: In a VAE with prior and diagonal Gaussian encoder , how do you derive the closed-form KL divergence , and what does each term encourage?
Next in Deep learning: In SimCLR with a mini-batch of images (giving augmented views), write the NT-Xent (InfoNCE) loss for a positive pair with cosine similarity and temperature . Why is this a -way cross-entropy loss, and how does affect the gradients?