Hi Pyro devs, would you mind explaining Pyro programs from the perspective of the trace?
That is, in probabilistic programming systems (PPS) one can think of inference as sampling from the a posteriori distribution of execution traces arising from stochastic programs constrained to reflect observed data. This implies there must be an explicit representation of the execution trace. In Pyro this is with the Trace (and TraceMessenger?) objects, but it’s not entirely clear how the trace is invoked and utilized. For example, importance sampling inference creates a few trace instances (here), but how does the program operate on these trace objects and how do they relate to a global execution trace?
The main info I’m looking for is (i) where is a global execution trace represented and interacted with by Trace objects, (ii) where and how is the trace modified to e.g. condition on observed data, and (iii) what criteria/choices went into the design of the Pyro trace?
Thanks in advance!