When sampling for Bayesian inference, one popular approach is to use Hamiltonian Monte Carlo (HMC) and specifically the No-U-Turn Sampler (NUTS) which automatically decides the end time of the Hamiltonian trajectory. However, HMC and NUTS can require numerous numerical gradients of the target density, and can prove slow in practice. We propose Hamiltonian neural networks (HNNs) with HMC and NUTS for solving Bayesian inference problems. Once trained, HNNs do not require numerical gradients of the target density during sampling. Moreover, they satisfy important properties such as perfect time reversibility and Hamiltonian conservation, making them well-suited for use within HMC and NUTS because stationarity can be shown. We also propose an HNN extension called latent HNNs (L-HNNs), which are capable of predicting latent variable outputs. Compared to HNNs, L-HNNs offer improved expressivity and reduced integration errors. Finally, we employ L-HNNs in NUTS with an online error monitoring scheme to prevent sample degeneracy in regions of low probability density. We demonstrate L-HNNs in NUTS with online error monitoring on several examples involving complex, heavy-tailed, and high-local-curvature probability densities. Overall, L-HNNs in NUTS with online error monitoring satisfactorily inferred these probability densities. Compared to traditional NUTS, L-HNNs in NUTS with online error monitoring required 1--2 orders of magnitude fewer numerical gradients of the target density and improved the effective sample size (ESS) per gradient by an order of magnitude.
翻译:当对巴耶斯的推断取样时,一种流行的做法是使用汉密尔顿蒙特-蒙特卡洛(HMC),特别是自动决定汉密尔顿轨道结束时间的无U-Turn取样器(NUTS),但是,HMC和NUTS可能要求许多目标密度的数值梯度,并在实践中可以证明速度缓慢。我们建议与HMC和NUTS建立汉密尔顿神经网络(HNNS),以解决巴伊斯推断问题。经过培训后,HNNNS不需要在取样过程中目标密度的数值梯度。此外,它们满足了诸如完美时间可变性和汉密尔顿目标保护等重要属性,使它们适合在HMC和NUTS内部使用,因为可以显示位置性。我们还提议了一个称为潜伏 HNNNNNU(L-H)的扩展号扩展号扩展,可以预测潜伏变量输出。与HNNU(L)相比,L-HNNS提供更清晰度和减少整合错误。最后,我们在NTS使用一个在线错误测序测测测测测测低的样本,以高的L-NNNU值。