Particle filters are not compatible with automatic differentiation due to the presence of discrete resampling steps. While known estimators for the score function, based on Fisher's identity, can be computed using particle filters, up to this point they required manual implementation. In this paper we show that such estimators can be computed using automatic differentiation, after introducing a simple correction to the particle weights. This correction utilizes the stop-gradient operator and does not modify the particle filter operation on the forward pass, while also being cheap and easy to compute. Surprisingly, with the same correction automatic differentiation also produces good estimators for gradients of expectations under the posterior. We can therefore regard our method as a general recipe for making particle filters differentiable. We additionally show that it produces desired estimators for second-order derivatives and how to extend it to further reduce variance at the expense of additional computation.
翻译:粒子过滤器与自动区分不相容, 原因是存在离散重试步骤。 虽然根据Fisher的特性, 分数函数已知的测算器可以使用粒子过滤器进行计算, 但直到此时为止, 它们需要人工执行。 在本文中, 我们显示, 这种测算器可以在对粒子重量进行简单校正后, 使用自动区分法进行计算 。 此校正使用静态操作器, 并且不修改远端的粒子过滤操作器操作, 同时也是廉价和容易的计算 。 奇怪的是, 同样的校正自动分法也为后方的预期梯度生成了良好的测算器。 因此, 我们可以将我们的方法视为使粒子过滤器不同的一般配方。 我们还要进一步表明, 它生成了二阶衍生物的预期测算器, 并且如何将其扩展以进一步减少差异, 以额外的计算为代价 。