Closed sunxd3 closed 1 month ago
Ref https://github.com/TuringLang/DynamicPPL.jl/pull/604
I couldn't find a way to replicate the behavior of prob macro. Particularly, given
prob
@model function gdemo0() s ~ InverseGamma(2, 3) m ~ Normal(0, sqrt(s)) return x ~ Normal(m, sqrt(s)) end model1 = gdemo0(1.0)
For
model2 = model1 | (x = 2.0,)
loglikelihood(model2, (...)) will still use x=1.0 to compute the loglikelihood.
loglikelihood(model2, (...))
x=1.0
So I did some simplification, let me know the thoughts.
Ref https://github.com/TuringLang/DynamicPPL.jl/pull/604
I couldn't find a way to replicate the behavior of
prob
macro. Particularly, givenFor
loglikelihood(model2, (...))
will still usex=1.0
to compute the loglikelihood.So I did some simplification, let me know the thoughts.