Skip to content

Commit

Permalink
Fix typos in test
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Dec 13, 2024
1 parent 31903c2 commit 2b64e65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/pointwise_logdensities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
loglikelihood_true = DynamicPPL.TestUtils.loglikelihood_true(
model, example_values...
)
logp_true = logprior(model, vi)
logprior_true = logprior(model, vi)

# Compute the pointwise loglikelihoods.
lls = pointwise_loglikelihoods(model, vi)
Expand All @@ -30,18 +30,18 @@
lps_prior = pointwise_prior_logdensities(model, vi)
@test :x DynamicPPL.getsym.(keys(lps_prior))
logp = sum(sum, values(lps_prior))
@test logp logp_true
@test logp logprior_true

# Compute both likelihood and logdensity of prior
# using the default DefaultContex
# using the default DefaultContext
lps = pointwise_logdensities(model, vi)
logp = sum(sum, values(lps))
@test logp (logp_true + loglikelihood_true)
@test logp (logprior_true + loglikelihood_true)

# Test that modifications of Setup are picked up
lps = pointwise_logdensities(model, vi, mod_ctx2)
logp = sum(sum, values(lps))
@test logp (logp_true + loglikelihood_true) * 1.2 * 1.4
@test logp (logprior_true + loglikelihood_true) * 1.2 * 1.4
end
end

Expand Down

0 comments on commit 2b64e65

Please sign in to comment.