tailhq / DynaML

Scala Library/REPL for Machine Learning Research
http://tailhq.github.io/DynaML/
Apache License 2.0
200 stars 51 forks source link

Support for HMC #59

Open mandar2812 opened 7 years ago

mandar2812 commented 7 years ago

Hamiltonian Monte Carlo methods

  1. Vanilla HMC
  2. Riemannian Manifold HMC
  3. Lagrangian HMC
amitkumarj441 commented 7 years ago

@mandar2812 Can you help me here?

The standard method is leapfrog (Störmer-Verlet) integration, I'm thinking of using a exponential integrator, which is robust to stiff ordinary differential equations with highly-oscillatory components. This oscillation is difficult to reproduce using leapfrog integration, even with carefully selected integration parameters and preconditioning. But we can use our Gaussian distribution approximation to segregate stiff components of the ordinary differential equation. We can also integrate this term analytically for stability and account for deviation from the approximation using variation of constants.

mandar2812 commented 7 years ago

@amitkumarj441 : Sounds interesting, do you have any reference links for this exponential integrator method? I would like to read up on it, as it would be relevant to my research activities.

mandar2812 commented 7 years ago

@amitkumarj441 : Since we have enough for v1.4.1 release, lets try to ship Hamiltonian Monte Carlo in the next release. So far vanilla MC has been implemented in 91fd052711585f03dcabc8294d8100fecda3b04d and 56864824473f2671bafb4995f1f8e13d87ae50a2

amitkumarj441 commented 7 years ago

@mandar2812 Will have to ask my friend? I will get you the stuffs soon.

Actually we communicated over phone and I asked her about Exponential Integration for Hamiltonian Monte Carlo and finally concluded that HMC is limited to the scale of the stiff components to avoid perturbing the energy of the system and consequently lowering MCMC acceptance rates. This results in limited motion in sample space, requiring many integration steps to explore the space. More generally, stiff ordinary differential equations occur in HMC whenever target distributions tightly peak around their modes, further motivating the need for advanced integrators. Although preconditioning can reduce stiffness and partially alleviate this problem.

amitkumarj441 commented 7 years ago

Thanks @mandar2812 for letting me know about these commits! :+1:

I'll try to punch HMC by this week for next release.

mandar2812 commented 7 years ago

@amitkumarj441 I see what you mean. Keep me posted on the work you do on HMC, lets collaborate more closely on this one. Keep in touch via gitter!

amitkumarj441 commented 7 years ago

Thanks @mandar2812 ! Yeah, sure! @gitter-badger is awesome :+1:

amitkumarj441 commented 7 years ago

@mandar2812 Please have a look at this paper: Inference using Riemannian Manifold Hamiltonian Monte Carlo.

mandar2812 commented 7 years ago

@amitkumarj441 Yes this is the paper which introduced RM-HMC, I created this issue after coming across it.