All Projects → daib13 → Twostagevae

daib13 / Twostagevae

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Twostagevae

Numpy Ml
Machine learning, in numpy
Stars: ✭ 11,100 (+5681.25%)
Mutual labels:  vae
Vae Seq
Variational Auto-Encoders in a Sequential Setting.
Stars: ✭ 145 (-24.48%)
Mutual labels:  vae
Factorvae
Pytorch implementation of FactorVAE proposed in Disentangling by Factorising(http://arxiv.org/abs/1802.05983)
Stars: ✭ 176 (-8.33%)
Mutual labels:  vae
O Gan
O-GAN: Extremely Concise Approach for Auto-Encoding Generative Adversarial Networks
Stars: ✭ 117 (-39.06%)
Mutual labels:  vae
Tensorflow Mnist Cvae
Tensorflow implementation of conditional variational auto-encoder for MNIST
Stars: ✭ 139 (-27.6%)
Mutual labels:  vae
Pytorch Vae
A Collection of Variational Autoencoders (VAE) in PyTorch.
Stars: ✭ 2,704 (+1308.33%)
Mutual labels:  vae
Cross Lingual Voice Cloning
Tacotron 2 - PyTorch implementation with faster-than-realtime inference modified to enable cross lingual voice cloning.
Stars: ✭ 106 (-44.79%)
Mutual labels:  vae
Adversarial video summary
Unofficial PyTorch Implementation of SUM-GAN from "Unsupervised Video Summarization with Adversarial LSTM Networks" (CVPR 2017)
Stars: ✭ 187 (-2.6%)
Mutual labels:  vae
Vmf vae nlp
Code for EMNLP18 paper "Spherical Latent Spaces for Stable Variational Autoencoders"
Stars: ✭ 140 (-27.08%)
Mutual labels:  vae
A Hierarchical Latent Structure For Variational Conversation Modeling
PyTorch Implementation of "A Hierarchical Latent Structure for Variational Conversation Modeling" (NAACL 2018 Oral)
Stars: ✭ 153 (-20.31%)
Mutual labels:  vae
Vae Tensorflow
A Tensorflow implementation of a Variational Autoencoder for the deep learning course at the University of Southern California (USC).
Stars: ✭ 117 (-39.06%)
Mutual labels:  vae
Deep Learning With Python
Example projects I completed to understand Deep Learning techniques with Tensorflow. Please note that I do no longer maintain this repository.
Stars: ✭ 134 (-30.21%)
Mutual labels:  vae
Sylvester Flows
Stars: ✭ 152 (-20.83%)
Mutual labels:  vae
Pytorch cpp
Deep Learning sample programs using PyTorch in C++
Stars: ✭ 114 (-40.62%)
Mutual labels:  vae
Optimus
Optimus: the first large-scale pre-trained VAE language model
Stars: ✭ 180 (-6.25%)
Mutual labels:  vae
Mojitalk
Code for "MojiTalk: Generating Emotional Responses at Scale" https://arxiv.org/abs/1711.04090
Stars: ✭ 107 (-44.27%)
Mutual labels:  vae
Beat Blender
Blend beats using machine learning to create music in a fun new way.
Stars: ✭ 147 (-23.44%)
Mutual labels:  vae
Disentangled vae
Replicating "Understanding disentangling in β-VAE"
Stars: ✭ 188 (-2.08%)
Mutual labels:  vae
Pytorch Vae
A CNN Variational Autoencoder (CNN-VAE) implemented in PyTorch
Stars: ✭ 181 (-5.73%)
Mutual labels:  vae
Vae Lagging Encoder
PyTorch implementation of "Lagging Inference Networks and Posterior Collapse in Variational Autoencoders" (ICLR 2019)
Stars: ✭ 153 (-20.31%)
Mutual labels:  vae

TwoStageVAE

This is the code for the two-stage VAE model proposed in our ICLR 2019 paper "Diagnoising and Enhancing VAE Models" [1].

[1] Dai, B. and Wipf, D. Diagnosing and enhancing VAE models. In International Conference on Learning Representations, 2019.

Step 1. Prepare Dataset

We do experiments on MNIST, Fashion-MNIST, Cifar-10 and CelebA dataset. These data are downloaded from the official website and then transformed to npy format using preprocess.py script. Follow the next steps to prepare each dataset. Or you can directly download the data from Google Doc. (If you directly download the data from Google Doc, extract the file to the root folder.)

MNIST

Download the data from: http://yann.lecun.com/exdb/mnist/

You will get the files t10k-images-idx3-ubyte, t10k-labels-idx1-ubyte, train-images-idx3-ubyte, train-labels-idx1-ubyte. Put them in the folder ./data/mnist.

Fashion-MNIST

Download the data from: https://github.com/zalandoresearch/fashion-mnist

Again you will get four files t10k-images-idx3-ubyte, t10k-labels-idx1-ubyte, train-images-idx3-ubyte, train-labels-idx1-ubyte. Put them in the folder ./data/fashion.

To preprocess MNIST and Fashion-MNIST, you also need to install the package python-mnist by

pip install python-mnist

Cifar-10

Download the data (python version) from: https://www.cs.toronto.edu/~kriz/cifar.html

Extract the downloaded file in ./data/cifar10. There will be one sub-folder called cifar-10-batches-py. Inside this folder, there will be 6 files named data_batch_1, data_batch_2, data_batch_3, data_batch_4, data_batch_5 and test_batch.

CelebA Dataset

Download the data from: http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html

Put the extracted images files (202599 jpg files) in the folder ./data/celeba/img_align_celeba.

Preprocess

Transform the data into .npy format by running the command

python preprocess.py

You will obtain some .npy files in each subfolder under ./data.

Step 2. Run Two-Stage VAE

Train the model by running

python demo.py --dataset [DATASET] --network-structure [NETWORK] --exp-name [EXP] --gpu [GPU]

The argument --exp-name allows you to set up your experiemnt ID. It will make a folder ./experiments/[DATASET]/[EXP] to put all the output files and images. If you only want to test the model, add --val in the command line.

  • Datasets: Use lowercases. You can select from: mnist, fashion, cifar10 and celeba.
  • Network structure: You can select from Infogan, Wae and Resnet. To implement your own network structures, you can add a new derived class of TwoStageVaeModel in ./network/two_stage_vae_model.py and just implement the build_encoder1 and build_decoder1 functions.
  • Cross entropy loss: If you want to run the experiments with cross entropy loss (VAE(cross-entr.) method in the paper), you can add --cross-entropy-loss in the command line.

Generated samples

To reproduce the following results with Resnet architecture, run

python demo.py --dataset celeba --epochs 100 --lr-epochs 40 --epochs2 100 --lr-epochs2 40 --network-structure Resnet --num-scale 4 --base-dim 32 --latent-dim 128 --gpu [GPU] --exp-name [EXP]
  • Random samples generated by the first stage VAE using Resnet structure on CelebA:

Resnet 1st stage

  • Random samples generated by the second stage VAE using Resnet structure on CelebA:

Resnet 2nd stage

To reproduce the following results with WAE architecture, run

python dome.py --dataset celeba --epochs 70 --lr-epochs 30 --epochs2 70 --lr-epochs2 30 --network-structure Wae --gpu [GPU] --exp-name [EXP]
  • Random samples generated by the first stage VAE using WAE network structure on CelebA:

WAE 1st stage

  • Random samples generated by the second stage VAE using WAE network structure on CelebA:

WAE 2nd stage

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].