/naf_examples

examples of Neural Autoregressive Flows

Primary LanguagePython

naf_examples

Examples of the ICML paper: Neural Autoregressive Flows

To reproduce the experiments done in the paper, please refer to this repo.

  • To use this repo, please also clone this one to the parent directory.

  • The snippet in example.py can be summarized in three steps after choosing a data distribution the learn:

    1. initialize the model
    2. fitting the distribution
    3. visualize the learned model

For example:

denaf = naf.DensityEstimator(flowtype=1)
denaf.fit(distr, 2000)
fig = naf.visualize2D(distr, denaf, res=res, rng=rng)

For the swissroll distribution one would learn the following density model (right) using Deep Sigmoidal Flow, a neural transformer. The true data distribution is visualized on the left as a comparison.

alt text

Below is the result using affine transformer (aka the IAF by Kingma et al. 2016)

alt text