Cramer-Wold AutoEncoder

Jacek Tabor, Szymon Knop, Przemyslaw Spurek, Igor T. Podolak, Marcin Mazur, Stanislaw JastrzebskiarXiv 2018

Introduction

In generative modeling, a primary objective is to align the latent representation of data with a known prior distribution, typically a standard Normal distribution. Traditional approaches like Variational Autoencoders (VAEs) and Wasserstein Autoencoders (WAEs) often rely on stochastic sampling to estimate the distance between these distributions. This sampling introduces noise and computational overhead. The Cramer-Wold AutoEncoder (CWAE) addresses these limitations by providing a closed-form analytic solution for the distance between a high-dimensional sample and a Normal distribution, removing the need for random sampling during training.

The Cramer-Wold Distance

The CWAE is built upon the Cramer-Wold Theorem, which posits that a multivariate distribution is uniquely determined by the set of all its one-dimensional projections. While Sliced-Wasserstein Autoencoders (SWAE) approximate this by sampling random projections, CWAE integrates over the entire space of possible projections mathematically.

Conceptual illustration of the Cramer-Wold theorem, showing how multivariate distributions are characterized by their one-dimensional projections.

By defining a distance based on the mean squared $L_2$ distance of smoothed projections, the authors derive the "Cramer-Wold kernel." This kernel allows the integral over all projections to be solved analytically, resulting in a deterministic loss function.

Implementation and Approximation

The analytic solution for the Cramer-Wold distance involves Kummer’s confluent hypergeometric function ($\phi_D$). Although computationally complex in its exact form, the authors demonstrate that for high-dimensional latent spaces ($D \ge 20$), a simple algebraic approximation is highly accurate and efficient to implement.

Comparison of the exact Cramer-Wold kernel (red) and its algebraic approximation (green) across different dimensions D.

The final CWAE loss function combines a standard reconstruction error (MSE) with the logarithm of the Cramer-Wold distance. The use of the logarithm stabilizes training by preventing extreme gradients during the initial phases of optimization.

Experimental Results

CWAE was evaluated against standard benchmarks including MNIST, Fashion-MNIST, CIFAR-10, and CelebA. The model consistently achieved state-of-the-art Fréchet Inception Distance (FID) scores. On the CelebA dataset, CWAE reached an FID of 49.69, outperforming WAE-MMD (51.51) and SWAE (53.85).

Furthermore, CWAE demonstrated a significant improvement in training efficiency. By eliminating the sampling step required by MMD or SWAE, CWAE is approximately twice as fast for standard batch sizes (up to 256). Qualitative analysis of the latent space revealed smoother interpolations and a closer fit to the target Gaussian distribution compared to previous methods.

Conclusion

The Cramer-Wold AutoEncoder represents a significant step forward in deterministic generative modeling. By replacing stochastic sampling with an analytic kernel, it offers a more stable, faster, and higher-performing alternative to existing autoencoder architectures. Future work may extend this framework to non-Gaussian priors and explore its utility in adversarial training contexts.

Summary updated

BibTeX
@misc{tabor2018cramer,
  author = {Jacek Tabor and Szymon Knop and Przemyslaw Spurek and Igor T. Podolak and Marcin Mazur and Stanislaw Jastrzebski},
  title = {{Cramer-Wold AutoEncoder}},
  year = {2018},
  eprint = {1805.09235},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.09235},
}
Figure