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

Poutine stack behavior #54

Closed
eb8680 opened this issue Jul 17, 2017 · 3 comments
Closed

Poutine stack behavior #54

eb8680 opened this issue Jul 17, 2017 · 3 comments
Assignees

Comments

@eb8680
Copy link
Member

eb8680 commented Jul 17, 2017

Right now the entire poutine stack is applied at every Pyro primitive site, at least until a block is reached. Although the transparent flag takes care of many use cases we care about, it might be better if each poutine in the stack has to call the next one itself, so that otherwise they are never called at all. In the case where there are two or more non-transparent poutines in the stack, it seems wasteful to draw a sample from one and then immediately discard it at another (and potentially incorrect, if e.g. the stochastic function at the site produces exchangeable not but i.i.d. samples).

To this end, @ngoodman suggested the following changes:

we make available next_pyro_sample(), etc, functions that call the next lower poutine method. if it doesn't get called then lower poutine layers simply don't run; the return value is the prev_val (which no longer needs to be an explicit arg to sample, etc).

instead of having a transparent flag, the default behavior of the base poutine class would be to be transparent. we would provide a poutine.forward that provides the standard non-transparent methods.

The purpose of this issue is to discuss the details of potential changes to the poutine stack. See also #51 .

@eb8680
Copy link
Member Author

eb8680 commented Jul 25, 2017

For posterity/discussion: our poutine abstraction is very related to algebraic effect handlers, and making this connection more directly may help us really nail the design - see this library code and paper

@null-a
Copy link
Collaborator

null-a commented Jul 25, 2017

our poutine abstraction is very related to algebraic effect handlers

Indeed! FWIW, the implementation in that paper is based on free monads, which is something I explored for a PPL over here. (Inspired in part by Practical Probabilistic Programming with Monads.) However, one significant difference is that what I have at present is closed, in the sense used in the paper you link, rather than open like pyro. Let me know if I can help out.

@eb8680
Copy link
Member Author

eb8680 commented Sep 6, 2017

Closed (for now) by #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants