PyTorch implementations of the networks for normalizing flows.
Currently, following networks are implemented.
- Planar flow
- Rezende and Mohamed 2015, "Variational Inference with Normalizing Flows," [arXiv]
- RealNVP
- Dinh et al., 2016, "Density Estimation using Real NVP," [arXiv]
- Glow
- Flow++
- MAF
- Papamakarios et al., 2017, “Masked Autoregressive Flow for Density Estimation,” [arXiv]
- Residual Flow
- FFJORD
Note: This repository is for easier understanding of the above networks. Therefore, you should use official source cods if provided.
By Anaconda, you can easily setup the environment using environment.yml
.
$ conda env create -f environment.yml
If you use pip
or other tools, see the dependencies in environment.yml
This repo uses hydra
to manage hyper parameters in training and evaluation. See configs
folder to check the parameters for each network.
$ python main.py \
network=[planar, realnvp, glow, flow++, maf, resflow, ffjord]\
run.distrib=[circles, moons, normals, swiss, s_curve, mnist, cifar10]
Note:
Currently, I tested the networks only for 2D density transformation. So, results for 3D densities (swiss
and s_curve
) and images (mnist
and cifar10
) could be what you expect.
See results/README.md
for more results.
Target | Reproduced | Training |
---|---|---|
MIT License (c) 2020, Tatsuya Yatagawa