Dive into Deep Learning · §16.2
Adversarial objectives and divergences
one template, two choices · every loss is a divergence · critics estimate the ratio · which objectives keep a gradient
d(p, q) = \sup_{T \in \mathcal{T}} \big\{ E_{x \sim p}[a(T(x))] - E_{x' \sim q}[b(T(x'))] \big\}
Two independent choices:
A supremum of affine functionals is convex in (p,q), so these objectives have no spurious local minima in distribution space. The pairing objective in the next section is quadratic and does not fit the template.
Replace \log \sigma by a general score function \ell: V_\ell(D) = E_p[\ell(D)] + E_q[\ell(-D)].
The optimized objective is determined by the Bayes-risk gap between a classifier that observes the sample and one that does not:
\Delta_\ell(p, q) = L(\tfrac12) - E_{x \sim m}\big[L(\eta(x))\big], \qquad \eta = \frac{p}{p + q}
Proposition. \Delta_\ell = D_f(p \,\|\, q) with f(u) = L(\tfrac12) - \tfrac{u+1}{2} L\big(\tfrac{u}{u+1}\big) — convex, f(1) = 0. Proof: substitute u = p/q; concavity survives the perspective.
| loss | value \Delta_\ell | optimal critic |
|---|---|---|
| logistic | \mathrm{JS}(p,q) | \lambda |
| square (LSGAN) | \tfrac18 \int (p-q)^2/(p+q) | \sigma(\lambda) |
| hinge | \mathrm{TV}(p,q) | \operatorname{sign} \lambda |
Any f-divergence becomes a game (f-GAN):
D_f(p \,\|\, q) \;\geq\; E_p[T] - E_q[f^*(T)]
Fenchel–Young holds with equality at the slope:
T^\star = f'\!\left(\frac{p}{q}\right)
d_{\mathcal{F}}(p, q) = \sup_{h \in \mathcal{F}} \big\{ E_p[h] - E_q[h] \big\}
sec_dcgan).Two unit Gaussians at separation d — all three objectives evaluated without sampling error:
JS at d = 8: 0.693054 nats (ceiling log 2 = 0.693147)
JS approaches \log 2 once the overlap vanishes. The distance W_1=d keeps slope one at every separation. MMD retains a slope over distances comparable to its kernel length and becomes insensitive at larger separations.
Same generator, same target, four objectives — logistic, least squares, hinge, MMD (no critic):
All four generators recover the three modes, but their exact \mathrm{JS}(p,q_t) traces follow different optimization trajectories.
Freeze one imperfect generator with known density; train a fresh critic per loss; compare with the predicted link of the analytic \lambda:
snapshot JS(p, q) = 0.046 nats
The three losses recover the identity, sigmoid, and step transforms of the same ratio. Each estimate degrades where |\lambda| is large and samples are scarce.
Train T on E_p[T] - E_q[e^{T-1}] between two known Gaussians:
The critic follows the analytic parabola where the mixture has appreciable density. The attained bound approaches the exact KL from below, so an imperfect critic underestimates the divergence.
No corner of the template dominates. The objective→divergence map is collected in :numref:sec_mdl-divergence-objective-map.