Code that reproduces experiments in MixFlows: principled variational inference via mixed flows
We implement a practical version of the Ergodic variational flows---Hamiltonian ergodic flow---as a julia package ErgFlow.jl, which can be installed by executing the following code:
# in Julia REPL
using Pkg
Pkg.add("https://github.com/zuhengxu/ErgFlow.jl")
Examples run and generate output using Julia v1.8.1.
inference/
provides implementation of our competitors (NUTS/standard HMC/three normalizing flow methods), as well as utility functions for performing inference (KSD estimation/mean-field Gaussian VI method/etc.)examples/
provides code to replicate results and figures for each example
Each experiment should be run in its own folder (e.g., example/1d_cauchy
, example/banana/
, and etc.). Specifically,
- To generate Figure 1 (effect of irrational shift), execute the following code in bash:
cd example/uniform/
julia beta_mixture.jl
- To generate plots for all synthetic examples, check the
README.md
files in each of the1d_cauchy
,1d_gaussian
,1d_mixture
,banana
,cross
,neals_funnel
, andwarped_gaussian
folders. - To generate plots for all real data examples:
cd
into each of theheavy_reg
,linear_regression
,lin_reg_heavy
,logistic_reg
,poiss
,sparse_regression
, andsp_reg_big
folders, and then execute the following in bash:
./run.sh
Note that users should modify the number of execution threads in run.sh
based on their own computational resources (currently set to be 18).