TuringLang / TuringLang/AbstractMCMC.jl
`sample` equivalent but including states
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 108
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes I want both the samples and the states rather than just the states. Of course this can be achieved by just using the iterator interface explicitly, or a callback, but it's a bit inconvenient to have to write this every time.
Would it make sense to introduce a sample_with_states method or simply a keyword argument to sample, e.g. include_states::Bool, specifying whether or not to also include the states in the return-value (I'm more in favour of just calling save!! with tuple (sample, state) rather than changing than returning having the kwarg making it so that we instead return samples, states at the end).
Thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing sample iterator and callback interfaces, then inspect how save!! handles the (sample, state) tuple. Compare the proposed sample_with_states method with the include_states keyword option and define one consistent return behavior for collecting both samples and states.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100