Code Monkey home page Code Monkey logo

cpab-nsf's Introduction

Neural Spline Flows

A record of the code and experiments for the paper:

C. Durkan, A. Bekasov, I. Murray, G. Papamakarios, Neural Spline Flows, NeurIPS 2019. [arXiv] [bibtex]

Work in this repository has now stopped. Please go to nflows for an updated and pip-installable normalizing flows framework for PyTorch.

Dependencies

See environment.yml for required Conda/pip packages, or use this to create a Conda environment with all dependencies:

conda env create -f environment.yml

Tested with Python 3.5 and PyTorch 1.1.

Data

Data for density-estimation experiments is available at https://zenodo.org/record/1161203#.Wmtf_XVl8eN.

Data for VAE and image-modeling experiments is downloaded automatically using either torchvision or custom data providers.

Usage

DATAROOT environment variable needs to be set before running experiments.

2D toy density experiments

Use experiments/face.py or experiments/plane.py.

Density-estimation experiments

Use experiments/uci.py.

VAE experiments

Use experiments/vae_.py.

Image-modeling experiments

Use experiments/images.py.

Sacred is used to organize image experiments. See the documentation for more information.

experiments/image_configs contains .json configurations used for RQ-NSF (C) experiments. For baseline experiments use coupling_layer_type='affine'.

For example, to run RQ-NSF (C) on CIFAR-10 8-bit:

python experiments/images.py with experiments/image_configs/cifar-10-8bit.json

Corresponding affine baseline run:

python experiments/images.py with experiments/image_configs/cifar-10-8bit.json coupling_layer_type='affine'

To evaluate on the test set:

python experiments/images.py eval_on_test with experiments/image_configs/cifar-10-8bit.json flow_checkpoint='<saved_checkpoint>'

To sample:

python experiments/images.py sample with experiments/image_configs/cifar-10-8bit.json flow_checkpoint='<saved_checkpoint>'

cpab-nsf's People

Contributors

michealxh-l 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.