-
Notifications
You must be signed in to change notification settings - Fork 36
Depreciate@submodel l ~ m
in favour of l ~ to_submodel(m)
; rename generated_quantities
to returned
#696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Depreciate@submodel l ~ m
in favour of l ~ to_submodel(m)
; rename generated_quantities
to returned
#696
Changes from 47 commits
5c746c4
0b081b7
dc699a5
7067695
8cb0796
2d887c9
692cfff
32fd6b9
5478fb3
5fe65b3
9e0730f
cc3af46
720053a
fe0403f
55b95a1
34fb6bd
9a7e18f
7aef65b
5ee727b
d92141c
64b519d
1b48f65
db2102c
da95aba
c8d567f
d477137
4896793
946fa6d
bf35de4
0f20624
99d99b3
0597b2a
0c6bada
5134ff7
45451f7
c00a9ae
f0af1d5
1b231a9
1faa627
92ac6b9
f73d1b0
b7b2e1d
ed4bb76
36f02f6
98538c5
d316306
0e05901
f073b25
2ec03c1
1f70dfc
f645259
23355ea
0e82a60
b9017c4
6e149a3
933e4ed
4fc7b76
b421687
c71242f
5c289c5
3c204d9
044f6c3
f716296
76aebc5
c150a87
b95e7d5
ecb4737
1e238ca
3525765
ed0cec3
13a2bf7
f94e07a
86d0e4c
d03eb4c
7c7ecc3
341b6b8
b467c75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,8 +141,12 @@ By default, calls `tilde_assume(context, right, vn, vi)` and accumulates the log | |
probability of `vi` with the returned value. | ||
""" | ||
function tilde_assume!!(context, right, vn, vi) | ||
value, logp, vi = tilde_assume(context, right, vn, vi) | ||
return value, acclogp_assume!!(context, vi, logp) | ||
return if is_rhs_model(right) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be generalized as we desire, e.g. if want to do something special with |
||
rand_like!!(right, context, vi) | ||
else | ||
value, logp, vi = tilde_assume(context, right, vn, vi) | ||
value, acclogp_assume!!(context, vi, logp) | ||
end | ||
end | ||
|
||
# observe | ||
|
@@ -197,6 +201,11 @@ Falls back to `tilde_observe!!(context, right, left, vi)` ignoring the informati | |
and indices; if needed, these can be accessed through this function, though. | ||
""" | ||
function tilde_observe!!(context, right, left, vname, vi) | ||
is_rhs_model(right) && throw( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once we want "more" things to be allowed on |
||
ArgumentError( | ||
"`~` with a model on the right-hand side of an observe statement is not supported", | ||
), | ||
) | ||
return tilde_observe!!(context, right, left, vi) | ||
end | ||
|
||
|
@@ -210,6 +219,11 @@ By default, calls `tilde_observe(context, right, left, vi)` and accumulates the | |
probability of `vi` with the returned value. | ||
""" | ||
function tilde_observe!!(context, right, left, vi) | ||
is_rhs_model(right) && throw( | ||
ArgumentError( | ||
"`~` with a model on the right-hand side of an observe statement is not supported", | ||
), | ||
) | ||
logp, vi = tilde_observe(context, right, left, vi) | ||
return left, acclogp_observe!!(context, vi, logp) | ||
end | ||
|
@@ -420,8 +434,12 @@ model inputs), accumulate the log probability, and return the sampled value and | |
Falls back to `dot_tilde_assume(context, right, left, vn, vi)`. | ||
""" | ||
function dot_tilde_assume!!(context, right, left, vn, vi) | ||
value, logp, vi = dot_tilde_assume(context, right, left, vn, vi) | ||
return value, acclogp_assume!!(context, vi, logp), vi | ||
return if is_rhs_model(right) | ||
rand_like!!(right, context, vi) | ||
else | ||
value, logp, vi = dot_tilde_assume(context, right, left, vn, vi) | ||
value, acclogp_assume!!(context, vi, logp) | ||
end | ||
end | ||
|
||
# `dot_assume` | ||
|
@@ -672,6 +690,11 @@ Falls back to `dot_tilde_observe!!(context, right, left, vi)` ignoring the infor | |
name and indices; if needed, these can be accessed through this function, though. | ||
""" | ||
function dot_tilde_observe!!(context, right, left, vn, vi) | ||
is_rhs_model(right) && throw( | ||
ArgumentError( | ||
"`~` with a model on the right-hand side of an observe statement is not supported", | ||
), | ||
) | ||
return dot_tilde_observe!!(context, right, left, vi) | ||
end | ||
|
||
|
@@ -684,6 +707,11 @@ probability, and return the observed value and updated `vi`. | |
Falls back to `dot_tilde_observe(context, right, left, vi)`. | ||
""" | ||
function dot_tilde_observe!!(context, right, left, vi) | ||
is_rhs_model(right) && throw( | ||
ArgumentError( | ||
"`~` with a model on the right-hand side of an observe statement is not supported", | ||
), | ||
) | ||
logp, vi = dot_tilde_observe(context, right, left, vi) | ||
return left, acclogp_observe!!(context, vi, logp) | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@deprecate generated_quantities(model, params) returned(model, params) |
Uh oh!
There was an error while loading. Please reload this page.