Skip to content

[AISTATS2020] The official repository of "Invertible Generative Modling using Linear Rational Splines (LRS)".

License

Notifications You must be signed in to change notification settings

hmdolatabadi/LRS_NF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invertible Generative Modeling using Linear Rational Splines

Hadi M. Dolatabadi, Sarah Erfani, and Christopher Leckie 2020

arXiv License: MIT

This repository includes the Python code of AISTATS 2020 paper Invertible Generative Modeling using Linear Rational Splines. The code is mostly taken from Neural Spline Flows repository, initially downloaded on mid August 2019.

Running the code

To run experiments of the paper, take the following steps:

  1. Install the dependencies using "./environment.yml" by running:
conda env create -f environment.yml
  1. Set the path variables in "./experiments/cutils/io.py" accordingly.

  2. Download the raw tabular data (Power, Gas, HEPMASS, and MiniBooNE + BSDS300) from https://zenodo.org/record/1161203#.Wmtf_XVl8eN provided by Papamakarios et al. for Masked Autoregressive Flows. Extract the data into the root "./data/".

  3. Set the "DATAROOT" environment variable to the dataroot folder, namely "./data/".

  4. Run "bsds300.py", "gas.py", "hepmass.py", "miniboone.py" and "power.py" one after another to extract and split the data accordingly.

  5. Now, you can run each experiment of the paper by running its associated experiment:

Plane

python ./experiments/plane.py --dataset_name=rings --base_transform_type=rl-coupling

Face

python ./experiments/face.py --dataset_name=einstein --base_transform_type=rl

Tabular Data

python ./experiments/uci.py --dataset_name=bsds300 --base_transform_type=rl-coupling --tail_bound=3 --num_bins=8

Image Generation

First set the config on the associated .json file in "./experiments/image_configs/". Then run:

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

To compute the BPD on the test data, run:

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

VAE

python experiments/vae.py --prior_type=rl-coupling --approximate_posterior_type=rl-coupling

Citation

@inproceedings{dolatabadi2020lrs,
  title={Invertible Generative Modeling using Linear Rational Splines},
  author={Hadi Mohaghegh Dolatabadi and Sarah Erfani and Christopher Leckie},
  booktitle={The 23rd International Conference on Artificial Intelligence and Statistics (AISTATS)},
  pages={4236--4246},
  year={2020}
}

About

[AISTATS2020] The official repository of "Invertible Generative Modling using Linear Rational Splines (LRS)".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages