The performance of Hamiltonian Monte Carlo simulations crucially depends on both the integration timestep and the number of integration steps. We present an adaptive general-purpose framework to automatically tune such parameters, based on a local loss function which promotes the fast exploration of phase-space. We show that a good correspondence between loss and autocorrelation time can be established, allowing for gradient-based optimization using a fully-differentiable set-up. The loss is constructed in such a way that it also allows for gradient-driven learning of a distribution over the number of integration steps. Our approach is demonstrated for the one-dimensional harmonic oscillator and alanine dipeptide, a small protein common as a test case for simulation methods. Through the application to the harmonic oscillator, we highlight the importance of not using a fixed timestep to avoid a rugged loss surface with many local minima, otherwise trapping the optimization. In the case of alanine dipeptide, by tuning the only free parameter of our loss definition, we find a good correspondence between it and the autocorrelation times, resulting in a $>100$ fold speed up in optimization of simulation parameters compared to a grid-search. For this system, we also extend the integrator to allow for atom-dependent timesteps, providing a further reduction of $25\%$ in autocorrelation times.
翻译:哈密顿蒙特卡洛模拟的性能关键取决于积分时间步长与积分步数。我们提出一种自适应通用框架,基于促进相空间快速探索的局部损失函数自动调优此类参数。研究表明,损失函数与自相关时间之间可建立良好对应关系,从而通过全微分设置实现基于梯度的优化。该损失函数的设计方式使其能够通过梯度驱动学习积分步数的分布。我们以一维谐振子和丙氨酸二肽(一种常用于模拟方法测试的小蛋白质)验证该方法。通过谐振子应用案例,我们强调避免使用固定时间步长的重要性,否则将产生具有多局部极小值的粗糙损失曲面,导致优化陷入困境。在丙氨酸二肽案例中,通过调优损失定义的唯一自由参数,发现其与自相关时间高度吻合,使模拟参数优化速度相较于网格搜索提升逾百倍。针对该体系,我们进一步扩展积分器以支持原子依赖时间步长,使自相关时间额外降低25%。