A vector-quantized autoencoder (VQ-VAE) with a learned codebook, trained in your browser on MNIST, Fashion-MNIST or 2-D point clouds. Each pair of latent dimensions snaps to the nearest code of its own codebook, and the plots show the codes, the region each one claims and the encoded data. The decoder only ever sees codes; MNIST starts from pretrained networks.
Things to try
- Drag the encoding in a codebook plot: it snaps to the nearest code when released.
- Choose codes in the strip below the plots to decode any combination of them.
- Compare codebook learning by moving averages (EMA) with learning through the loss, and change the commitment weight β.
- Change the codes per pair (up to 20) or the latent dimensions (2, 4 or 8).
Related demos
All demos