-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
There are two situations in which we call step / step_warmup, and then proceed to throw away the transition object and only use the state:
- initial discarded steps (burn-in)
- thinning
Lines 201 to 208 in 390012e
| # Discard initial samples. | |
| for j in 1:discard_initial | |
| # Obtain the next sample and state. | |
| sample, state = if j β€ num_warmup | |
| step_warmup(rng, model, sampler, state; num_warmup, kwargs...) | |
| else | |
| step(rng, model, sampler, state; kwargs...) | |
| end |
Lines 229 to 235 in 390012e
| for _ in 1:(thinning - 1) | |
| # Obtain the next sample and state. | |
| sample, state = if i β€ keep_from_warmup | |
| step_warmup(rng, model, sampler, state; num_warmup, kwargs...) | |
| else | |
| step(rng, model, sampler, state; kwargs...) | |
| end |
We should pass an extra keyword argument into step and step_warmup to let implementations know whether they need to return a meaningful transition or not. This could have substantial performance benefits e.g. for Turing, where calculating the transition object requires model re-evaluation.
mhauru
Metadata
Metadata
Assignees
Labels
No labels