Git Product home page Git Product logo

csrae's Introduction

CSRAE

Implementation of a standard VAE using CS loss. The implemented package is based on the following paper.

General idea

The package contains an implementation of the standard Variational Autoencoder and the modifier Cauchy-Schwartz Regularized Autoencoder.

The general idea is to substitute the classical KL divergence of the standard VAE with a more detailed Cauchy-Schwartz divergence.

The latter allow us to compute in a closed form the divergence between Mixture of Gaussians, while the KL divergence can be only approximated between MoGs.

In this way it is possible to furnish as prior distribution a mixture of multivariate gaussians (assuming )

The model is the typical Standard VAE, what changes is the decoder and the sampling method.

We learn the prior distribution above through a decoder network giving the required means and variances of the MoGs distribution.

For the sampling instead, we modify the classical sampling from a normal distribution with a random sampling among the different Gaussians learnt in our mixture prior.

Implementation

The code is implemented in Pytorch, extending the base nn.Module with our custom implementation.

📂src
├─ 📄csrae.py # Contains the implementation of the CS autoencoder
├─ 📄experiment.py # Utility functions for training, validation, testing and sampling
├─ 📄main.py # Start point for the experiment
├─ 📄utils.py # Utility functions
└─ 📄vae.py # Standard VAE implementation for comparison

Execution

Open the file main.py to inspect the parser. It is possible to specify different input arguments, like epochs, number of K, etc..

csrae's People

Contributors

matteodefra avatar sabteo avatar

Watchers

 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.