This repository contains code and text to reproduce our paper,
R. Giordano*, M. Ingram* & T. Broderick (2023). Black Box Variational Inference with a Deterministic Objective: Faster, More Accurate, and Even More Black Box.
*
= equal contribution first authors. arXiv:2304.05527
To compile, edit the header of the makefile
to point to this repositry as
well as the experiments repository (which is currently martiningram/dadvi-experiments).
Then run make all
.
Note that you should be able to compile the paper using the postprocessed experiments data included in this repo. To re-run the experiments, see martiningram/dadvi-experiments. Note that the experiments are time consuming and disk-intensive, and so are not included in the present repository.
The knitr setup may seem a little complicated at first, but I like how fast it is to recompile, and how modular it makes everything.
The short summary of how it is used for a particular experiment is:
-
The minimal amount of data needed to generate tables and figures is saved in an Rdata file stored in
experiments_data
. -
A line in
figures_knitr/load_data.R
to loads the experiment data into anR
environment. -
To refer in the text to any key quantities from the experiment, we add lines to
figures_knitr/define_macros.R
. -
We add standalone
.R
files tofigures_knitr
to generate individual figures and tables. -
We define macros in
figures_knitr.Rnw
that source your figure and table files. Don't editfigures_knitr.tex
, that file is overwritten! -
To compile
figures_knitr.Rnw
intofigures_knitr.tex
, runmake figutes_knitr.tex
. To force re-running knitr, runmake recompile_knitr
. If it fails, debug as in step (8). -
Use the macros in the main latex text to place figures, tables, and numbers where you want them. Note that you can move the figures around and recompile LaTeX with no additional knitting.
-
For debugging, it can be helpful to check the R output with
debugging.R
, then the tex output by looking at (but not editing)figures_knitr.tex
. If needed, you can also setknitr_debug <- TRUE
infigures_knitr.Rnw
to see verbose R output in LaTeX after knitting.