Giter Club home page Giter Club logo

-auto-encoding-variational-bayes-aka-vae's Introduction

VAE -- Variational Autoencoder

Implementation of VAE model, following the paper: VAE. The encoder and decoder functions are implemented using fully strided convoluttional layers and transposed convolution layers respectively. As suggested by authors we have implemented Gaussian decoders and Gaussian prior in this work.

Setup

  • Python 3.5+
  • Tensorflow 1.9

Relevant Code Files

File config.py contains the hyper-parameters for VAE reported results.

File vae.py contains the code to train VAE model.

Similarly, as the name suggests, file vae_inference.py contains the code to test the trained VAE model.

Usage

Training a model

NOTE: For celebA, make sure you have the downloaded dataset from here and keep it in the current directory of project.

python vae.py

Test a trained model

First place the model weights in model_directory (mentioned in vae_inference.py) and then:

python vae_inference.py 

Empirical Observations

  • We observe same inferences for KL weight as discussed here.

  • Although VAE has a more stable behaviour than VAE/GAN. However, the quality of VAE generations are less plausible than VAE/GAN generations.

  • Essentially, the generations of VAE are blurry i.e it does not capture the small details of generated people.

  • Blurry issue of VAE is explained by following:

    • The l2 loss function used for reconstruction loss.
    • There is no explicit term penalizing the decoder for generating non-plausible images. -- Alleviating this by an adversary gives birth to VAE/GAN model. Check my implementation for here.
Why minimizing the l2 loss function produces blurred images?

After a bit of math, minimizing the l2 loss boils down to minimize the forward-KL divergence. The issue with forward-KL divergence is that it does not penalizes the model when our model puts weight on the region of data which is disjoint from the support of true distribution.

Generations

MNIST Celeb-A

Reconstructions

MNIST Original MNIST Reconstruction
Celeb-A Original Celeb-A Reconstruction

-auto-encoding-variational-bayes-aka-vae's People

Contributors

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