@@ -36,13 +36,12 @@ function tilde(ctx::MiniBatchContext, sampler, right, left::VarName, inds, vi)
36
36
end
37
37
38
38
"""
39
- tilde_assume(ctx, sampler, right, vn, inds, vi) -> sampled value
39
+ tilde_assume(ctx, sampler, right, vn, inds, vi)
40
40
41
- This method is applied in the generated code for assumed variables, e.g., `x ~ Normal()` where
42
- `x` does not occur in the model inputs .
41
+ Handles assumed variables, e.g., `x ~ Normal()` ( where `x` does occur in the model inputs),
42
+ accumulates the log probability, and returns the sampled value .
43
43
44
- Falls back to `tilde(ctx, sampler, right, vn, inds, vi)`, but automatically accumulates the
45
- log-probability and returns only the sampled value.
44
+ Falls back to `tilde(ctx, sampler, right, vn, inds, vi)`.
46
45
"""
47
46
function tilde_assume (ctx, sampler, right, vn, inds, vi)
48
47
value, logp = tilde (ctx, sampler, right, vn, inds, vi)
@@ -73,14 +72,13 @@ function tilde(ctx::MiniBatchContext, sampler, right, left, vi)
73
72
end
74
73
75
74
"""
76
- tilde_observe(ctx, sampler, right, left, vname, vinds, vi) -> observed value
75
+ tilde_observe(ctx, sampler, right, left, vname, vinds, vi)
77
76
78
- This method is applied in the generated code for observed variables, e.g., `x ~ Normal()` where
79
- `x` does occur in the model inputs .
77
+ Handles observed variables, e.g., `x ~ Normal()` ( where `x` does occur in the model inputs),
78
+ accumulates the log probability, and returns the observed value .
80
79
81
80
Falls back to `tilde(ctx, sampler, right, left, vi)` ignoring the information about variable name
82
- and indices; if needed, these can be accessed through this function, though. Automatically
83
- accumulates the log-probability and returns only the observed value.
81
+ and indices; if needed, these can be accessed through this function, though.
84
82
"""
85
83
function tilde_observe (ctx, sampler, right, left, vname, vinds, vi)
86
84
logp = tilde (ctx, sampler, right, left, vi)
@@ -89,11 +87,12 @@ function tilde_observe(ctx, sampler, right, left, vname, vinds, vi)
89
87
end
90
88
91
89
"""
92
- tilde_observe(ctx, sampler, right, left, vi) -> observed value
90
+ tilde_observe(ctx, sampler, right, left, vi)
93
91
94
- This method is applied in the generated code for observed constants, e.g., `1.0 ~ Normal()`.
95
- Falls back to `tilde(ctx, sampler, right, left, vi)`. Automatically accumulates the log-probability
96
- and returns only the observed value.
92
+ Handles observed constants, e.g., `1.0 ~ Normal()`, accumulates the log probability, and returns the
93
+ observed value.
94
+
95
+ Falls back to `tilde(ctx, sampler, right, left, vi)`.
97
96
"""
98
97
function tilde_observe (ctx, sampler, right, left, vi)
99
98
logp = tilde (ctx, sampler, right, left, vi)
@@ -198,13 +197,12 @@ function dot_tilde(
198
197
end
199
198
200
199
"""
201
- dot_tilde_assume(ctx, sampler, right, left, vn, inds, vi) -> sampled value
200
+ dot_tilde_assume(ctx, sampler, right, left, vn, inds, vi)
202
201
203
- This method is applied in the generated code for assumed vectorized variables, e.g., `x .~
204
- MvNormal()` where `x` does not occur in the model inputs .
202
+ Handles broadcasted assumed variables, e.g., `x .~ MvNormal()` (where `x` does not occur in the
203
+ model inputs), accumulates the log probability, and returns the sampled value .
205
204
206
- Falls back to `dot_tilde(ctx, sampler, right, left, vn, inds, vi)`, but automatically accumulates
207
- the log-probability and returns only the sampled value.
205
+ Falls back to `dot_tilde(ctx, sampler, right, left, vn, inds, vi)`.
208
206
"""
209
207
function dot_tilde_assume (ctx, sampler, right, left, vn, inds, vi)
210
208
value, logp = dot_tilde (ctx, sampler, right, left, vn, inds, vi)
@@ -377,14 +375,13 @@ function dot_tilde(ctx::MiniBatchContext, sampler, right, left, vi)
377
375
end
378
376
379
377
"""
380
- dot_tilde_observe(ctx, sampler, right, left, vname, vinds, vi) -> observed value
378
+ dot_tilde_observe(ctx, sampler, right, left, vname, vinds, vi)
381
379
382
- This method is applied in the generated code for vectorized observed variables , e.g., `x .~
383
- MvNormal()` where `x` does occur the model inputs .
380
+ Handles broadcasted observed values , e.g., `x .~ MvNormal()` (where `x` does occur the model inputs),
381
+ accumulates the log probability, and returns the observed value .
384
382
385
383
Falls back to `dot_tilde(ctx, sampler, right, left, vi)` ignoring the information about variable
386
- name and indices; if needed, these can be accessed through this function, though. Automatically
387
- accumulates the log-probability and returns only the observed value.
384
+ name and indices; if needed, these can be accessed through this function, though.
388
385
"""
389
386
function dot_tilde_observe (ctx, sampler, right, left, vn, inds, vi)
390
387
logp = dot_tilde (ctx, sampler, right, left, vi)
@@ -393,11 +390,12 @@ function dot_tilde_observe(ctx, sampler, right, left, vn, inds, vi)
393
390
end
394
391
395
392
"""
396
- dot_tilde_observe(ctx, sampler, right, left, vi) -> observed value
393
+ dot_tilde_observe(ctx, sampler, right, left, vi)
394
+
395
+ Handles broadcasted observed constants, e.g., `[1.0] .~ MvNormal()`, accumulates the log
396
+ probability, and returns the observed value.
397
397
398
- This method is applied in the generated code for vectorized observed constants, e.g., `[1.0] .~
399
- MvNormal()`. Falls back to `dot_tilde(ctx, sampler, right, left, vi)`. Automatically
400
- accumulates the log-probability and returns only the observed value.
398
+ Falls back to `dot_tilde(ctx, sampler, right, left, vi)`.
401
399
"""
402
400
function dot_tilde_observe (ctx, sampler, right, left, vi)
403
401
logp = dot_tilde (ctx, sampler, right, left, vi)
0 commit comments