File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ struct Prior <: InferenceAlgorithm end
88function AbstractMCMC. step (
99 rng:: Random.AbstractRNG ,
1010 model:: DynamicPPL.Model ,
11- sampler:: DynamicPPL.Sampler{<:Prior} ,
12- state= nothing ;
11+ sampler:: DynamicPPL.Sampler{<:Prior} ;
1312 kwargs... ,
1413)
1514 vi = last (
@@ -19,7 +18,29 @@ function AbstractMCMC.step(
1918 SamplingContext (rng, DynamicPPL. SampleFromPrior (), DynamicPPL. PriorContext ()),
2019 ),
2120 )
22- return vi, nothing
21+ vi = DynamicPPL. typed_varinfo (vi)
22+ return vi, vi
23+ end
24+
25+ function AbstractMCMC. step (
26+ rng:: Random.AbstractRNG ,
27+ model:: DynamicPPL.Model ,
28+ sampler:: DynamicPPL.Sampler{<:Prior} ,
29+ vi:: AbstractVarInfo ;
30+ kwargs... ,
31+ )
32+ # TODO (DPPL0.38/penelopeysm): Use InitContext.
33+ for vn in keys (vi)
34+ DynamicPPL. set_flag! (vi, vn, " del" )
35+ end
36+ vi = last (
37+ DynamicPPL. evaluate!! (
38+ model,
39+ vi,
40+ SamplingContext (rng, DynamicPPL. SampleFromPrior (), DynamicPPL. PriorContext ()),
41+ ),
42+ )
43+ return vi, vi
2344end
2445
2546DynamicPPL. default_chain_type (sampler:: Prior ) = MCMCChains. Chains
You can’t perform that action at this time.
0 commit comments