Effect Handlers for Programmable Inference

Effect Handlers for Programmable Inference
复制标题

用于可编程推理的效果处理程序

DOI:
10.1145/3609026.3609729
复制
发表时间:
2023
期刊:
--
影响因子:
--
通讯作者:
Nguyen M
Nguyen M
中科院分区:
--
文献类型:
--
作者:
Nguyen M

文献摘要

参考文献

被引文献

相似文献

概率规划的推理算法是具有许多移动部分的复杂命令式程序。有效的推理通常需要针对特定的概率模型或问题定制算法,有时称为推理编程。大多数推理框架都是用语言实现的,这些语言缺乏对副作用的规范方法,这可能会导致算法结构模糊的单片实现,并且推理编程很难。类型化效果的函数式编程为可编程推理提供了一个更加结构化和模块化的基础,单子变换器是迄今为止探索的主要结构化机制。使用效果签名来指定算法的关键操作,效果处理程序模块化地解释这些操作的特定变体,我们开发了两个抽象的算法,或推理模式,代表两个重要的推理类:大都会黑斯廷斯和粒子滤波。我们展示了我们的方法如何揭示算法的高级结构,并使其易于定制和重组成新的变体。我们实现了两个推理模式作为一个Haskell库,并讨论了优点和缺点的代数effectsvis-à-vismonad transformers作为一种结构化机制,模块化的命令式算法设计。
Inference algorithms for probabilistic programming are complex imperative programs with many moving parts. Efficient inference often requires customising an algorithm to a particular probabilistic model or problem, sometimes calledinference programming. Most inference frameworks are implemented in languages that lack a disciplined approach to side effects, which can result in monolithic implementations where the structure of the algorithms is obscured and inference programming is hard. Functional programming with typed effects offers a more structured and modular foundation for programmable inference, with monad transformers being the primary structuring mechanism explored to date.This paper presents an alternative approach to inference programming based on algebraic effects. Using effect signatures to specify the key operations of the algorithms, and effect handlers to modularly interpret those operations for specific variants, we develop two abstract algorithms, orinference patterns, representing two important classes of inference: Metropolis-Hastings and particle filtering. We show how our approach reveals the algorithms’ high-level structure, and makes it easy to tailor and recombine their parts into new variants. We implement the two inference patterns as a Haskell library, and discuss the pros and cons of algebraic effectsvis-à-vismonad transformers as a structuring mechanism for modular imperative algorithm design.
通过取消嵌入进行嵌入
DOI: 10.1145/3607830
发表时间: 2023
影响因子: --
作者:
Matsuda K
通讯作者: Matsuda K
DOI: 10.1109/5992.814660
发表时间: 2000-01-01
影响因子: 2.1
作者:
Beichl, I;Sullivan, F
通讯作者: Sullivan, F
DOI: --
发表时间: 2008
期刊: --
影响因子: --
作者:
A. Doucet;A. M. Johansen
通讯作者: A. Doucet;A. M. Johansen
DOI: 10.1145/3547635
发表时间: 2022-03
影响因子: --
作者:
Minh Nguyen;Roly Perera;M. Wang;Nicolas Wu
通讯作者: Minh Nguyen;Roly Perera;M. Wang;Nicolas Wu
DOI: 10.48550/arxiv.2212.11088
发表时间: 2022-12
期刊: ArXiv
影响因子: --
作者:
Birthe van den Berg;Tom Schrijvers;James McKinna;Alexander Vandenbroucke
通讯作者: Birthe van den Berg;Tom Schrijvers;James McKinna;Alexander Vandenbroucke