Interactive demo · Probabilistic Machine Learning: Advanced Topics · Chapter 26

Learning by comparison: what a critic sees

A generative adversarial network turns a comparison of two samples into a training signal. Here the data density p* and the model density q = N(δ, s2) are known exactly, so every quantity of Section 26.2 can be computed on a grid. The top panel shows the optimal discriminator D*(x) = p/(p + q) (ratio-based comparisons: the Jensen–Shannon divergence and the other f-divergences), the optimal Wasserstein critic (a 1-Lipschitz function) and the optimal MMD witness (a unit-norm function in the RKHS of the Gaussian kernel), the last two rescaled to fit. The bottom panels move the model away from the data: the ratio-based divergences saturate once the two densities stop overlapping (the JSD stops at log 2 and the total variation at 1), while the Wasserstein distance keeps growing linearly and the MMD keeps a usable slope for as long as the kernel can still see the gap.

Data density p*

Model location δ

Model spread s

Kernel bandwidth ℓ (MMD)

Show

Try these

Everything uses the trapezoid rule on 1201 points of [−12, 12]. KL(p∥q) is infinite when q = 0 where p has mass. The JSD is the average of KL to the mixture, so it lies between 0 and log 2 = 0.6931. W1 is the integral of |Fp − Fq|; the critic is f(x) = ∫ sign(Fq − Fp). MMD2 uses the kernel exp(−(x−y)2/(2ℓ2)); the witness is (μp − μq)/MMD. Bottom curves use the current p*, s and ℓ, with a marker at the current δ.

In the lecture notes