@@ -126,21 +126,21 @@ function AbstractMCMC.sample_init!(
126
126
if init_theta != = nothing
127
127
# Doesn't support dynamic models
128
128
link! (spl. state. vi, spl)
129
- model (spl. state. vi, spl)
129
+ model (rng, spl. state. vi, spl)
130
130
theta = spl. state. vi[spl]
131
131
update_hamiltonian! (spl, model, length (theta))
132
132
# Refresh the internal cache phase point z's hamiltonian energy.
133
133
spl. state. z = AHMC. phasepoint (rng, theta, spl. state. h)
134
134
else
135
135
# Samples new values and sets trans to true, then computes the logp
136
- model (empty! (spl. state. vi), SampleFromUniform ())
136
+ model (rng, empty! (spl. state. vi), SampleFromUniform ())
137
137
link! (spl. state. vi, spl)
138
138
theta = spl. state. vi[spl]
139
139
update_hamiltonian! (spl, model, length (theta))
140
140
# Refresh the internal cache phase point z's hamiltonian energy.
141
141
spl. state. z = AHMC. phasepoint (rng, theta, spl. state. h)
142
142
while ! isfinite (spl. state. z. ℓπ. value) || ! isfinite (spl. state. z. ℓπ. gradient)
143
- model (empty! (spl. state. vi), SampleFromUniform ())
143
+ model (rng, empty! (spl. state. vi), SampleFromUniform ())
144
144
link! (spl. state. vi, spl)
145
145
theta = spl. state. vi[spl]
146
146
update_hamiltonian! (spl, model, length (theta))
@@ -171,10 +171,10 @@ function AbstractMCMC.sample_init!(
171
171
# non-Gibbs sampling.
172
172
if ! islinked (spl. state. vi, spl) && spl. selector. tag == :default
173
173
link! (spl. state. vi, spl)
174
- model (spl. state. vi, spl)
174
+ model (rng, spl. state. vi, spl)
175
175
elseif islinked (spl. state. vi, spl) && spl. selector. tag != :default
176
176
invlink! (spl. state. vi, spl)
177
- model (spl. state. vi, spl)
177
+ model (rng, spl. state. vi, spl)
178
178
end
179
179
end
180
180
@@ -417,7 +417,7 @@ function AbstractMCMC.step!(
417
417
# Transform the space
418
418
@debug " X-> R..."
419
419
link! (spl. state. vi, spl)
420
- model (spl. state. vi, spl)
420
+ model (rng, spl. state. vi, spl)
421
421
end
422
422
# Get position and log density before transition
423
423
θ_old, log_density_old = spl. state. vi[spl], getlogp (spl. state. vi)
0 commit comments