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