@@ -317,14 +317,9 @@ function propose!!(
317
317
),
318
318
)
319
319
trans, _ = AbstractMCMC. step (rng, densitymodel, mh_sampler, prev_trans)
320
-
321
- # TODO : Make this compatible with immutable `VarInfo`.
322
- # Update the values in the VarInfo.
323
- # TODO (DPPL0.37/penelopeysm): This is obviously incorrect. We need to
324
- # re-evaluate the model.
320
+ # trans.params isa NamedTuple
325
321
set_namedtuple! (vi, trans. params)
326
- vi = DynamicPPL. setloglikelihood!! (vi, trans. lp)
327
- return DynamicPPL. setlogprior!! (vi, 0.0 )
322
+ return vi
328
323
end
329
324
330
325
# Make a proposal if we DO have a covariance proposal matrix.
@@ -354,12 +349,8 @@ function propose!!(
354
349
),
355
350
)
356
351
trans, _ = AbstractMCMC. step (rng, densitymodel, mh_sampler, prev_trans)
357
-
358
- # TODO (DPPL0.37/penelopeysm): This is obviously incorrect. We need to
359
- # re-evaluate the model.
360
- vi = DynamicPPL. unflatten (vi, trans. params)
361
- vi = DynamicPPL. setloglikelihood!! (vi, trans. lp)
362
- return DynamicPPL. setlogprior!! (vi, 0.0 )
352
+ # trans.params isa AbstractVector
353
+ return DynamicPPL. unflatten (vi, trans. params)
363
354
end
364
355
365
356
function DynamicPPL. initialstep (
@@ -382,9 +373,9 @@ function AbstractMCMC.step(
382
373
# Cases:
383
374
# 1. A covariance proposal matrix
384
375
# 2. A bunch of NamedTuples that specify the proposal space
385
- vi = propose!! (rng, vi, model, spl, spl. alg. proposals)
376
+ new_vi = propose!! (rng, vi, model, spl, spl. alg. proposals)
386
377
387
- return Transition (model, vi, vi [:], nothing ), vi
378
+ return Transition (model, new_vi, new_vi [:], nothing ), new_vi
388
379
end
389
380
390
381
# ###
0 commit comments