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.

NumPyroConverter makes too many assumptions about the model

See original GitHub issue

The following code is not always runnable:

https://github.com/arviz-devs/arviz/blob/7ebedd2d1494f07513bc7b9ea21962bc11399a94/arviz/data/io_numpyro.py#L126-L133

This will fail for a model involving ImproperUniform, as sampling for it is not defined.

Would it be possible to add a keyword argument that specifies whether this automatic extraction of observations should be attempt or not, e.g. extract_observations or something? At the moment it’s stopping me from being able to use arviz with my numpyro-model (unless I just comment out the lines above) 😕

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
torfjeldecommented, Jun 2, 2021

Sounds reasonable to me. Do you want to submit a PR? 😃

Sure 👍

I think that for coherence with those converters, the argument should be oberved_data, then for what it should take, I think a boolean to keep or disable the current behaviour makes sense, not sure if taking a dict of “extra” variables to add or override in the observed_data would make sense too.

That sounds reasonable 👍

In my opinion, those extra log probabilities play the role of log-likelihoods.

This is not true in general, e.g. in the model I’m working with we’re using ImproperUniform together with a factor in the prior to make the implementation more efficient.

0reactions
fehiepsicommented, Jun 2, 2021

we’re using ImproperUniform together with a factor in the prior to make the implementation more efficient.

Oh, that’s a good point! I forgot that factor can be used this way. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

NumPyro documentation - Pyro
The variational inference implementation supports a number of features, including support for models with discrete latent variables (see.
Read more >
How to choose initial values for MeanField sigma, and ...
Hi everyone We have implemented the same model in pymc3, pyro and numpyro ... So, one good option can be to use all...
Read more >
arXiv:2206.00093v1 [stat.ML] 31 May 2022
We pursue tractable Bayesian analysis of gen- eralized linear models (GLMs) for categorical data. Thus far, GLMs are difficult to scale.
Read more >
An astronomer's introduction to NumPyro
Then we use these parameters to evaluate our model, making sure that we always use jax.numpy functions instead of numpy functions.
Read more >
Blog – Laplace-ML
When we have multiple models we can also better analyze overall performance ... Generally speaking, we build a neural network from assumptions about...
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