Giter VIP home page Giter VIP logo

infomaxvae's Introduction

Disclaimer

This project is by David Bachmann (bacdavid). It is not published or affiliated.

InfomaxVAE

Obtain the latent variables that contain the maximal information wrt. sample (mutual information). This work is inspired by the InfoGAN (Chen et al., https://arxiv.org/abs/1606.03657) where the mutual information between selected channels and the sample is maximized.

Fig. 1: Perturbation of the single InfomaxVAE-style latent variable. It can be observed that the lighting is addressed by this variable: In other words, the maximum information is contained in the knowledge about the lumination.

Fig. 2: All variables but the single InfomaxVAE-style latent variable are masked for the reconstruction. This is most likely close to what a regular autoencoder with a single latent variable would produce.

Fig. 3: The remining 99 VAE-style latent variables result in a much better reconstruction than just the one InfomaxVAE-style variable. However, the lumination is still better when including the single Infomax-style variable, which naturally is an important factor for the reconstruction.

Fig. 4: Reconstruction when including both types of latent variables.

Fig. 5: Original samples.

Details

Variational Auto Encoder

  • Typical VAE network for the generator: Encoder - Sampler - Decoder
  • Mainly convolutional layers for the encoder and de-convolutional layers for the decoder with kernel size 5x5 and strides of 2x2
  • Batch Norm followed by ReLU after the (de-)convolution
  • 64 - 128 - 256, 256 - 128 - 64 - 3 (RGB) feature maps for encoder and decoder, respectively

Latent Variables

  • VAE-style latent variables are denoted by z
  • InfomaxVAE-style latent variables by c

Loss

The original VAE-loss is

mse(x, x_vae) + KL(p(z | x) || p(z)).

By adding the mutual information term, the following is obtained:
Please note that [...;...] denotes the concatenation operator

mse(x, x_vae) + KL(p([z;c] | x) || p([z;c])) - I(x; c) 
= mse(x, x_vae) + KL(p([z;c] | x) || p([z;c])) - KL(p(c | x) || p(c))
= mse(x, x_vae) + KL(p(z | x) || p(z)).

In other words, exclude the InfomaxVAE-style latent variables from the regularization term.

Try it

Simply open the file

train.py

and perform the required adjustments.

infomaxvae's People

Contributors

bacdavid avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

dliofindia

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.