论文标题
具有离散随机性的程序自动差异化
Automatic Differentiation of Programs with Discrete Randomness
论文作者
论文摘要
自动差异化(AD)是一种构建新程序的技术,该程序计算原始程序的衍生产品,由于基于梯度的优化提供了改善的性能,因此在整个科学计算和深度学习过程中已变得无处不在。但是,AD系统仅限于对参数有持续依赖的程序的子集。具有由分布参数支配的离散随机行为的程序,例如用概率$ p $成为头部的硬币,对这些系统构成挑战,因为结果(头部VS尾巴)和参数($ p $)之间的连接基本上是离散的。在本文中,我们开发了一种新的基于重新聚体化的方法,该方法允许生成期望的程序的派生计划。我们展示了这种方法如何给出公正且低变差的估计器,该估计器与传统的AD机制一样自动化。我们展示了离散时间马尔可夫链的无偏向前模型AD,基于代理的模型,例如Conway的生命游戏以及粒子滤波器的无偏反向模式AD。我们的代码软件包可在https://github.com/gaurav-arya/stochasticad.jl上找到。
Automatic differentiation (AD), a technique for constructing new programs which compute the derivative of an original program, has become ubiquitous throughout scientific computing and deep learning due to the improved performance afforded by gradient-based optimization. However, AD systems have been restricted to the subset of programs that have a continuous dependence on parameters. Programs that have discrete stochastic behaviors governed by distribution parameters, such as flipping a coin with probability $p$ of being heads, pose a challenge to these systems because the connection between the result (heads vs tails) and the parameters ($p$) is fundamentally discrete. In this paper we develop a new reparameterization-based methodology that allows for generating programs whose expectation is the derivative of the expectation of the original program. We showcase how this method gives an unbiased and low-variance estimator which is as automated as traditional AD mechanisms. We demonstrate unbiased forward-mode AD of discrete-time Markov chains, agent-based models such as Conway's Game of Life, and unbiased reverse-mode AD of a particle filter. Our code package is available at https://github.com/gaurav-arya/StochasticAD.jl.