The above dynamics can thus be used as transition operators of a Markov chain and will leave invariant.
That chain by itself is not ergodic however, since simulating the dynamics maintains a fixed Hamiltonian .
HMC thus alternates hamiltonian dynamic steps, with Gibbs sampling of the velocity.
We assume the reader is already familiar with Theano and energy-based models such as the RBM. When training RBMs with CD or PCD, this is typically done with block Gibbs sampling, where the conditional distributions and are used as the transition operators of the Markov chain.
In certain cases however, these conditional distributions might be difficult to sample from (i.e.
requiring expensive matrix inversions, as in the case of the “mean-covariance RBM”).
Adapting the notation from [Neal93], particles are characterized by a position vector or state and velocity vector . The Hamiltonian is then defined as the sum of potential energy (same energy function defined by energy-based models) and kinetic energy , as follows: Instead of sampling directly, HMC operates by sampling from the canonical distribution .
Because the two variables are independent, marginalizing over is trivial and recovers the original distribution of interest.
Hamiltonian Dynamics State and velocity are modified such that remains constant throughout the simulation.
The differential equations are given by: As shown in [Neal93], the above transformation preserves volume and is reversible.
Also, even if Gibbs sampling can be done efficiently, it nevertheless operates via a random walk which might not be statistically efficient for some distributions.
In this context, and when sampling from continuous variables, Hybrid Monte Carlo (HMC) can prove to be a powerful tool [Duane87].
It avoids random walk behavior by simulating a physical system governed by Hamiltonian dynamics, potentially avoiding tricky conditional distributions in the process.
In HMC, model samples are obtained by simulating a physical system, where particles move about a high-dimensional landscape, subject to potential and kinetic energies.