Skip to content

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Nov 5, 2021

Resolves #2957

This ports numpyro.render_model() nearly verbatim to pyro.render_model(), including the tutorial.

I've prioritized this because of a recent user story: a scientist wanted to learn Pyro/NumPyro, and eventually chose NumPyro because the learning curve was less steep. This scientist said:

numpyro.render_model() was very helpful! It felt almost like numpyro is a probabilistic model rendering library that happened to also perform inference. I couldn't figure out what this numpyro.plate thing was until I could play around with models and see how their plate structured worked visually.

Ported functions and files:

Tested

  • tutorial is added to test harness
  • checked rendering and doc links manually

@fritzo fritzo requested a review from fehiepsi November 5, 2021 19:04
@fritzo fritzo mentioned this pull request Nov 5, 2021
2 tasks
@fritzo fritzo removed the request for review from fehiepsi November 5, 2021 20:01
@fritzo fritzo added the WIP label Nov 5, 2021
@fritzo fritzo added awaiting review and removed WIP labels Nov 5, 2021
@fritzo fritzo requested a review from fehiepsi November 5, 2021 21:49
fehiepsi
fehiepsi previously approved these changes Nov 7, 2021
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! The provenance one is nice.

sample sites on which it depend;
- "sample_dist" maps each sample site to the name of the distribution at
that site;
- "plate_sample" maps each plate name to a lists of the sample sites
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: lists -> list

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks for catching!

@fehiepsi fehiepsi merged commit 85a288a into dev Nov 8, 2021
@fritzo fritzo deleted the render-model branch February 24, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Backport numpyro.render_model()
2 participants