Open SamuelBrand1 opened 5 months ago
Unfortunately, AdvancedHMC.NUTS
doesn't have an adtype
option because its designed to interface directly with a LogDensityProblemAD.ADgradient
object... which means that we can't direct port across.
I've flagged this with Turing https://github.com/TuringLang/Turing.jl/issues/2248
The direction of travel here:
https://github.com/TuringLang/Turing.jl/issues/2248#issuecomment-2148237328
This can go forwards after #262 because the latest version of Turing
has a kwarg to externalsampler
to pass the adtype
choice.
Update: f2f chat with @dylanhmorris and @athowes (don't have his git handle) as part of STF meeting included discussion around when sometimes Pathfinder
doesn't improve NUTS pre-heating.
Some experimentation on the associated branch to this issue is having mixed results with including the metric in pre-heat; I'm de-prioritizing investigating this for now but would like to keep this issue open.
We are by default using
pathfinder.jl
to pre-heat our NUTS sampling by providing an (approximate) sample from the posterior distribution as the initial point for NUTS warm-up, as per here.The reason we didn't also include an estimate of the underlying kinetic energy matrix/inverse curvature metric was because of the API to
Turing
not being straightforward.As of https://turinglang.org/docs/tutorials/docs-16-using-turing-external-samplers/ this appears to be fixed/made easy to do, and so we should have metric pre-heating.