TuringLang / docs

Documentation and tutorials for the Turing language
https://turinglang.org/docs/tutorials/docs-00-getting-started/
MIT License
225 stars 97 forks source link

Update prob query section of the doc following the removal of `prob` macro #440

Closed sunxd3 closed 1 month ago

sunxd3 commented 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

@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.

So I did some simplification, let me know the thoughts.