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

Programs with stochastic support #37

Closed
rlouf opened this issue Sep 29, 2020 · 1 comment
Closed

Programs with stochastic support #37

rlouf opened this issue Sep 29, 2020 · 1 comment
Labels
discussion priority-2 Not bug, but medium priority issue
Milestone

Comments

@rlouf
Copy link
Owner

rlouf commented Sep 29, 2020

Programs with stochastic support (with control flow in them) are notoriously difficult to implement and to sample [1].

JAX cannot JIT-compile a function with python control flow (although it can apply grad to it), and instead requires a special construct, jax.lax.cond or jax.lax.switch. This notation is cumbersome as:

  1. It is verbose
  2. It requires modelers and those who read their models to know JAX syntax.

Since MCX parses model expressions into a graphical model it does seem feasible to extract control flow, translate it into a graph structure which is then compiled into a JAX-compatible function.

We need to discuss:

  • How do we represent control flow in a graphical model?
  • How do we compile a graph with control flow into a function that can be JIT-compiled?
  • (Later) How do we go about sampling these models?

Does not need to implement for v0.1 but API design should be clear before releasing as it will impact the way the graph is structured. Use this issue for discussions.

References

[1]: "Divide, Conquer, and Combine: a New Inference Strategy for Probabilistic Programs with Stochastic Support" https://arxiv.org/abs/1910.13324

@rlouf rlouf added this to the 0.1 milestone Sep 30, 2020
@rlouf rlouf added the priority-2 Not bug, but medium priority issue label Oct 20, 2020
@rlouf
Copy link
Owner Author

rlouf commented Mar 8, 2021

Moving to #97

@rlouf rlouf closed this as completed Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion priority-2 Not bug, but medium priority issue
Projects
None yet
Development

No branches or pull requests

1 participant