Skip to content

Commit 144bee7

Browse files
committed
Use new cached_params function
1 parent f4049c1 commit 144bee7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ LinearAlgebra = "1.6"
6868
LogDensityProblems = "2"
6969
MCMCChains = "6, 7"
7070
MacroTools = "0.5.6"
71-
MarginalLogDensities = "0.4.1"
71+
MarginalLogDensities = "0.4.3"
7272
Mooncake = "0.4.147"
7373
OrderedCollections = "1"
7474
Printf = "1.10"

ext/DynamicPPLMarginalLogDensitiesExt.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,10 @@ function DynamicPPL.VarInfo(
195195
)
196196
# Extract the original VarInfo. Its contents will in general be junk.
197197
original_vi = mld.logdensity.logdensity.varinfo
198-
# `mld.u` will contain the modes for any marginalized parameters
199-
full_params = mld.u
200-
# We can then set the values for any non-marginalized parameters
198+
# Extract the stored parameters, which includes the modes for any marginalized
199+
# parameters
200+
full_params = MarginalLogDensities.cached_params(mld)
201+
# We can then (if needed) set the values for any non-marginalized parameters
201202
if unmarginalized_params !== nothing
202203
full_params[MarginalLogDensities.ijoint(mld)] = unmarginalized_params
203204
end

0 commit comments

Comments
 (0)