Skip to content
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

Add a logdensity specialization that takes NamedTuples #671

Open
Red-Portal opened this issue Sep 24, 2024 · 4 comments
Open

Add a logdensity specialization that takes NamedTuples #671

Red-Portal opened this issue Sep 24, 2024 · 4 comments

Comments

@Red-Portal
Copy link
Member

Red-Portal commented Sep 24, 2024

As discussed on Slack, it would be good to have an additional specialization of logdensity that takes NamedTuple-valued inputs. The Turing main repo already implements this as boilerplate for AdvancedMH, so it would be nice to have an official unified implementation that also supports AD.

Right now, it seems to me that adding a specialization to unflatten would do the job. (And maybe change the function's name to something else since it is not doing unflatten anymore?)

@devmotion
Copy link
Member

A prior discussion (I don't remember the details): #501

@Red-Portal
Copy link
Member Author

Hi @yebai , could chime in on what we should do here?

@yebai
Copy link
Member

yebai commented Oct 1, 2024

There are other parts of AbstractMCMC that would benefit from a more general form of logdensity (ℓ, ...) which doesn't assume the second argument is a vector of reals, so it is worth considering how we can consistently handle this. We should probably take a look at something more recent for specifying interfaces and see whether we could have a LogDensityProblem 2.0:

https://github.com/rafaqz/Interfaces.jl

cc @willtebbutt and @sunxd3

@Red-Portal
Copy link
Member Author

@devmotion Any additional thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants