All Projects → timbmg → Sentence Vae

timbmg / Sentence Vae

PyTorch Re-Implementation of "Generating Sentences from a Continuous Space" by Bowman et al 2015 https://arxiv.org/abs/1511.06349

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sentence Vae

Awesome Vaes
A curated list of awesome work on VAEs, disentanglement, representation learning, and generative models.
Stars: ✭ 418 (-9.52%)
Mutual labels:  generative-model, vae
InpaintNet
Code accompanying ISMIR'19 paper titled "Learning to Traverse Latent Spaces for Musical Score Inpaintning"
Stars: ✭ 48 (-89.61%)
Mutual labels:  generative-model, vae
Attend infer repeat
A Tensorfflow implementation of Attend, Infer, Repeat
Stars: ✭ 82 (-82.25%)
Mutual labels:  generative-model, vae
Pytorch Mnist Vae
Stars: ✭ 32 (-93.07%)
Mutual labels:  generative-model, vae
generative deep learning
Generative Deep Learning Sessions led by Anugraha Sinha (Machine Learning Tokyo)
Stars: ✭ 24 (-94.81%)
Mutual labels:  generative-model, vae
Dfc Vae
Variational Autoencoder trained by Feature Perceputal Loss
Stars: ✭ 74 (-83.98%)
Mutual labels:  generative-model, vae
Tf Vqvae
Tensorflow Implementation of the paper [Neural Discrete Representation Learning](https://arxiv.org/abs/1711.00937) (VQ-VAE).
Stars: ✭ 226 (-51.08%)
Mutual labels:  generative-model, vae
Vae protein function
Protein function prediction using a variational autoencoder
Stars: ✭ 57 (-87.66%)
Mutual labels:  generative-model, vae
char-VAE
Inspired by the neural style algorithm in the computer vision field, we propose a high-level language model with the aim of adapting the linguistic style.
Stars: ✭ 18 (-96.1%)
Mutual labels:  generative-model, vae
style-vae
Implementation of VAE and Style-GAN Architecture Achieving State of the Art Reconstruction
Stars: ✭ 25 (-94.59%)
Mutual labels:  generative-model, vae
Generative Models
Collection of generative models, e.g. GAN, VAE in Pytorch and Tensorflow.
Stars: ✭ 6,701 (+1350.43%)
Mutual labels:  generative-model, vae
srVAE
VAE with RealNVP prior and Super-Resolution VAE in PyTorch. Code release for https://arxiv.org/abs/2006.05218.
Stars: ✭ 56 (-87.88%)
Mutual labels:  generative-model, vae
Vae For Image Generation
Implemented Variational Autoencoder generative model in Keras for image generation and its latent space visualization on MNIST and CIFAR10 datasets
Stars: ✭ 87 (-81.17%)
Mutual labels:  generative-model, vae
vqvae-2
PyTorch implementation of VQ-VAE-2 from "Generating Diverse High-Fidelity Images with VQ-VAE-2"
Stars: ✭ 65 (-85.93%)
Mutual labels:  generative-model, vae
DiffuseVAE
A combination of VAE's and Diffusion Models for efficient, controllable and high-fidelity generation from low-dimensional latents
Stars: ✭ 81 (-82.47%)
Mutual labels:  generative-model, vae
Tensorflow Generative Model Collections
Collection of generative models in Tensorflow
Stars: ✭ 3,785 (+719.26%)
Mutual labels:  generative-model, vae
Pytorch rvae
Recurrent Variational Autoencoder that generates sequential data implemented with pytorch
Stars: ✭ 332 (-28.14%)
Mutual labels:  vae
Pytorch Vqvae
Vector Quantized VAEs - PyTorch Implementation
Stars: ✭ 396 (-14.29%)
Mutual labels:  vae
Beta Vae
Pytorch implementation of β-VAE
Stars: ✭ 326 (-29.44%)
Mutual labels:  vae
Gran
Efficient Graph Generation with Graph Recurrent Attention Networks, Deep Generative Model of Graphs, Graph Neural Networks, NeurIPS 2019
Stars: ✭ 312 (-32.47%)
Mutual labels:  generative-model

Sentence Variational Autoencoder

PyTorch re-implementation of Generating Sentences from a Continuous Space by Bowman et al. 2015. Model Architecture Note: This implementation does not support LSTM's at the moment, but RNN's and GRU's.

Results

Training

ELBO

ELBO

Negative Log Likelihood

NLL

KL Divergence

KL KL Weight

Performance

Training was stopped after 4 epochs. The true ELBO was optimized for approximately 1 epoch (as can bee see in the graph above). Results are averaged over entire split.

Split NLL KL
Train 99.821 7.944
Validation 103.220 7.346
Test 103.967 7.269

Samples

Sentenes have been obtained after sampling from z ~ N(0, I).

mr . n who was n't n with his own staff and the n n n n n
in the n of the n of the u . s . companies are n't likely to be reached for comment
when they were n in the n and then they were n a n n
but the company said it will be n by the end of the n n and n n
but the company said that it will be n n of the u . s . economy

Interpolating Sentences

Sentenes have been obtained after sampling twice from z ~ N(0, I) and the interpolating the two samples.

the company said it will be n with the exception of the company
but the company said it will be n with the exception of the company ' s shares outstanding
but the company said that the company ' s n n and n n
but the company ' s n n in the past two years ago
but the company ' s n n in the past two years ago
but in the past few years ago that the company ' s n n
but in the past few years ago that they were n't disclosed
but in the past few years ago that they were n't disclosed
but in a statement that they were n't aware of the $ n million in the past few weeks
but in a statement that they were n't paid by the end of the past few weeks

Training

To run the training, please download the Penn Tree Bank data first (download from Tomas Mikolov's webpage). The code expects to find at least ptb.train.txt and ptb.valid.txt in the specified data directory. The data can also be donwloaded with the dowloaddata.sh script.

Then training can be executed with the following command:

python3 train.py

The following arguments are available:

--data_dir The path to the directory where PTB data is stored, and auxiliary data files will be stored.
--create_data If provided, new auxiliary data files will be created form the source data.
--max_sequence_length Specifies the cut off of long sentences.
--min_occ If a word occurs less than "min_occ" times in the corpus, it will be replaced by the token.
--test If provided, performance will also be measured on the test set.

-ep, --epochs
-bs, --batch_size
-lr, --learning_rate

-eb, --embedding_size
-rnn, --rnn_type Either 'rnn' or 'gru'.
-hs, --hidden_size
-nl, --num_layers
-bi, --bidirectional
-ls, --latent_size
-wd, --word_dropout Word dropout applied to the input of the Decoder, which means words will be replaced by <unk> with a probability of word_dropout.
-ed, --embedding_dropout Word embedding dropout applied to the input of the Decoder.

-af, --anneal_function Either 'logistic' or 'linear'.
-k, --k Steepness of the logistic annealing function.
-x0, --x0 For 'logistic', this is the mid-point (i.e. when the weight is 0.5); for 'linear' this is the denominator.

-v, --print_every
-tb, --tensorboard_logging If provided, training progress is monitored with tensorboard.
-log, --logdir Directory of log files for tensorboard.
-bin,--save_model_path Directory where to store model checkpoints.

Inference

For obtaining samples and interpolating between senteces, inference.py can be used.

python3 inference.py -c $CHECKPOINT -n $NUM_SAMPLES
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].