Turing.jl icon indicating copy to clipboard operation
Turing.jl copied to clipboard

Add an option to the `sample` function to force using `SimpleVarInfo`.

Open yebai opened this issue 9 months ago • 0 comments

Turing, by default, uses VarInfo for sampling. There are a growing number of cases where we want to use SimpleVarInfo, e.g.

https://github.com/withbayes/Tapir.jl/issues/95#issuecomment-2088222249

At the moment, one has to hack into the internals to do this. Let's add an option to force using SimpleVarInfo tracing type by passing an additional argument to the sample function.

In addition, let's also allow users to pass adtype to the sample(; adtype=AutoForwardDiff), which would override Turing's default choice of adtype but still takes low precedence over inference algorithms' own autodiff choice via, e.g., NUTS(;adtype=AutoReverseDiff).

yebai avatar May 01 '24 17:05 yebai