# Closed-form Expressions for Maximum Mean Discrepancy with Applications to Wasserstein Auto-Encoders

arXiv: https://arxiv.org/abs/1901.03227 · HTML: https://mlsanity.com/paper/1901.03227/

## Key facts

- Cited by 11 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 10 Jan 2019.

## Built on by (most cited first, 11 of 11)

- [A Dictionary of Closed-Form Kernel Mean Embeddings](https://mlsanity.com/paper/2504.18830/) (2025)
- [Confidence and Uncertainty Assessment for Distributional Random Forests](https://mlsanity.com/paper/2302.05761/) (2023)
- [QQWorld: Quantile-Quantile Matching for World Model Regularization](https://mlsanity.com/paper/2607.28415/) (2026)
- [Expanding SPHERE-JEPA: A Family of Statistical Regularizers for the Hypersphere](https://mlsanity.com/paper/2606.17603/) (2026)
- [Robust Bayesian Inference for Measurement Error Misspecification: The Berkson and Classical Cases](https://mlsanity.com/paper/2306.01468/) (2023)
- [Improved probabilistic regression using diffusion models](https://mlsanity.com/paper/2510.04583/) (2025)
- [On the Optimization Landscape of Maximum Mean Discrepancy](https://mlsanity.com/paper/2110.13452/) (2021)
- [Differentially Private Synthetic Data Using KD-Trees](https://mlsanity.com/paper/2306.13211/) (2023)
- [Safe reinforcement learning in uncertain contexts](https://mlsanity.com/paper/2401.05876/) (2024)
- [Progressive distillation diffusion for raw music generation](https://mlsanity.com/paper/2307.10994/) (2023)
- [Localizing Global Discrepancies: Marginal Contributions and Contextual Anomaly Detection](https://mlsanity.com/paper/2608.28375/) (2026)

## Abstract (arXiv)

The Maximum Mean Discrepancy (MMD) has found numerous applications in statistics and machine learning, most recently as a penalty in the Wasserstein Auto-Encoder (WAE). In this paper we compute closed-form expressions for estimating the Gaussian kernel based MMD between a given distribution and the standard multivariate normal distribution. This formula reveals a connection to the Baringhaus-Henze-Epps-Pulley (BHEP) statistic of the Henze-Zirkler test and provides further insights about the MMD. We introduce the standardized version of MMD as a penalty for the WAE training objective, allowing for a better interpretability of MMD values and more compatibility across different hyperparameter settings. Next, we propose using a version of batch normalization at the code layer; this has the benefits of making the kernel width selection easier, reducing the training effort, and preventing outliers in the aggregate code distribution. Our experiments on synthetic and real data show that the analytic formulation improves over the commonly used stochastic approximation of the MMD, and demonstrate that code normalization provides significant benefits when training WAEs.
