All Projects → karpathy → Deep Vector Quantization

karpathy / Deep Vector Quantization

Licence: mit
VQVAEs, GumbelSoftmaxes and friends

Projects that are alternatives of or similar to Deep Vector Quantization

Interview Prepartion Data Science
Stars: ✭ 220 (-0.9%)
Mutual labels:  jupyter-notebook
Scikit Geometry
Scientific Python Geometric Algorithms Library
Stars: ✭ 220 (-0.9%)
Mutual labels:  jupyter-notebook
Data Augmentation For Wearable Sensor Data
A sample code of data augmentation methods for wearable sensor data (time-series data)
Stars: ✭ 222 (+0%)
Mutual labels:  jupyter-notebook
Interpret Text
A library that incorporates state-of-the-art explainers for text-based machine learning models and visualizes the result with a built-in dashboard.
Stars: ✭ 220 (-0.9%)
Mutual labels:  jupyter-notebook
Tensorflow Tutorial
A tutorial on TensorFlow
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Sklearn pycon2014
Repository containing files for my PyCon 2014 scikit-learn tutorial.
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Materials
Bonus materials, exercises, and example projects for our Python tutorials
Stars: ✭ 3,211 (+1346.4%)
Mutual labels:  jupyter-notebook
Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+1065.32%)
Mutual labels:  jupyter-notebook
Neural Style Painting
Implementing of the "A Neural Algorithm of Artistic Style"
Stars: ✭ 219 (-1.35%)
Mutual labels:  jupyter-notebook
Natural Language Processing With Tensorflow
Natural Language Processing with TensorFlow, published by Packt
Stars: ✭ 222 (+0%)
Mutual labels:  jupyter-notebook
Pythondemo
虾神的Python示例代码库
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Dl For Chatbot
Deep Learning / NLP tutorial for Chatbot Developers
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Team Learning Rs
主要存储Datawhale组队学习中“推荐系统”方向的资料。
Stars: ✭ 216 (-2.7%)
Mutual labels:  jupyter-notebook
Timeseries fastai
fastai V2 implementation of Timeseries classification papers.
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Sec
Seed, Expand, Constrain: Three Principles for Weakly-Supervised Image Segmentation
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Fauxtograph
Tools for using a variational auto-encoder for latent image encoding and generation.
Stars: ✭ 220 (-0.9%)
Mutual labels:  jupyter-notebook
Htmresearch
Experimental algorithms. Unsupported.
Stars: ✭ 221 (-0.45%)
Mutual labels:  jupyter-notebook
Ipython Notebooks
A collection of IPython notebooks covering various topics.
Stars: ✭ 2,543 (+1045.5%)
Mutual labels:  jupyter-notebook
Vqa demo
Visual Question Answering Demo on pretrained model
Stars: ✭ 222 (+0%)
Mutual labels:  jupyter-notebook
Melusine
Melusine is a high-level library for emails classification and feature extraction "dédiée aux courriels français".
Stars: ✭ 222 (+0%)
Mutual labels:  jupyter-notebook

deep vector quantization

Implements training code for VQVAE's, i.e. autoencoders with categorical latent variable bottlenecks, which are then easy to subsequently plug into existing infrastructure for modeling sequences of discrete variables (GPT and friends). dvq/vqvae.py is the entry point of the training script and a small training run can be called e.g. as:

cd dvq; python vqvae.py --gpus 1 --data_dir /somewhere/to/store/cifar10

This will reproduce the original DeepMind VQVAE paper (see references before) using a semi-small network on CIFAR-10. Work on this repo is ongoing and for now requires reading of code and understanding these approaches. Next up aiming to reproduce DALL-E result, for this most of the code is in place but we need to train with the logit laplace distribution, tune the gumbel softmax hyperparameters, and train on ImageNet+.

References

DeepMind's VQVAE

The VQVAE from the paper can be trained with --vq_flavor vqvae --enc_dec_flavor deepmind. I am able to get what I think are expected results on CIFAR-10 using VQVAE (judging by reconstruction loss achieved). However I had to resort to a data-driven intialization scheme with k-means (which is with current implementation not multi-gpu compatible), and which the sonnet repo does not use, potentially due to more careful model initialization treatment. When I do not use data-driven init the training exhibits catastrophic index collapse.

Jang et al. Gumbel Softmax

For this use --vq_flavor gumbel. Trains and converges to slightly higher reconstruction loss, but tuning the scale of the kl divergence loss and the temperature decay rate and the version of gumbel (soft/hard) has so far proved a little bit finicky. Also the whole thing trains much slower. Requires a bit more thorough hyperparameter search than a few one-off guesses.

OpenAI's DALL-E

Re-implementation is not yet complete, e.g. we still use MSE is still used as a loss, we still only train on CIFAR and use a smaller network, etc. However, the different encoder/decoder architecture trains and gives comparable results to the (simpler) DeepMind version on untuned 1-GPU trial runs on stride /4 VQVAEs. Situation is developing...

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].