We implemented HMC [1]} using PyTorch [2]} for automatic differentiation. We implemented a custom warm-up or tuning phase, starting with 200 randomly chosen “seed” points drawn from a zero-mean isotropic normal distribution of whatever dimension the space was that was being sampled. These points were then advanced, by gradient ascent, up the log probability for 100 steps. The average negative curvature of the log probability across the resulting set of points was used to set the mass in each dimension, passing the curvature through a softplus function to handle cases where average curvature was convex.
