@@ -98,7 +98,7 @@ function dot_tilde_observe!!(context::PointwiseLogdensityContext, right, left, v
98
98
99
99
# We want to treat `.~` as a collection of independent observations,
100
100
# hence we need the `logp` for each of them. Broadcasting the univariate
101
- # `tilde_obseve ` does exactly this.
101
+ # `tilde_observe ` does exactly this.
102
102
logps = _pointwise_tilde_observe (context. context, right, left, vi)
103
103
104
104
# Need to unwrap the `vn`, i.e. get one `VarName` for each entry in `left`.
@@ -129,8 +129,8 @@ function _pointwise_tilde_observe(
129
129
end
130
130
end
131
131
132
- function tilde_assume (context:: PointwiseLogdensityContext , right, vn, vi)
133
- # @info "PointwiseLogdensityContext tilde_assume!! called for $vn"
132
+ function tilde_assume (context:: PointwiseLogdensityContext , right:: Distribution , vn, vi)
133
+ # @info "PointwiseLogdensityContext tilde_assume called for $vn"
134
134
value, logp, vi = tilde_assume (context. context, right, vn, vi)
135
135
push! (context, vn, logp)
136
136
return value, logp, vi
@@ -145,7 +145,7 @@ function dot_tilde_assume(context::PointwiseLogdensityContext, right, left, vns,
145
145
return value, logp, vi
146
146
end
147
147
148
- function record_dot_tilde_assume (context:: PointwiseLogdensityContext , right:: UnivariateDistribution , left, vns, vi, logp)
148
+ function record_dot_tilde_assume (context:: PointwiseLogdensityContext , right:: Distribution , left, vns, vi, logp)
149
149
# forward to tilde_assume for each variable
150
150
map (vns) do vn
151
151
value_i, logp_i, vi_i = tilde_assume (context, right, vn, vi)
@@ -155,27 +155,13 @@ end
155
155
156
156
function record_dot_tilde_assume (context:: PointwiseLogdensityContext , rights:: AbstractVector{<:Distribution} , left, vns, vi, logp)
157
157
# forward to tilde_assume for each variable and distribution
158
- logps = map (vns, rights) do vn, right
158
+ map (vns, rights) do vn, right
159
159
# use current context to record vn
160
160
value_i, logp_i, vi_i = tilde_assume (context, right, vn, vi)
161
161
logp_i
162
162
end
163
163
end
164
164
165
- function record_dot_tilde_assume (context:: PointwiseLogdensityContext , right:: MultivariateDistribution , left, vns, vi, logp)
166
- # @info "PointwiseLogdensityContext record_dot_tilde_assume multivariate called for $vns"
167
- # For multivariate distribution on the right there is only a single density.
168
- # Need to construct a combined VarName.
169
- # Assume that all vns have an IndexLens with a Colon at the first position
170
- # and a single number at the second position.
171
- indices = map (vn -> getoptic (vn). indices[2 ], vns)
172
- indices_combined = (:,indices)
173
- # indices = tuplejoin(map(vn -> getoptic(vn).indices[2], vns)...)
174
- vn = VarName (first (vns), Accessors. IndexLens (indices_combined))
175
- push! (context, vn, logp)
176
- return logp
177
- end
178
-
179
165
() -> begin
180
166
# code that generates julia-repl in docstring below
181
167
# using DynamicPPL, Turing
0 commit comments