Constructing VAE Latent Spaces with Prescribed Topology
Summary
Variational autoencoders (VAEs) typically use a Gaussian prior, creating a topological mismatch when data lies on non-Euclidean manifolds. This paper introduces a constructive mathematical framework to resolve this for manifolds admitting a product covering space, including cylinders, tori, Möbius strips, Klein bottles, and real projective spaces. The framework enables factorized distributions over elementary factors (circles, intervals, lines) with closed-form, decoupled KL divergences, ensuring tractable training. It catalogues reparametrizable encoder-prior pairs for periodic, bounded, and unbounded supports, and provides coordinate transformations for neural networks to output non-Euclidean parameters. For quotient manifolds, a group-invariant feature map ensures identified points produce identical decoder outputs. Anchor constraints fix the coordinate system or create soft topological holes. Experiments on synthetic manifolds and rotated/shifted MNIST datasets confirm that topology-matched priors align KL regularization with the data manifold, outperforming Gaussian baselines at relevant regularization strengths. Code is available at https://github.com/JvHulst/VAE-Topology.
Key takeaway
For AI Scientists and Machine Learning Engineers developing VAEs for data with known non-Euclidean manifold structures, you should adopt this framework to ensure topological fidelity. By matching your VAE's latent space topology to the data's intrinsic structure, you can achieve superior reconstruction quality, improved prior consistency, and more interpretable latent representations, especially at higher regularization strengths. This approach prevents latent space collapse and aligns learned coordinates with true generative factors, offering a robust alternative to standard Gaussian VAEs.
Key insights
A constructive VAE framework resolves topological mismatches for non-Euclidean data manifolds by using factorized priors and invariant features.
Principles
- Factorized encoder-prior distributions yield product topologies with decoupled KL divergences.
- G-invariant feature maps ensure consistent decoder outputs for quotient manifolds.
- Anchor constraints align learned coordinates with true generative factors.
Method
The framework involves decomposing manifolds into elementary factors, selecting reparametrizable encoder-prior pairs, constructing G-invariant feature maps for quotients, and adding anchor constraints.
In practice
- Use Wrapped Normal for S^1 factors and Kumaraswamy for [0,1] factors.
- Apply coordinate transformations like "arctan2" for smooth angular gradients.
- Employ Reynolds operator to construct G-invariant features for quotient manifolds.
Topics
- Variational Autoencoders
- Latent Space Topology
- Non-Euclidean Manifolds
- Product Covering Spaces
- Reparameterization Trick
- Geometric Deep Learning
- Anchor Constraints
Code references
Best for: Research Scientist, AI Scientist, Machine Learning Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CV updates on arXiv.org.