Code Monkey home page Code Monkey logo

variational-mnist's Introduction

Variational Autoencoder and Stochastic Variational Inference

Intro

An implementation of the Variational Autoencoder based on Auto-Encoding Variational Bayes (Kingma and Welling 2013.).

VAE was trained and performed inference on binarized MNIST (handwritten digits) dataset.

Model Definition

For an i.i.d. dataset with continuous latent variables per data point, the Variational Bayes algorithm optimizes a recognition network (encoder) that performs approximate posterior inference using ancestral sampling.

Prior

Latent variable z is sampled from prior distribution on z usuing true parameters theta*.

Likelihood

Likelihood of data x (i.e. all 784 pixels of image) is from a conditional distribution on z using true parameters theta*. Here the distribution is a product of independent Bernoulli's whose means are outputted by the generator network (decoder) parameterized by theta.

Variational Objective

Using an closed form expression for two Gaussians.

KL divergence

Like a regularization term, calculates the expected log ratio of approximate posterior from prior.

Negative expectated reconstruction error

Negative log likelihood of datapoints.

Visualizations

Post training, let's explore the properties of our trained approximate posterior.

Generative model

Sampling latent from prior then using the decoder (generative model) to compute the bernoulli means over the pixels of image given latent z: binary image sample

Latent Posterior

Inferred latent posterior means from the encoder (recognition model): interpolate between latent rep of two points

Linear Interpolation

Generated samples from latent representations interpolated between the posterior means of two different training examples: sampled pairs 1-2, 3-8, 4-5

Joint distribution

Isocountours from joint distribution over latent z (note: 2D in this case, but can be higher for more expressivity) and trained top half of image x: true and variational latent log posteriors

Creating Frankenstein images with optimized approximate posterior

Sample a latent z, feed into our probabilistic decoder, and infer the Bernouilli means of all bottom half of the image's pixels: Predicting the bottom half of an image from the top

variational-mnist's People

Contributors

xwinxu avatar

Stargazers

Vladislav Gromadskii avatar KK.Zhou avatar Mauricio avatar Zhaoyu Zeng avatar  avatar  avatar Karan Brar avatar Mark Wells avatar Emanuele Ballarin avatar Emerson Hsieh avatar

Watchers

James Cloos avatar  avatar paper2code - bot avatar

Forkers

loybenitez

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.