I am interested in making a contribution to Emedded Optimal Transport by extending some of the low dimensional encoding techniques to Optimal Transport. This is the first of my projects to learn the computational literature and techniques
A Variational Autoencoder (VAE) is a type of generative model. It learns to represent data (like images, text, etc.) using a smaller number of latent variables, and it can also generate new data that looks like the training data.
It’s based on two main ideas:
- Autoencoders – Learn to compress and then reconstruct data.
- Variational inference – Approximate complex probability distributions using simpler ones.
A VAE consists of two neural networks:
| Component | Name | Description |
| --------- | ---------------------------- | ------------------------------------------------------------------------------------ |
| Encoder | \( q\φ(z | x) \) | Takes data \(x\) and produces a distribution over latent variables \(z\). |
| Decoder | \( p\θ(x | z) \) | Takes a sample \(z\)and tries to reconstruct the original data \(x\). |
Instead of mapping \(x → z → x\) directly, the VAE treats
Learn two things:
- How to compress data into a meaningful latent representation
$z$ . - How to generate new data from latent variables.
We want to learn the joint probability:
\begin{equation} p_θ(x, z) = p_θ(x|z)p(z) \end{equation}
and its marginal:
\begin{equation} p_θ(x) = ∫ p_θ(x|z) p(z) \, dz \end{equation}
But this integral is hard, so we use a trick.
We approximate the true posterior \(p(z|x)\) using a simpler
distribution
\begin{equation} log p_θ(x) \geq \mathbb{E}q_φ(z|x)[log p_θ(x|z)] - \mathrm{KL}(q_φ(z|x) \Vert p(z)) \end{equation}
- \(\mathbb{E}q_φ(z|x)[log p_θ(x|z)]\) = reconstruction accuracy.
- \(\mathrm{KL}(⋅)\) = how close our approximation \(q\) is to the prior \(p(z)\) (usually a standard normal).
- Given input \(x\), encode it to parameters \(μ(x), σ(x)\) for a Gaussian distribution.
- Sample \(z ∼ \mathcal{N}(μ(x), σ^2(x))\) using the reparameterization trick:
\begin{equation} z = μ + σ o ε, \quad ε ∼ \mathcal{N}(0, I) \end{equation}
- Decode \(z → x’\) and compare to original \(x\).
- Optimize the ELBO using gradient descent.
- Uncertainty-aware: Learns distributions, not just points.
- Generative: Can sample new data points by sampling \(z ∼ \mathcal{N}(0, I)\).
- Smooth latent space: Small changes in \(z\) lead to smooth changes in generated \(x\).
- Principled framework: Based on variational inference and probability.
| Concept | Object | Description |
| --------------------- | ----------------------------- | --------------------------------------------------------------- |
| Latent Variable | \(z\) | Hidden representation of the data |
| Encoder | \( q\φ(z | x) \) | Neural network that learns \(z\) from \(x\) |
| Decoder | \( p\θ(x | z) \) | Reconstructs or generates \(x\) from \(z\) |
| ELBO | A loss function that balances reconstruction and regularization | |
| Reparameterization | Trick to make sampling differentiable for backpropagation |