Code for Neural Spline Flows paper
A record of the code and experiments for the paper:
Work in this repository has now stopped. Please go to nflows for an updated and pip-installable normalizing flows framework for PyTorch.
environment.ymlfor required Conda/pip packages, or use this to create a Conda environment with all dependencies:
bash conda env create -f environment.yml
Tested with Python 3.5 and PyTorch 1.1.
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
torchvisionor custom data providers.
DATAROOTenvironment variable needs to be set before running experiments.
experiments/image_configscontains .json configurations used for RQ-NSF (C) experiments. For baseline experiments use
For example, to run RQ-NSF (C) on CIFAR-10 8-bit:
bash python experiments/images.py with experiments/image_configs/cifar-10-8bit.json
Corresponding affine baseline run:
bash python experiments/images.py with experiments/image_configs/cifar-10-8bit.json coupling_layer_type='affine'
To evaluate on the test set:
bash python experiments/images.py eval_on_test with experiments/image_configs/cifar-10-8bit.json flow_checkpoint=''
bash python experiments/images.py sample with experiments/image_configs/cifar-10-8bit.json flow_checkpoint=''