unconstrained.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:hamiltonian-monte-carlo 作者: matt-graham 项目源码 文件源码
def simulate_dynamic(self, n_step, dt, pos, mom, cache={}):
        mom = mom - 0.5 * dt * self.energy_grad(pos, cache)
        pos = pos + dt * la.cho_solve((self.mass_matrix_chol, True), mom)
        for s in range(1, n_step):
            mom -= dt * self.energy_grad(pos, cache)
            pos += dt * la.cho_solve((self.mass_matrix_chol, True), mom)
        mom -= 0.5 * dt * self.energy_grad(pos, cache)
        return pos, mom, None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号