Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 1.79 KB

README.md

File metadata and controls

64 lines (48 loc) · 1.79 KB

Nested Dropout Flows

Code and experiments for the paper:

Artur Bekasov, Iain Murray, Ordering Dimensions with Nested Dropout Normalizing Flows. [arXiv]

Presented at the Workshop on Invertible Neural Networks, Normalizing Flows, and Explicit Likelihood Models [INNF+], ICML 2020.

Dependencies

nflows package provides flow implementations.

See requirements.txt for other dependencies. To install all at once:

pip install -r requirements.txt

Usage

Synthetic experiments

synthetic directory contains code for experiments with the synthetic 3D dataset.

To train a model:

python synthetic/train.py -o run_dir

To evaluate a trained model:

python synthetic/eval.py -i run_dir

Image experiments

images directory contains code for experiments with Fashion-MNIST images.

To train a model:

python images/train.py\
  --data_dir ...\     # Where to store downloaded data
  --run_dir run_dir\  # Where to store checkpoints
  --reconstr_coef ... # Hyperparameters

To evaluate a trained model:

python images/eval.py\
  --data_dir ...\     # Where to store downloaded data
  --run_dir run_dir\  # run_dir used for train.py 
  --output_dir ...    # Where to store the artifacts 

images/eval.py outputs:

  • bpd.npy: negative log likelihood in bits-per-dimension.
  • mse.npy: reconstruction MSE, varying the number of dimensions dropped.

To sample from a trained model:

python images/sample.py\
  --data_dir ...\     # Where to store downloaded data
  --run_dir run_dir\  # run_dir used for train.py 
  --output_dir ...    # Where to store the artifacts