question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pyro.render_model() fails to draw overlapping non-nested plates

See original GitHub issue

Due to a shortcoming in graphviz clusters, Pyro’s and NumPyro’s pyro.render_model() currently cannot render overlapping non-nested plates, e.g. the Venn diagram

def model():
    plate1 = pyro.plate("plate1", 2, dim=-2)
    plate2 = pyro.plate("plate2", 3, dim=-1)
    with plate1:
        x = pyro.sample("x", dist.Normal(0, 1))
    with plate1, plate2:
        y = pyro.sample("y", dist.Normal(x, 1))
    with plate2:
        pyro.sample("z", dist.Normal(y.sum(-2, True), 1), obs=torch.zeros(3))

pyro.render_model(model)

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fehiepsicommented, Dec 8, 2021

It seems that in numpyro, we have image which can be seen as a temporary solution. What do you think @fritzo ?

0reactions
fritzocommented, Dec 8, 2021

@fehiepsi NumPyro’s current behavior looks great, and I suspect it’s the only fully general solution 👍 Do you know if that was a recent change, or did I make an error when porting code to Pyro #2962?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyro.render_model() fails to draw overlapping non-nested plates
A more basic problem is that not all plate nesting patterns can be drawn by rectangular overlapping plates. Maybe we could use a...
Read more >
Automatically rendering probabilistic graphical models #949
I'd probably go for numpyro.sample and numpyro.plate first. ... pyro.render_model() fails to draw overlapping non-nested plates ...
Read more >
Automatic rendering of Pyro models
As pyro.render_model returns an object of type graphviz.dot. ... Note that overlapping non-nested plates may be drawn as multiple rectangles.
Read more >
NumPyro Documentation - Read the Docs
SA is the only MCMC method in NumPyro that does not leverage gradients. ... Note that overlapping non-nested plates may be drawn as...
Read more >
Automatic rendering of NumPyro models - Google Colab
!pip install -q numpyro@git+https://github.com/pyro-ppl/numpyro ... Note that overlapping non-nested plates may be drawn as multiple rectangles.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found