Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
May 11, 2024

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented May 10, 2024

Ref TuringLang/DynamicPPL.jl#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.

@sunxd3 sunxd3 requested review from yebai, devmotion and torfjelde May 10, 2024 13:36
sunxd3 and others added 5 commits May 10, 2024 14:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@yebai yebai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sunxd3 -- it looks good.

Re the question above, if one wants to change the data inside a posterior model, he will have to call decondition and then condition again. This is arguably the correct behaviour because likelihood functions are not functions of data but functions of parameters.

Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM though one minor change:)

Co-authored-by: Tor Erlend Fjelde <tor.erlend95@gmail.com>
@sunxd3 sunxd3 merged commit 9f8ffac into master May 11, 2024
2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the sunxd/remove_prob_macro branch May 11, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants