GithubHelp home page GithubHelp logo

ali's Introduction

Adversarially Learned Inference

Code for the Adversarially Learned Inference paper.

Compiling the paper locally

From the repo's root directory,

$ cd papers
$ latexmk --pdf adverarially_learned_inference

Requirements

  • Blocks, development version
  • Fuel, development version

Setup

Clone the repository, then install with

$ pip install -e ALI

Downloading and converting the datasets

Set up your ~/.fuelrc file:

$ echo "data_path: \"<MY_DATA_PATH>\"" > ~/.fuelrc

Go to <MY_DATA_PATH>:

$ cd <MY_DATA_PATH>

Download the CIFAR-10 dataset:

$ fuel-download cifar10
$ fuel-convert cifar10
$ fuel-download cifar10 --clear

Download the SVHN format 2 dataset:

$ fuel-download svhn 2
$ fuel-convert svhn 2
$ fuel-download svhn 2 --clear

Download the CelebA dataset:

$ fuel-download celeba 64
$ fuel-convert celeba 64
$ fuel-download celeba 64 --clear

Training the models

Make sure you're in the repo's root directory.

CIFAR-10

$ THEANORC=theanorc python experiments/ali_cifar10.py

SVHN

$ THEANORC=theanorc python experiments/ali_svhn.py

CelebA

$ THEANORC=theanorc python experiments/ali_celeba.py

Toy task

$ THEANORC=theanorc python experiments/ali_mixture.py
$ THEANORC=theanorc python experiments/gan_mixture.py

Evaluating the models

Samples

$ THEANORC=theanorc scripts/sample [main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/sample ali_cifar10.tar

Interpolations

$ THEANORC=theanorc scripts/interpolate [which_dataset] [main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/interpolate celeba ali_celeba.tar

Reconstructions

$ THEANORC=theanorc scripts/reconstruct [which_dataset] [main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/reconstruct cifar10 ali_cifar10.tar

Semi-supervised learning on SVHN

First, preprocess the SVHN dataset with the learned ALI features:

$ THEANORC=theanorc scripts/preprocess_representations [main_loop.tar] [save_path.hdf5]

e.g.

$ THEANORC=theanorc scripts/preprocess_representations ali_svhn.tar ali_svhn_preprocessed.hdf5

Then, launch the semi-supervised script:

$ python experiments/semi_supervised_svhn.py ali_svhn.tar [save_path.hdf5]

e.g.

$ python experiments/semi_supervised_svhn.py ali_svhn_preprocessed.hdf5

[...]
Validation error rate = ... +- ...
Test error rate = ... +- ...

Toy task

$ THEANORC=theanorc scripts/generate_mixture_plots [ali_main_loop.tar] [gan_main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/generate_mixture_plots ali_mixture.tar gan_mixture.tar

ali's People

Contributors

vdumoulin avatar ishmaelbelghazi 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.