Learning latent space representations of data remains to be an important task in machine learning. This model, the Vector-Quantized Variational Autoencoder (VQ-VAE) builds upon traditional VAEs in two ways.
The encoder network outputs discrete, rather than continous, codes.
The prior is learned rather than static.
To learn discrete latent representations, ideas from vector quantisation (VQ) are used. Using the VQ method allows the model to avoid issues of
"posterior collapse"
. By pairing these representations with an autoregressive prior, VQ-VAE models can generate high quality images, videos, speech as well as doing high quality speaker conversion and unsupervised learning of phonemes, providing further evidence of the utility of the learnt representations.
This model has been trained using code from this
example
, and a result of this
paper.
Model
Below we have a graphic from the paper above, showing the VQ-VAE model architecture and quantization process.
Intended uses & limitations
This model is intended to be used for educational purposes. To train your own VQ-VAE model, follow along with this
example
Training and evaluation data
This model is trained using the popular MNIST dataset.
This dataset can be found/used with the following command
keras.datasets.mnist.load_data()
Hyperparameters
The model was trained usign the following
Latent Dimension = 16
Number of Embeddings = 128
Epochs = 30
The author of the example encourages toying with both the number and size of the embeddings to see how it affects the results.
Reconstruction
Below, we can see a few examples of MNIST digits being reconstructed after passing through our model.
Discrete Latent Space
Below, we can see a few examples of MNIST digits being mapped to a discrete latent space.
Next Steps
The keras example details of this model shows it can be paired with a PixelCNN for novel image generation. Check out the example linked above to try it yourself.
Runs of keras-io vq-vae on huggingface.co
6
Total runs
0
24-hour runs
0
3-day runs
-1
7-day runs
-14
30-day runs
More Information About vq-vae huggingface.co Model
vq-vae huggingface.co
vq-vae huggingface.co is an AI model on huggingface.co that provides vq-vae's model effect (), which can be used instantly with this keras-io vq-vae model. huggingface.co supports a free trial of the vq-vae model, and also provides paid use of the vq-vae. Support call vq-vae model through api, including Node.js, Python, http.
vq-vae huggingface.co is an online trial and call api platform, which integrates vq-vae's modeling effects, including api services, and provides a free online trial of vq-vae, you can try vq-vae online for free by clicking the link below.
keras-io vq-vae online free url in huggingface.co:
vq-vae is an open source model from GitHub that offers a free installation service, and any user can find vq-vae on GitHub to install. At the same time, huggingface.co provides the effect of vq-vae install, users can directly use vq-vae installed effect in huggingface.co for debugging and trial. It also supports api for free installation.