-
Notifications
You must be signed in to change notification settings - Fork 43
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
Pair values with metadata? #101
Comments
This is actually a big part of what we did over in Turing recently, but hasn't made it over to AdvancedHMC. The plan is to basically return a struct for each step that contains the values and any additional metadata that is a subtype of |
Definitely agree that an iterator approach is preferred! We have something like It's a bit hard to use ATM because the |
The plan to solve this issue is by wrapping over AbstractMCMC, |
We now support the AbstractMCMC interface. #259 |
For Soss.jl I'm moving toward all MCMC results being in the form of iterators. Currently,
sample
returns a pair(samples, stats)
, which is a bit awkward to work with.It seems like this is a general problem: we have a value we're interested in (here a single sample) that has some metadata associated with it. We don't always want to throw away the metadata, but we don't want it to get in the way.
This seems like the exact problem addressed by
MacroTools.jl
's@forward
macro.For example, there could be a (maybe general-purpose)
Meta
struct withwith methods for common functions
@forward
ed to the.value
field. A new method forsample
could then return an iterator ofMeta
s. This could be really convenient - the metadata is there is you need it, but stays out of the way for computations.What do you think?
The text was updated successfully, but these errors were encountered: