Skip to content

Commit

Permalink
Fix submodel definitions in demo models
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Dec 13, 2024
1 parent fde8319 commit 9b05e78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test_utils/models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,14 @@ end
s .~ InverseGamma(2, 3)
m = TV(undef, 2)
m .~ Normal.(0, sqrt.(s))
return s, m
return (; s=s, m=m)
end

@model function demo_assume_submodel_observe_index_literal()
# Submodel prior
@submodel s, m = _prior_dot_assume()
vars ~ to_submodel(_prior_dot_assume())
s = vars.s
m = vars.m
1.5 ~ Normal(m[1], sqrt(s[1]))
2.0 ~ Normal(m[2], sqrt(s[2]))

Expand Down Expand Up @@ -449,7 +451,7 @@ end
m .~ Normal.(0, sqrt.(s))

# Submodel likelihood
@submodel _likelihood_mltivariate_observe(s, m, x)
_ignore ~ to_submodel(_likelihood_mltivariate_observe(s, m, x))

return (; s=s, m=m, x=x, logp=getlogp(__varinfo__))
end
Expand Down

0 comments on commit 9b05e78

Please sign in to comment.