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

Use correct event_dim in masked Pyro sample statements #43

Closed
eb8680 opened this issue Oct 20, 2022 · 2 comments
Closed

Use correct event_dim in masked Pyro sample statements #43

eb8680 opened this issue Oct 20, 2022 · 2 comments
Assignees
Labels
bug Something isn't working upstream

Comments

@eb8680
Copy link
Contributor

eb8680 commented Oct 20, 2022

In https://github.com/pyro-ppl/pyro/blob/dev/pyro/primitives.py#L102 the batch shape of the input distribution is ignored when returning a final interleaved deterministic value, which may cause issues with MultiWorldCounterfactual's use and abuse of plates. The following change should be sufficient to prevent any issues:

-    return deterministic(name, value)
+    return deterministic(name, value, event_dim=len(fn.event_shape))
@eb8680 eb8680 added bug Something isn't working upstream labels Oct 20, 2022
@eb8680 eb8680 added this to the Initial public release milestone Oct 20, 2022
@eb8680 eb8680 self-assigned this Oct 20, 2022
@eb8680 eb8680 modified the milestone: Initial public release Oct 21, 2022
@eb8680
Copy link
Contributor Author

eb8680 commented Oct 21, 2022

I believe this is unnecessary following the changes to MultiWorldCounterfactual in #48, which makes the workaround of pyro.poutine.blocking the deterministic site introduced when handling obs_mask the more correct behavior.

@eb8680
Copy link
Contributor Author

eb8680 commented Mar 13, 2023

Obsolete following #96 and #97 which remove use of obs_mask

@eb8680 eb8680 closed this as completed Mar 13, 2023
@eb8680 eb8680 added this to the Initial public release milestone Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

1 participant