-
Notifications
You must be signed in to change notification settings - Fork 246
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
Merge postprocess_fn into the fori_collect loop #1910
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -36,7 +36,10 @@ def test_mcmc_one_chain(deterministic, find_heuristic_step_size): | |||
|
||||
num_traces_for_heuristic = 2 if find_heuristic_step_size else 0 | ||||
if deterministic: | ||||
assert GLOBAL["count"] == 4 + num_traces_for_heuristic | ||||
# We have two extra calls to the model to get deterministic values: | ||||
# 1. transform the init state | ||||
# 2. transform state during the loop | ||||
assert GLOBAL["count"] == 5 + num_traces_for_heuristic | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add an assertion that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it is tested at numpyro/test/infer/test_mcmc.py Line 161 in 5c2eafa
|
||||
else: | ||||
assert GLOBAL["count"] == 3 + num_traces_for_heuristic | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify what is stored in
fields[1:]
iflen(collect_fields) >1
since we only need to runpostprocess_fn
on the first element?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first one is the sample field. The rest are extra fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, then it makes sense that constraints are only applied to the first field.