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
8
8
function AbstractMCMC. step (
9
9
rng:: Random.AbstractRNG ,
10
10
model:: DynamicPPL.Model ,
11
- sampler:: DynamicPPL.Sampler{<:Prior} ,
12
- state= nothing ;
11
+ sampler:: DynamicPPL.Sampler{<:Prior} ;
13
12
kwargs... ,
14
13
)
15
14
vi = last (
@@ -19,7 +18,29 @@ function AbstractMCMC.step(
19
18
SamplingContext (rng, DynamicPPL. SampleFromPrior (), DynamicPPL. PriorContext ()),
20
19
),
21
20
)
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
23
44
end
24
45
25
46
DynamicPPL. default_chain_type (sampler:: Prior ) = MCMCChains. Chains
You can’t perform that action at this time.
0 commit comments