-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow LogDensityProblems.logdensity to take a named tuple #2038
Comments
I’m not aware of any existing options. @devmotion might know? |
TransformVariables is the proto-typical examples of how to transform vectors (in unconstrained spaces) to NamedTuples of parameters in the (possibly) constrained space. It's also used in the LogDensityProblems docs: https://docs.julialang.org/en/v1/manual/types/#man-custom-pretty-printing The interface of |
I agree that it is better to keep Turing.jl/src/inference/Inference.jl Lines 108 to 111 in ef27088
|
Dear Team!
Some samplers such as MH want to provide
LogDensityProblems.logdensity
with a named tuple of parameters.However,
LogDensityProblems.logdensity
only suports passing the parameters as a vector.At the moment this is bypassed in Turing by passing the named tuple to the VarInfo, using DynamicPPL to evaluate the logp at that VarInfo and then resetting the VarInfo to its old state (see code below, also here:)
Is there a better way of doing this?
All the best and thank you for your take,
Jaime
The text was updated successfully, but these errors were encountered: