Modelers use automatic differentiation (AD) of computation graphs to implement complex Deep Learning models without defining gradient computations. Stochastic AD extends AD to stochastic computation graphs with sampling steps, which arise when modelers handle the intractable expectations common in Reinforcement Learning and Variational Inference. However, current methods for stochastic AD are limited: They are either only applicable to continuous random variables and differentiable functions, or can only use simple but high variance score-function estimators. To overcome these limitations, we introduce Storchastic, a new framework for AD of stochastic computation graphs. Storchastic allows the modeler to choose from a wide variety of gradient estimation methods at each sampling step, to optimally reduce the variance of the gradient estimates. Furthermore, Storchastic is provably unbiased for estimation of any-order gradients, and generalizes variance reduction techniques to higher-order gradient estimates. Finally, we implement Storchastic as a PyTorch library at https://github.com/HEmile/storchastic.
A Review of automatic differentiation and its efficient implementation
导数在计算统计学中起着至关重要的作用,例如使用Hamilton Monte Carlo采样的贝叶斯推断和神经网络的训练。自动微分是自动计算导数的强大工具,比传统方法更可取,特别是在对复杂算法和数学函数进行微分时。然而,自动微分的实现需要一定的注意以确保效率。现代差异化软件包部署了广泛的计算技术,以提高适用性、运行时间和存储管理。这些技术包括操作重载、基于区域的内存和表达式模板。也有一些数学技术,可以产生高性能增益时,应用于复杂的算法。例如,半解析导数可以将数值求解和微分代数方程所需的运行时间减少几个数量级。开放的问题包括扩展目前的软件包,以提供更专业的例程,和有效的方法来执行高阶微分。