@@ -67,19 +67,6 @@ function AbstractMCMC.step(
67
67
return vi, nothing
68
68
end
69
69
70
- function default_varinfo (rng:: Random.AbstractRNG , model:: Model , sampler:: AbstractSampler )
71
- return default_varinfo (rng, model, sampler, DefaultContext ())
72
- end
73
- function default_varinfo (
74
- rng:: Random.AbstractRNG ,
75
- model:: Model ,
76
- sampler:: AbstractSampler ,
77
- context:: AbstractContext ,
78
- )
79
- init_sampler = initialsampler (sampler)
80
- return VarInfo (rng, model, init_sampler, context)
81
- end
82
-
83
70
function AbstractMCMC. sample (
84
71
rng:: Random.AbstractRNG ,
85
72
model:: Model ,
@@ -95,12 +82,15 @@ function AbstractMCMC.sample(
95
82
)
96
83
end
97
84
98
- # initial step: general interface for resuming and
85
+ # This function handles the initial step in the AbstractMCMC interface for all
86
+ # samplers (except SampleFromUniform and SampleFromPrior). The subsequent steps
87
+ # are implemented individually for each sampler as they depend on the sampler
88
+ # state.
99
89
function AbstractMCMC. step (
100
90
rng:: Random.AbstractRNG , model:: Model , spl:: Sampler ; initial_params= nothing , kwargs...
101
91
)
102
92
# Sample initial values.
103
- vi = default_varinfo (rng, model, spl)
93
+ vi = VarInfo (rng, model, initialsampler ( spl), DefaultContext () )
104
94
105
95
# Update the parameters if provided.
106
96
if initial_params != = nothing
0 commit comments