You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mcmc/external_sampler.jl
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,11 @@ When implementing a new `MySampler <: AbstractSampler`,
15
15
In particular, it must implement:
16
16
17
17
- `AbstractMCMC.step` (the main function for taking a step in MCMC sampling; this is documented in AbstractMCMC.jl)
18
-
- `AbstractMCMC.getparams(::DynamicPPL.Model, external_state)`: How to extract the parameters from the state returned by your sampler (i.e., the second return value of `step`).
18
+
- `Turing.Inference.getparams(::DynamicPPL.Model, external_transition)`: How to extract the parameters from the transition returned by your sampler (i.e., the first return value of `step`).
19
+
There is a default implementation for this method, which is to return `external_transition.θ`.
20
+
21
+
!!! note
22
+
In a future breaking release of Turing, this is likely to change to `AbstractMCMC.getparams(::DynamicPPL.Model, external_state)`, with no default method. `Turing.Inference.getparams` is technically an internal method, so the aim here is to unify the interface for samplers at a higher level.
19
23
20
24
There are a few more optional functions which you can implement to improve the integration with Turing.jl:
21
25
@@ -119,7 +123,10 @@ function make_updated_varinfo(
0 commit comments