GithubHelp home page GithubHelp logo

tanguyurvoy / normalizing-flows Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bgroenks96/normalizing-flows

0.0 1.0 0.0 12.34 MB

Implementations of normalizing flows using python and tensorflow

License: MIT License

Jupyter Notebook 71.89% Python 28.11%

normalizing-flows's Introduction

normalizing-flows

Implementations of normalizing flows for variational inference using Python (3.6+) and Tensorflow (2.0+).

flows_visualization

Installation

pip install git+https://github.com/bgroenks96/normalizing-flows

Getting started

Take a look at the intro notebook for a gentle introduction to normalizing flows.

This library currently implements the following flows:

1 Implemented via JointFlowLVM; the flow architecture from the paper is not currently supported. However, Glow can (and possibly should) be used instead.

API overview

The normalizing_flows package currently provides two interfaces for building flow-based models:

  1. Marginal inference (FlowLVM, JointFlowLVM)

  2. Variational autoencoder (GatedConvVAE)

Marginal inference models directly optimize the log-evidence $\log p(x)$ via the inverse transform of the flow. Note that this requires the flow to support bidirectional (forward + inverse) evaluation. The only flow architecture in this package which supports this (currently) is Glow.

VAE inference minimizes the evidence lower bound (ELBO) and thus requires only forward evaluations, $z \rightarrow z'$ (i.e. the inverse need not be tractable). For VAE inference, Planar, Radial, and Triangular Sylvester flows are all supported via FlowLayer (see the intro notebook for an example). In theory, Glow could also be used in a VAE, but this has not been tested and is not currently supported by FlowLayer, which assumes the latent space to be dense and non-spatial.

Exmaple: Planar vs Sylvester flows

t-SNE mapped latent space across 4 flow steps

Planar vs. Sylvester

Future development

Please note that this package was developed for the purposes of the author's own research. As such, it might not be as fully featured or rounded out as other libraries. However, contributions and discussions about new features and flow implementations is both welcome and encouraged!

Additional types flows under consideration for future versions:

  • Orthogonal/Householder Sylvester flows

  • Inverse Autoregressive Flows (Kingma et al, 2016)

  • Neural Autoregressive Flows (Huang et al, 2018)

Currently, this library has no published documentation outside of docstrings in the code. This may change in the future.

Please feel free to create an issue if anything isn't clear or more documentation is needed on specific APIs.

License and use

This library is free and open source software under the MIT license.

normalizing-flows's People

Contributors

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