Exercises — Evaluating generative models (FID, IS)
These problems climb a ladder: from recognising what each symbol means, to applying the formulas by hand, to analysing their failure modes, to synthesising both scores into a judgement, and finally mastering the edge cases. Do each one on paper first, then open the solution.
Everything here builds on Evaluating generative models (FID, IS). If a symbol looks unfamiliar, that parent note defines it — but every solution below re-earns the tools it uses.

Level 1 — Recognition
Exercise 1.1
For each quantity, say whether higher is better or lower is better, and in one phrase what it measures: (a) Inception Score, (b) Fréchet Inception Distance, (c) the conditional entropy , (d) the marginal entropy .
Recall Solution
Recall the two building blocks. is the uncertainty of the classifier about one image — small means "the classifier is confident". is the uncertainty about which class you'll see across all images — large means "many different classes appear". And .
- (a) IS: higher is better — measures quality × diversity.
- (b) FID: lower is better — measures distance between real and fake feature-clouds.
- (c) : lower is better — confident, sharp images.
- (d) : higher is better — diverse class coverage.
Exercise 1.2
In the FID formula name what each piece is and which mismatch it detects.
Recall Solution
- are the mean feature vectors (the centre of each cloud). is the squared distance between centres — it fires when the fake images live in the wrong region of feature space (wrong "average look").
- are the covariance matrices — how the clouds are stretched and correlated. sums the shape/spread mismatch across all feature dimensions.
- is a matrix geometric mean; the term shrinks the trace toward zero exactly when the two shapes agree.
Level 2 — Application
Exercise 2.1
A generator makes 2 images over a 2-class classifier: Compute the Inception Score. Use natural logarithms.
Recall Solution
Step 1 — marginal (WHAT: the average label distribution; WHY: IS rewards this being uniform).
Step 2 — KL divergence per image. Recall . For image 1: By symmetry image 2 gives the same .
Step 3 — average and exponentiate. Interpretation: only mildly better than the worst case () because each image is only somewhat confident (0.8, not 0.99).
Exercise 2.2
Two 1-D feature clouds (so covariance is just a variance): Compute FID. In 1-D, .
Recall Solution
Step 1 — mean term (WHAT: distance between centres).
Step 2 — covariance term. In 1-D the trace is just the number itself: Notice this is — a perfect square, always .
Step 3 — sum.
Level 3 — Analysis
Exercise 3.1 — Mode collapse vs IS
A GAN suffers total mode collapse: it generates the same one perfect, razor-sharp dog every time. Over a 3-class classifier every sample gives . (a) Compute , , and IS. (b) Explain why IS fails here, and which score catches it.
Recall Solution
(a) With every image identical:
- , so (using ).
- Each , so too.
- .
Here IS does bottom out at 1 because collapse to a single class kills diversity (). But watch the more dangerous case below.
(b) The truly deceptive collapse is within-class diversity loss: a GAN produces confident images spread across all classes but only one image per class (like the parent note's toy example, IS ≈ 2 — "reasonable"). IS sees diverse labels and rewards it, blind to the fact that the model only knows 3 pictures. FID catches this: the real dog cloud is broad (many dog poses), the fake cloud is a single point, so is nearly zero, the shape mismatch term blows up, and FID is large. See Mode Collapse in GANs and Precision and Recall for Generative Models.
Exercise 3.2 — Non-negativity proof
Prove the covariance term in the 1-D FID, and state when it equals zero.
Recall Solution
WHAT/WHY: we want to show FID never rewards a shape mismatch with a negative number. since any real square is non-negative. It equals 0 iff — the spreads match exactly. Combined with (equal iff ), FID iff the Gaussians are identical, which is exactly the property a distance must have.
Level 4 — Synthesis
Exercise 4.1 — Reading two models together
| IS | FID | |
|---|---|---|
| Model A | 9.2 | 40 |
| Model B | 8.0 | 12 |
| Which model do you ship, and why? What single dataset fact would flip your answer? |
Recall Solution
Step 1 — trust FID for the distribution match. FID compares to real data, so B's 12 ≪ 40 says B's feature cloud sits much closer to the real one: better realism and better coverage. A's higher IS only means A's images are more confidently classifiable — which rewards sharpness even if unrealistic. Step 2 — ship B. Lower FID almost always tracks better perceived quality; A's IS edge is the classic "sharp-but-off-distribution" trap. Step 3 — what flips it: if the target dataset is narrow / single-domain (e.g. only faces) so that Inception-v3's ImageNet feature space is poorly matched, FID becomes noisy and unreliable; you'd then weight human eval / precision-recall more, and A could win if its samples are visibly better. Also: if you require class-diversity and B is secretly collapsed within-class, IS + Precision and Recall for Generative Models would expose it.
Exercise 4.2 — Sample-size bias
FID is estimated from finite samples. If you compute FID with images instead of , does the estimate tend to be higher or lower than the true FID? Explain the mechanism.
Recall Solution
Higher (positively biased). WHY: with few samples the estimated covariances are noisy, and the estimated means wander from the truth. Both the mean term and the shape term pick up extra apparent mismatch from sampling noise, and since FID this noise can only push the score up, never below the true value. Consequence: FID numbers are only comparable at a fixed, large (that is why the field standardises on 50k). This is an estimation bias, not a property of the true Fréchet distance.
Level 5 — Mastery
Exercise 5.1 — Full 2-D FID by hand
Real cloud: , . Generated cloud: , . Compute FID exactly.
Recall Solution
Step 1 — mean term.
Step 2 — matrix product then square root (WHY: covariance term needs ). Both matrices are diagonal, so multiply entrywise: For a diagonal PSD matrix the square root is the entrywise square root:
Step 3 — trace term.
Step 4 — sum.
Exercise 5.2 — Degenerate covariance (edge case)
Now let the generator collapse in one direction: (zero variance along axis 2), keeping and . Compute FID and interpret the collapse.
Recall Solution
Means match, so the first term is . Interpretation: even with matching centres, the vanished spread along axis 2 (variance vs the real ) contributes exactly , and the mismatched spread on axis 1 contributes another . FID correctly penalises the collapsed direction — the geometric picture of within-mode collapse that IS cannot see. Compare this feature-space reasoning to Perceptual Loss Functions and Inception-v3 Architecture.

Recall Quick self-check
Which score never looks at real data? ::: Inception Score (IS) FID is zero exactly when? ::: the two Gaussians are identical ( and ) A within-class-collapsed generator: high or low IS? ::: can be high (deceptive) — FID catches it Finite-sample FID is biased which way? ::: upward (higher than the true value)