Giter Club home page Giter Club logo

sequential-variational-autoencoder's Introduction

Implementation of Sequential VAE

This is the implementation of the Sequential VAE in Towards a Deeper Understanding of Variational Autoencoding Models. The paper identifies a link between power of latent code and sharpness of generated samples. We are able to generate fairly sharp samples by gradually augmenting the power of latent code.

The model is a (non-homogeneous) Markov chain. For each step, we take the results from previous step, learn a new latent code, and train the model to perform reconstruction conditioned on both. We extensively use shortcut/resnet connections so that result from previous step can be well preserved. Samples look like this

seq_vae_celeba

seq_vae_lsun

Training with Default Configuration

CelebA

For CelebA download the dataset from http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html

Download the aligned and cropped version, unzip into a folder, and pass the path of that folder as db_path argument. Note that your db_path folder should directly contain all the image files without any additional nesting. You folder should look like this

celeba_dataset_illustratoin

Now you can train by running

python main.py --dataset=celebA --db_path=/path/to/celebA/dataset

You can see the visualizations in the folder $pwd/models/[network_name]/samples

LSUN

For LSUN bedroom we provide a preprocessed version available for download here (Google Drive). The images have been center cropped, resized, and organized into batches with 10000 images each for efficient I/O.

Download this dataset, unzip into a folder. This folder should also directly contain all the npy files without additional nesting. You can train by running

python main.py --dataset=lsun --db_path=/path/to/lsun/dataset

For other LSUN scene classes you should first preprocess the files into batches of 10000, where each batch is a numpy array [batch, height, width, channel]. Place these batches into the db_path folder.

More Options

  • To use a particular GPU/GPUs add option --gpus=[ids] such as --gpus=0,1 to use GPU 0 and 1. The visualizations in the paper are produced after 2 days of training on a single Titan X.
  • To use other architectures other than default, use --netname=[name]. For supported architectures please refer to code. The name is the unique identifier for the network, and all related training log, visualizations, and checkpoint files, etc will be stored in the directory $pwd/model/netname. For example, to run visualization with tensorboard use tensorboard --logdir=[that directory]
  • To also visualize the training process with a GUI window add --use_gui. By default all plots will be stored to network directory, this will also plot them in a window in addition to that.
  • To change batch size, add --batch_size=[size]
  • To visualize and plot the autoencoding reconstruction of the model, add --plot_reconstruction
  • To add Gaussian and salt and pepper noise to perform denoise training add --denoise_train
  • To control the number of batches before we visualize and make plots, use --vis_frequency=[num_batch]

Related Work

The baseline architecture used is the Variational Ladder Autoencoder

This model can be viewed as a generalization of Infusion training. The difference is that for each time step we explicitly learn a latent code rather than using random pixels from ground truth as latent code.

sequential-variational-autoencoder's People

Contributors

jdvorak avatar jiamings avatar shengjiazhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.