aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← Machine Learning learning path
05
Foundations

Similarity / Divergence Measures

Measuring how different two probability distributions are — the core of generative modelling.

13 lessons~111 min13 formulas7 questions
0%
Not started yet
Quiz mastery0%
Start
What you’ll take away
  • Divergences need not be symmetric; metrics must be.
  • F-divergences (KL, JS, χ², TV, Hellinger) compare density ratios point by point.
  • IPMs (Wasserstein, MMD, Kolmogorov) compare expectations of test functions.
  • Wasserstein stays informative when distributions don't overlap — key for stable GANs.
Major concepts (syllabus)

F-divergences: KL, JS, Pearson χ², Neyman χ², Total Variation (TV), Hellinger divergences. Integral Probability Metrics (IPMs): Wasserstein distance, Maximum Mean Discrepancy (MMD), Bounded-Lipschitz (Fortet–Mourier) distance, Cramér distance, Kolmogorov distance.

Lessons

  1. Distances vs. divergencesWhy a divergence need not be symmetric or satisfy the triangle inequality.7 min
  2. F-divergences SlidesRatio-based divergences built from a convex function f with f(1) = 0.10 min
  3. KL divergence SlidesHow much information is lost when Q is used to approximate the true distribution P.11 min
  4. JS divergence SlidesA symmetric, bounded divergence built from KL against the average distribution.10 min
  5. Pearson and Neyman χ²Squared-difference divergences weighted by one distribution or the other.8 min
  6. Total variation distanceHalf the L1 distance between densities; the largest difference in probability of any event.7 min
  7. Hellinger distanceA symmetric, bounded divergence based on square roots of densities.7 min
  8. Integral Probability Metrics (IPMs) SlidesComparing distributions through the largest difference in expectations over a class of functions.11 min
  9. Wasserstein distanceThe earth mover's distance: the cheapest cost of moving one distribution's mass onto the other.10 min
  10. Maximum Mean Discrepancy (MMD)Distance between mean embeddings of two distributions in a kernel feature space.9 min
  11. Bounded-Lipschitz (Fortet–Mourier) distanceAn IPM over functions that are both bounded and Lipschitz.7 min
  12. Cramér distanceSquared difference between cumulative distribution functions, integrated.7 min
  13. Kolmogorov distanceThe largest gap between two cumulative distribution functions.7 min

Key formulas

F-divergence

Slides

Convex f with f(1) = 0; a ratio-based divergence.

KL divergence (discrete)

Slides

Asymmetric; in [0, ∞); infinite for non-overlapping supports.

KL divergence (continuous)

Slides

Continuous form of KL.

JS divergence

Slides

Symmetric; equals log 2 for non-overlapping distributions.

Pearson χ²

Squared differences weighted by Q.

Neyman χ²

Squared differences weighted by P.

Total variation

Largest difference in probability assigned to any event.

Hellinger distance

Bounded in [0, 1] and symmetric.

Integral Probability Metric

Slides

The function class 𝓕 decides which metric you get.

Wasserstein-1

Kantorovich–Rubinstein dual form; used by WGAN.

MMD

x, x' ~ P and y, y' ~ Q, with kernel k.

Kolmogorov distance

Largest gap between CDFs.

Cramér distance

Integrated squared gap between CDFs.

Key terms

Divergence
Non-negative measure of difference between distributions, zero only if they are equal; need not be symmetric.
F-divergence
Family of divergences built from a convex f with f(1) = 0 applied to the density ratio.
Hellinger distance
Bounded, symmetric distance between distributions based on square roots of densities.
IPM
Integral probability metric: largest difference in expectations over a class of test functions.
JS divergence
Symmetric, bounded divergence: average KL of each distribution to their mixture.
KL divergence
Σ P log(P/Q): information lost when Q approximates P. Asymmetric.
MMD
Maximum mean discrepancy: distance between kernel mean embeddings of two distributions.
Total variation
Largest difference in probability two distributions assign to the same event.
Wasserstein distance
Earth mover's distance: minimum cost of transporting one distribution onto another.
Full glossary →
Practice this topic7 questions · earn XP and build your streak
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser