Variational inference with normalizing flows (NFs) is an increasingly popular alternative to MCMC methods. In particular, NFs based on coupling layers (Real NVPs) are frequently used due to their good empirical performance. In theory, increasing the depth of normalizing flows should lead to more accurate posterior approximations. However, in practice, training deep normalizing flows for approximating high-dimensional posterior distributions is often infeasible due to the high variance of the stochastic gradients. In this work, we show that previous methods for stabilizing the variance of stochastic gradient descent can be insufficient to achieve stable training of Real NVPs. As the source of the problem, we identify that, during training, samples often exhibit unusual high values. As a remedy, we propose a combination of two methods: (1) soft-thresholding of the scale in Real NVPs, and (2) a bijective soft log transformation of the samples. We evaluate these and other previously proposed modification on several challenging target distributions, including a high-dimensional horseshoe logistic regression model. Our experiments show that with our modifications, stable training of Real NVPs for posteriors with several thousand dimensions is possible, allowing for more accurate marginal likelihood estimation via importance sampling. Moreover, we evaluate several common training techniques and architecture choices and provide practical advise for training NFs for high-dimensional variational inference.
翻译:使用归一化流进行变分推断正日益成为MCMC方法的流行替代方案。其中,基于耦合层的归一化流因其良好的实证表现而被广泛使用。理论上,增加归一化流的深度应能获得更准确的后验近似。然而实践中,在训练深度归一化流以近似高维后验分布时,常因随机梯度方差过高而难以实现。本研究证明,以往用于稳定随机梯度下降方差的方法不足以实现Real NVP的稳定训练。我们识别出该问题的根源在于:训练过程中,样本常出现异常高值。为此,我们提出两种方法的组合:(1)对Real NVP中的尺度进行软阈值处理,以及(2)对样本进行双射软对数变换。我们在多个具有挑战性的目标分布(包括高维马蹄逻辑回归模型)上评估了这些方法及其他先前提出的改进方案。实验表明,通过我们的改进,可以稳定训练维度达数千的后验分布对应的Real NVP,从而通过重要性采样实现更准确的边际似然估计。此外,我们评估了多种常见训练技巧和架构选择,并为训练用于高维变分推断的归一化流提供了实用建议。