Learn What Pyro is doing behind the scenes

Hi,
it will be great to have a tutorial on what pyro is doing behind the scenes.

I understand a little bit about HMC and it took me a while to dig into the tutorials to understand that pyro is calling log_prob() and collecting the energy function with the pyro.sample() statements in the model.

I needed to implement a custom density and I did not know why do I need the .sample() method if for HMC I only collect log_prob() terms. I found the info in posts about unnormalized density.

So, to summarize this topic, it will be great to have a page in which you detail/explain in words/schematics how elbo_trace or Nuts go through the model and guide and pick up the corresponding terms and what they do afterwards.

If this exists, can you point me to it ?

Thanks!

something like that exists in this tutorial but it’s about pyro in rather general terms. it doesn’t e.g. explain how every inference algorithm works in detail—since that is of course algorithm dependent

Hi Martin,
you linked the file minipyro.py . That is neither a tutorial nor an explanation :frowning:

M

it may not be what you’re looking for but half that file is comments. so for someone who’s willing to take the time it can be quite informative.