TuringLang / AdvancedHMC.jl

Robust, modular and efficient implementation of advanced Hamiltonian Monte Carlo algorithms
https://turinglang.org/AdvancedHMC.jl/
MIT License
237 stars 41 forks source link

Unifying trajectories #245

Closed xukai92 closed 3 years ago

xukai92 commented 3 years ago

This PR unifies all trajectories under the same interface. For example, NUTS shall be constructed by:

τ = Trajectory{MultinomialTS}(Leapfrog(1e-3), GeneralisedNoUTurn())

Old constructors are supported but deprecated.

Besides, the way to unify FixedNSteps and FixedIntegrationTime is via a new-introduced nsteps(::Trajectory), suggested by @torfjelde.

xukai92 commented 3 years ago

CI passed now and it's ready for a final look @yebai

xukai92 commented 3 years ago

The only CI which "fails" due to running out of time. For some reaon the Geweke tests are pretty slow on Julia 1.0 (>4h) vs nightly (~1.5h). I check previous CI logs and this was true before (this PR) as well.

xukai92 commented 3 years ago

To be safe I just triggered a re-run of all CI. Let's see how it goes this time.

xukai92 commented 3 years ago

Is this good to go?