How to begin learning probabilistic programming?

Unfortunately, I’ve not gotten very far yet. You can see some of my progress here: Is there an equivalent Pyro construct for WebPPL's Infer Operator?

To better understand Pyro, I then tried to use the user defined geometric function for inference, but so far I’ve not been able to get this to work in Pyro either using SVI or MCMC+NUTS. This is despite trying several variations of each and reading through several Pyro tutorials, the docs, and parts of the Pyro code. Based on the responses in the above link, I suspect that PMC may be difficult to do in Pyro, because in order to produce efficient inference, Pyro requires a lot more guidance on the part of the programmer. Those efficiency goals increase Pyro’s cognitive load over WebPPL and Church.

I also suspect that I am missing the conceptual framework needed to use Pyro. At this point the documentation is pretty terse and the tutorials are not really designed to convey that conceptual model (at least not enough for me). In some cases, I think the tutorials are misleading. For example, the first tutorial has a section titled “Universality: Stochastic Recursion, Higher-order Stochastic Functions, and Random Control Flow”, which makes it sound like Pyro easily supports all of those features for inference; however, so far, this doesn’t seem to be the case. For instance, the geometric function defined in that section does not return a tensor, so gives an error when used in inference. That’s a minor problem, but can mislead a new person. However, so far I’ve not been able to do inference with a function such as geometric that can create a different number of samples on a given call. One of the tutorials addresses this by fixing the number of samples ahead of time, but that negates the flexibility and ease of use of the recursive function.

Now it is quite possible that I’m wrong on all or some of this. I’ve certainly not stepped through all the examples, so I may be missing one that gives me the key to understanding the conceptual underpinnings of Pyro. I read the Bingham, et al. Pyro paper, but that doesn’t really go into the nuts and bolts needed to use Pyro.

I plan to continue to work on this, but I’m afraid that I may not make much progress with the current docs and tutorial material. Another idea is to do what I can do on each PMC lesson and just make it available with stubs, incomplete code, and questions for others to contribute to.

1 Like