ppl

PyMC3 shape handling

This post is intended to explain: What the shape attribute of a pymc3 RV is. What’s the difference between an RV’s and its associated distribution’s shape. How does a distribution’s shape determine the shape of its logp output. The potential trouble this can bring with samples drawn from the prior or from the posterior predictive distributions. The many implicit semantically relevant shapes associated with pymc3 models. We will follow the naming convention used by tensorflow probability and talk about sample, batch and event shapes.