A structured variational autoencoder (SVAE) with a Gaussian mixture prior on a 2-D latent space, trained in your browser on MNIST, Fashion-MNIST or 2-D point clouds. The encoder outputs a Gaussian potential, and mean field inference combines it with the mixture to give q(z) and the component probabilities q(k). The latent plot shows each component’s density, the potential and q(z) for the selected observation, with the prior weights π beside q(k) below.
Things to try
- Turn on Inference path under Display to follow q(z)’s mean through the steps of mean field inference.
- Compare unrolled and implicit (Richardson) gradients, and gradient updates of point estimates with natural-gradient updates of q(θ) for the prior.
- Run the warm start: a plain VAE first, then the mixture fit to its encodings by EM, then SVAE training from there.
- Use the sparse q(k) and Balance terms together to separate the clusters while keeping every component in use.
Related demos
All demos