This page is a stress-test for your understanding of the Generative Adversarial Networks (GAN) framework. Each line is a Question ::: Answer reveal — cover the right side, commit to an answer with a reason, then check. If your reason was wrong even when the verdict was right, you found a trap.
Reminders of the notation you will need (all defined in the parent):
G(z) — the Generator, turning noise z into a fake sample.
D(x) — the Discriminator, outputting the probability that x is real, a number in [0,1].
z∼pz — the noise distribution: a fixed, easy-to-sample source of randomness (e.g. a standard Gaussian N(0,I) or a uniform box). It is chosen by us, never learned; G reshapes this simple noise into the complex data distribution.
pdata — the distribution of real data; pg — the distribution of the Generator's outputs (what you get by pushing pz through G).
V(G,D)=Ex∼pdata[logD(x)]+Ez∼pz[log(1−D(G(z)))] — the value function both networks fight over.
Two more objects show up repeatedly below. Rather than defer them, here they are in plain words:
The three figures below are your visual anchors; the questions refer to them by number.
Figure 1 — Verdicts converging: how D's outputs on real and fake data both drift to 0.5.
Figure 2 — Saturating vs non-saturating loss: why the naive Generator loss goes flat and the fix stays steep.
Figure 3 — The JSD landscape: the divergence the ideal Generator minimizes, and its flat no-gradient region.
At equilibrium the Discriminator has "lost", so it is a failed network.
False. Outputting 0.5 everywhere means pg=pdata: the two distributions are genuinely identical, so no classifier could beat a coin flip. D hasn't failed — it has reached the point of maximum uncertainty, which is precisely the sign that G succeeded.
A higher D(x) for a fake image always means the Generator is winning.
Roughly true at that instant, but misleading: it only says D was fooled on that sample. What matters is the trend across training, since D is simultaneously being retrained to correct such mistakes.
The Generator ever sees a real data sample during training.
False. G only ever receives noise z∼pz and gradient signals routed back throughD. It never touches pdata directly — it learns the data distribution entirely secondhand via the Discriminator.
Minimizing log(1−D(G(z))) and maximizing logD(G(z)) push D(G(z)) in the same direction for G.
True — both drive D(G(z))upward toward 1 (fully fooled), so G moves the same way under either. They differ only in gradient strength when D(G(z)) is small (see Figure 2), which is why the non-saturating form is preferred early in training.
Because the game is minGmaxDV, the Generator is trying to make V as negative as possible.
False. G only controls the second term (log(1−D(G(z)))); the first term E[logD(x)] does not depend on θg at all, so G cannot touch it. G just drives D(G(z)) up.
The Discriminator's optimal output is D∗(x)=pdata(x)+pg(x)pdata(x) only after training finishes.
False. That formula is the optimal D for whateverG currently is, at any moment. Training tries to keep D near this optimum for the present Generator, which is why we take k discriminator steps.
If D(x)=0.5 for every input, the GAN must have converged.
False. D≡0.5 also happens at random initialization when D hasn't learned anything. Convergence requires D=0.5becausepg=pdata, not because D is untrained — the generated images tell you which case you are in.
GANs explicitly write down and maximize a likelihood of the data, like classic maximum-likelihood models.
False. GANs never evaluate pg(x) or a likelihood; the "realistic" criterion is learned implicitly by D. This is the whole point contrasted in Discriminative vs Generative Models.
The KL divergence appears anywhere in the standard GAN objective.
True but subtle — at the optimal D, the value function reduces to a Jensen–Shannon divergence, which is itself built from two KL terms (see the definition callout above). Plain forward-KL is not what a GAN minimizes.
"We train G and D jointly with one shared gradient descent step to keep it simple."
Error: their objectives conflict, so a single joint step gives each a corrupted signal. The parent uses alternating updates so each network adapts to the other's current fixed state. See Gradient Descent Optimization.
"During the Generator update we backprop through D and update both θg and θd."
Error: we backprop throughD (to get the chain-rule gradient ∂G∂D⋅∂θg∂G) but only θg is updated. Updating θd here would let D sabotage its own signal.
"We minimize log(1−D(G(z))) for G — it works fine even when G is terrible."
Error: when G is terrible, D(G(z))≈0, making log(1−D)≈log1=0 with a nearly flat slope — the vanishing gradient problem (the flat magenta curve in Figure 2). The non-saturating logD(G(z)) fixes exactly this.
"D(x) outputs the class label of the image (which digit it is)."
Error: D outputs a single scalar in [0,1] — the probability that x is real vs fake, not a class. Labelling what the image contains is the job of a conditional setup like Conditional GANs (cGAN).
"Since D uses log-probabilities, the Discriminator loss is just plain mean-squared error."
Error: the objective is a binary log-loss — it isCross-Entropy Loss over the real/fake labels. MSE is a different (WGAN-adjacent or least-squares GAN) design choice, not the standard formulation.
"If the Generator collapses to producing one perfect image, that's ideal — it fools D."
Error: that's mode collapse. Fooling D on one mode ignores the diversity of pdata; the goal is pg=pdata across all modes. Fixes live in Mode Collapse Solutions.
"We take k Generator steps per Discriminator step to keep G ahead."
Error: it's the reverse — kDiscriminator steps per one Generator step, so D stays near optimal and hands G a meaningful gradient.
Why do we use log in the objective rather than raw probabilities D(x)?
Three reasons, but the key one is gradient shaping: the slope of logD is 1/D, which grows as D→0 (see the steep violet curve in Figure 2) — so a confidently-wrong verdict produces a large correcting gradient. (Logs also turn products of independent-sample probabilities into sums, and improve numerical stability.)
Why must the Generator's gradient travel through the Discriminator?
Because G has no direct feedback from real data; its only measure of "realism" is D's verdict. The chain rule ∇θglogD(G(z)) literally requires differentiating D's forward pass w.r.t. its input.
Why can't we just directly solve the minimax problem minGmaxDV in closed form?
G and D are deep non-convex networks over millions of parameters; there's no analytic saddle point. We approximate it with iterative alternating gradient steps, hoping to approach a Nash Equilibrium.
Why do the numbers D(xreal) and D(G(z)) both drift toward 0.5 as training succeeds?
As pg→pdata, real and fake become statistically identical, so the best possible classifier is forced to guess — its output collapses to the maximum-entropy value 0.5 for both inputs (the converging curves in Figure 1).
Why does V(G,D) collapse to the constant −2log2 at equilibrium?
At equilibrium D∗(x)=21for everyx, so each expectation's integrand becomes the same constant log21 regardless of the sample. The expectation of a constant is just that constant, so V=E[log21]+E[log21]=log21+log21=−2log2≈−1.386.
Why is a GAN called adversarial rather than cooperative?
The two networks optimize opposing terms of the same V: every gain for D is a loss for G and vice versa. The competition — not cooperation — is what ratchets both toward excellence.
Why do we sample fresh noise for the Generator update instead of reusing the noise from the Discriminator step?
Fresh z∼pz gives an unbiased Monte-Carlo estimate of Ez[⋅] for the Generator's own objective and avoids overfitting G to the specific fakes D just judged.
Why is a GAN called adversarial rather than cooperative? (edge form)
Skip — see above.
Why does a poorly-trained Discriminator hurt the Generator?
A weak D gives near-random verdicts, so the gradient it passes to G points in no useful direction — G learns nothing about how to look more real.
What is D(G(z)) at the very start of training (random init)?
About 0.5 — but for the wrong reason: D is untrained and guessing. This is why raw output values alone can't tell "start" from "convergence"; you must also inspect the generated images (contrast the endpoints in Figure 1).
What happens to logD(G(z)) if D ever becomes perfect and outputs exactly 0 for fakes?
log0=−∞ — the loss explodes. In practice outputs are clamped away from 0 and 1, and this pathology is one motivation for the smoother Wasserstein GAN (WGAN) loss.
What if pg and pdata have no overlap in their supports?
The Jensen–Shannon divergence saturates to its cap of log2 (a flat region, Figure 3), so gradients vanish and G gets no signal to move — exactly the failure the earth-mover distance in Wasserstein GAN (WGAN) was designed to escape.
Degenerate case: the Generator ignores its noise input z entirely.
Then G produces the same output regardless of z∼pz — total mode collapse to a single point. pg becomes a spike, unable to match a spread-out pdata.
How would you detect mode collapse during training?
Watch for the Generator's samples losing variety (many near-duplicate outputs from different z), the Generator loss oscillating while D's loss drops, or a nearest-neighbour diversity metric flatlining. Sample-grid inspection each epoch is the cheapest check.
How do you remediate mode collapse in practice?
Give D a view of batch statistics so it can penalize low diversity (minibatch discrimination), unroll a few D steps so G anticipates D's reaction (unrolled GANs), or switch to the Wasserstein GAN (WGAN) loss — all beyond the vanilla objective; see Mode Collapse Solutions.
Edge case: the two learning rates for G and D are badly mismatched.
If D learns far faster it becomes near-perfect, sending G into the flat saturating region (no gradient, Figure 2); if G outpaces D, D never provides a sharp target. Balanced rates (or two-timescale updates) keep the arms race productive.
Edge case: training oscillates or diverges instead of settling.
The minimax objective has no descent guarantee — the pair can cycle around the equilibrium (like two players endlessly best-responding) rather than converge. Damping tricks (lower learning rates, gradient penalties, historical averaging) are used to stabilize it.
Edge case: "discriminator forgetting."
As G shifts, D may over-adapt to G's current fakes and forget how to reject earlier failure modes, letting G cycle back to old bad samples. Replaying past generated samples in D's batches counteracts this.
Edge case: the real dataset is extremely small.
D can memorize and perfectly classify the few real points, driving log(1−D(G(z))) toward flatness; G overfits to those memorized samples rather than the true distribution — a reason practitioners pair GANs with Data Augmentation with GANs.
Recall One-line self-check
Does D=0.5 everywhere prove convergence?
No — it also occurs at random initialization; you must confirm pg=pdata via the sample quality.