Probabilistic inference procedures are usually coded painstakingly from scratch, for each target model and each inference algorithm. We reduce this coding effort by generating inference procedures from models automatically. We make this code generation modular by decomposing inference algorithms into reusable program transformations. These source-to-source transformations perform exact inference as well as generate probabilistic programs that compute expectations, densities, and MCMC samples. The resulting inference procedures run in time comparable to that of handwritten procedures.
['Robert Zinkov', 'Chung-chieh Shan']
Composing inference algorithms as program transformations