pints-team / pints

Probabilistic Inference on Noisy Time Series
http://pints.readthedocs.io
Other
225 stars 33 forks source link

Refactor HMC-related algorithms #963

Open ben18785 opened 5 years ago

ben18785 commented 5 years ago

Quite a few algorithms seem to be HMC 2.0 - all they are is HMC but with a different kinetic energy, essentially. They all use leapfrog to integrate.

To make the code more manageable, I'd suggest doing the following restructuring:

MichaelClerx commented 5 years ago

Sure!

MichaelClerx commented 5 years ago

With one caveat: The original code is already a bit tricky, if it gets worse we might want to abandon this and have some clarity at the cost of a little duplication!

ben18785 commented 5 years ago

@MichaelClerx I think the refactored code will be simpler and make it much quicker to extend. I'll give it a go, I reckon! First, would you be able to review #960 so that we can merge Relativistic Monte Carlo before I refactor?

MichaelClerx commented 5 years ago

Good stuff!

For the review of #960 I'm comparing relativistic to hamiltonian MCMC using Meld, one of many available diff tools. Doing this might actually be quite useful for your proposed refactoring!

ben18785 commented 5 years ago

@MichaelClerx Good idea! Will do.