Functional programming for modular Bayesian inference

Author:

Ścibior Adam1,Kammar Ohad2,Ghahramani Zoubin3

Affiliation:

1. University of Cambridge, UK / MPI Tübingen, Germany

2. University of Oxford, UK

3. University of Cambridge, UK / Uber AI Labs, USA

Abstract

We present an architectural design of a library for Bayesian modelling and inference in modern functional programming languages. The novel aspect of our approach are modular implementations of existing state-of-the-art inference algorithms. Our design relies on three inherently functional features: higher-order functions, inductive data-types, and support for either type-classes or an expressive module system. We provide a performant Haskell implementation of this architecture, demonstrating that high-level and modular probabilistic programming can be added as a library in sufficiently expressive languages. We review the core abstractions in this architecture: inference representations, inference transformations, and inference representation transformers. We then implement concrete instances of these abstractions, counterparts to particle filters and Metropolis-Hastings samplers, which form the basic building blocks of our library. By composing these building blocks we obtain state-of-the-art inference algorithms: Resample-Move Sequential Monte Carlo, Particle Marginal Metropolis-Hastings, and Sequential Monte Carlo Squared. We evaluate our implementation against existing probabilistic programming systems and find it is already competitively performant, although we conjecture that existing functional programming optimisation techniques could reduce the overhead associated with the abstractions we use. We show that our modular design enables deterministic testing of inherently stochastic Monte Carlo algorithms. Finally, we demonstrate using OCaml that an expressive module system can also implement our design.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference40 articles.

1. Martín Abadi Ashish Agarwal Paul Barham Eugene Brevdo Zhifeng Chen Craig Citro Greg S. Corrado Andy Davis Jeffrey Dean Matthieu Devin Sanjay Ghemawat Ian Goodfellow Andrew Harp Geoffrey Irving Michael Isard Yangqing Jia Rafal Jozefowicz Lukasz Kaiser Manjunath Kudlur Josh Levenberg Dan Mané Rajat Monga Sherry Moore Derek Murray Chris Olah Mike Schuster Jonathon Shlens Benoit Steiner Ilya Sutskever Kunal Talwar Paul Tucker Vincent Vanhoucke Vijay Vasudevan Fernanda Viégas Oriol Vinyals Pete Warden Martin Wattenberg Martin Wicke Yuan Yu and Xiaoqiang Zheng. 2015. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. (2015). https://www.tensorflow.org/ Software available from tensorflow.org. Martín Abadi Ashish Agarwal Paul Barham Eugene Brevdo Zhifeng Chen Craig Citro Greg S. Corrado Andy Davis Jeffrey Dean Matthieu Devin Sanjay Ghemawat Ian Goodfellow Andrew Harp Geoffrey Irving Michael Isard Yangqing Jia Rafal Jozefowicz Lukasz Kaiser Manjunath Kudlur Josh Levenberg Dan Mané Rajat Monga Sherry Moore Derek Murray Chris Olah Mike Schuster Jonathon Shlens Benoit Steiner Ilya Sutskever Kunal Talwar Paul Tucker Vincent Vanhoucke Vijay Vasudevan Fernanda Viégas Oriol Vinyals Pete Warden Martin Wattenberg Martin Wicke Yuan Yu and Xiaoqiang Zheng. 2015. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. (2015). https://www.tensorflow.org/ Software available from tensorflow.org.

2. Nathanael L. Ackerman Cameron E. Freer and Daniel M. Roy. 2011. Noncomputable Conditional Distributions. In LiCS. http://ieeexplore.ieee.org/document/5970208/ 10.1109/LICS.2011.49 Nathanael L. Ackerman Cameron E. Freer and Daniel M. Roy. 2011. Noncomputable Conditional Distributions. In LiCS. http://ieeexplore.ieee.org/document/5970208/ 10.1109/LICS.2011.49

3. Particle Markov chain Monte Carlo methods

4. David Barber. 2012. Bayesian Reasoning and Machine Learning. Cambridge University Press. David Barber. 2012. Bayesian Reasoning and Machine Learning. Cambridge University Press.

5. Christopher Bishop. 2006. Pattern Recognition and Machine Learning. Springer-Verlag New York. http://www.springer.com/ gb/book/9780387310732 Christopher Bishop. 2006. Pattern Recognition and Machine Learning. Springer-Verlag New York. http://www.springer.com/ gb/book/9780387310732

Cited by 11 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Probabilistic Programming with Programmable Variational Inference;Proceedings of the ACM on Programming Languages;2024-06-20

2. Suspension Analysis and Selective Continuation-Passing Style for Universal Probabilistic Programming Languages;Lecture Notes in Computer Science;2024

3. Effect Handlers for Programmable Inference;Proceedings of the 16th ACM SIGPLAN International Haskell Symposium;2023-08-30

4. Reflecting on Random Generation;Proceedings of the ACM on Programming Languages;2023-08-30

5. Verified Density Compilation for a Probabilistic Programming Language;Proceedings of the ACM on Programming Languages;2023-06-06

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3