Skip to content

Commit

Permalink
try to fix testset pointwise_logdensities chain
Browse files Browse the repository at this point in the history
  • Loading branch information
bgctw committed Sep 26, 2024
1 parent 8706f68 commit 073a325
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/pointwise_logdensities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ end
# Get some random `NamedTuple` samples from the prior.
vals = [DynamicPPL.TestUtils.rand_prior_true(model) for _ = 1:5]
# Concatenate the vector representations and create a `Chains` from it.
vals_arr = reduce(hcat, (mapreduce(DynamicPPL.tovec, vcat, values(nt) for nt in vals))
chain = Chains(permutedims(vals_arr), map(Symbol, vns))
vals_arr = reduce(hcat, mapreduce(DynamicPPL.tovec, vcat, values(nt)) for nt in vals)
chain = Chains(permutedims(vals_arr), map(Symbol, vns));
logjoints_pointwise = pointwise_logdensities(model, chain)
# Get the sum of the logjoints for each of the iterations.
logjoints = [
sum(logjoints_pointwise[vn][idx] for vn in vns)
sum(logjoints_pointwise[string(vn)][idx] for vn in vns)
for idx = 1:5
]
for (val, logp) in zip(vals, logjoints)
Expand Down

0 comments on commit 073a325

Please sign in to comment.