• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Metropolis-Hastings GANs

This repository contains the source code supporting the paper Metropolis-Hastings Generative Adversarial Networks:

@inproceedings{Turner2019,
    author={Ryan Turner and Jane Hung and Eric Frank and Yunus Saatci and Jason Yosinski},
    title={Metropolis-Hastings Generative Adversarial Networks},
    booktitle={Proceedings of the 36th International Conference on Machine Learning},
    pages={6345--6353},
    year={2019}
}

For more on this project, see the Uber AI Labs Blog post.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

This code has been tested on Python 2.7.9 and the exact version of the dependencies are pinned in requirements.pip. It has been tested on Mac and Ubuntu.

Installing

First clone the repo:

git clone [email protected]:uber-research/metropolis-hastings-gans.git

Inside your virtual environments folder [ENVS] make the environment:

cd [ENVS]
virtualenv mhgan
source [ENVS]/mhgan/bin/activate

Move back into the git repo and run

pip install -r requirements.txt

You may want to run pip install -U pip first if you have an old version of pip.

This package also depends on benchmark tools. So also checkout that repo and install the package:

git clone https://github.com/rdturnermtl/benchmark_tools.git
cd benchmark_tools
pip install -e .

The environment should now all be setup to run the experiments.

Running the experiments

The main experiment script in this project is based on the pytorch DCGAN example. As such, it has the same command line interface.

One must specify a cache directory [DATA TMP] for the data to be stored and an output directory [RESULTS] for experiment results:

cd mhgan
python demo_mhgan.py --dataset cifar10 --dataroot [DATA TMP] --outf [RESULTS] --cuda --manualSeed 123

If there is no GPU on the system, drop the --cuda flag.

The script creates a new subdirectory to store the results to avoid overwriting the results of previous experiments. For instance: [RESULTS]/tmpNbBkwr. The created subdirectory name can be found in stdout at the start of demo_mhgan.py, which we call [RESULTS SUBDIR].

From the dumps in the [RESULTS SUBDIR] directory, summary plots can be made from the scripts with the .py files starting with plot_.

The files mh.py and classification.py are designed to have general routines. The other files are scripts specific to this project.

Plots

For plotting one must install matplotlib into the virtual environment. From the root of the repo run:

pip install -r requirements_plots.txt

The following functions generate plots based on the csv files dumped by demo_mhgan.py:

plot_calibration.py
plot_incep_by_epoch.py
plot_score_distn.py

These are called in the following way by providing the relevant directories:

cd mhgan
python plot_score_distn.py --input [RESULTS SUBDIR] --output [FIGURES]

License

This project is licensed under the Apache 2 License - see the LICENSE and NOTICE files for details.

More Repositories

1

deep-neuroevolution

Deep Neuroevolution
Python
1,630
star
2

PPLM

Plug and Play Language Model implementation. Allows to steer topic and attributes of GPT-2 models.
Python
1,125
star
3

UPSNet

UPSNet: A Unified Panoptic Segmentation Network
Python
639
star
4

go-explore

Code for Go-Explore: a New Approach for Hard-Exploration Problems
Python
553
star
5

PyTorch-NEAT

Python
526
star
6

LaneGCN

[ECCV2020 Oral] Learning Lane Graph Representations for Motion Forecasting
Python
502
star
7

sbnet

Sparse Blocks Networks
Python
430
star
8

differentiable-plasticity

Implementations of the algorithms described in Differentiable plasticity: training plastic networks with gradient descent, a research paper from Uber AI Labs.
Python
394
star
9

DeepPruner

DeepPruner: Learning Efficient Stereo Matching via Differentiable PatchMatch (ICCV 2019)
Python
351
star
10

parallax

Tool for interactive embeddings visualization
Python
284
star
11

learning-to-reweight-examples

Code for paper "Learning to Reweight Examples for Robust Deep Learning"
Python
269
star
12

jpeg2dct

C++
251
star
13

poet

Paired Open-Ended Trailblazer (POET) and Enhanced POET
Python
235
star
14

intrinsic-dimension

Jupyter Notebook
220
star
15

CoordConv

Python
208
star
16

atari-model-zoo

A binary release of trained deep reinforcement learning models trained in the Atari machine learning benchmark, and a software release that enables easy visualization and analysis of models, and comparison across training algorithms.
Jupyter Notebook
201
star
17

ape-x

This repo replicates the results Horgan et al obtained in "Distributed Prioritized Experience Replay"
Python
188
star
18

EvoGrad

Python
178
star
19

TuRBO

Python
178
star
20

safemutations

safemutations
C++
143
star
21

permute-quantize-finetune

Using ideas from product quantization for state-of-the-art neural network compression.
Python
143
star
22

deconstructing-lottery-tickets

Python
142
star
23

CRISP

Python
131
star
24

GTN

Python
75
star
25

backpropamine

Train self-modifying neural networks with neuromodulated plasticity
Python
73
star
26

loss-change-allocation

Python
61
star
27

MARVIN

Uber's Multi-Agent Routing Value Iteration Network
Python
57
star
28

GOCC

Go
51
star
29

Synthetic-Petri-Dish

Python
42
star
30

RxThreadEffectChecker

Static checker for Rx Threading Effects, based on the Checker Framework
Java
35
star
31

Map-Elites-Evolutionary

Map-Elites based on Evolution Strategies
Python
31
star
32

D3G

Estimating Q(s,s') with Deep Deterministic Dynamics Gradients
Python
29
star
33

java-dependency-validator

Dependency validator detects runtime compatibility issues at build time
Java
23
star
34

vargp

Variational Auto-Regressive Gaussian Processes for Continual Learning
Python
20
star
35

normative-uncertainty

Python
15
star
36

Evolvability-ES

Python
14
star
37

brezel

Starlark
8
star
38

dispatch-optim

Constrainted based optimization
Python
8
star
39

ga-world-models

Python
7
star
40

FSDM

Code tor the SIGDIAL 2019 paper Flexibly-Structured Model for Task-Oriented Dialogues. It implements a deep learning end-to-end differentiable dialogue system model
Python
7
star
41

rl-controller-verification

Quadcopter Verification
Python
6
star
42

go-context-propagate

Go
4
star
43

last-diff-analyzer

A multi-language tool for checking semantic equivalence for code
Go
2
star
44

presto-HDFS-read-data

A dump of some of our Presto logs, for use as part of ongoing Presto/HDFS research and presentations.
2
star
45

xplane-bazel-docker

Bazel Xplane
C++
1
star
46

tailr

TAILR
Python
1
star