pyro
pyro copied to clipboard
Port NumPyro introductory examples to Pyro
NumPyro now has several excellent introductory examples with no direct counterparts in Pyro. Porting one of these to Pyro would be a great way for someone to simultaneously learn more about Bayesian data analysis and make a valuable open source contribution.
If you are reading this and want to give one of them a try, please leave a comment here so that other people are aware of your work and so we can help you get started!
Bonus points if you can modify an example to use variational inference with Pyro's autoguides rather than MCMC while obtaining similar results.
List of examples:
- [ ] Bayesian Regression Using NumPyro (@arijc76 - #3006 )
- [ ] Bayesian Hierarchical Regression (@JamesTrick)
- [ ] Bayesian Imputation
I can start working on the Bayesian Regression example if no one else is working on it.
@arijc76 great, go for it!
@eb8680 - I am nearly done with the regression example.
However, there is one issue. I am unable to figure out why the custom predict function is not showing the same results as the Predictive utility. Since I can't use vmap
as per the NumPyro example, I am using a for loop. I think it might be a problem with the seed. I'd appreciate any suggestion on this.
Also, I have added variational inference with an autoguide for model 1.
Here's a link to my git repo where can take a look - https://github.com/arijc76/prob-ml/blob/main/bayesian_regression_pyro.ipynb
Let me know any feedback. Thanks.
Hi @arijc76, nice work! The reason you are seeing different values in your custom predict
function is that it is drawing fresh samples for the random variable obs
, as expected. If you'd like the values to be more similar, you could draw more samples (1000, say). You can use pyro.plate
to vectorize sampling, as in this section of the Pyro intro tutorial.
Whenever you're ready, feel free to open a pull request with your notebook so we can review it in more detail.
Thanks @eb8680. The results are more similar now after following your suggestion.
I will open a pull request with the notebook.
After reviewing the Contributing.md, I wanted to clarify if it is sufficient to follow the steps mentioned in the Testing Tutorials
section or is there anything else that I should be checking before submitting the pull request. Thanks again.
@arijc76 that should be fine - we can help you get CI tests working in the PR.
I'm keen to contribute the Bayesian Hierarchical Regression tutorial, I've already ported it in the past so will clean it up and try variational inference with it.
@JamesTrick sorry for the delay, that sounds great! Please let us know if you need any help getting started.
Hi @eb8680 Since I'm nearly done with the Bayesian Regression Using NumPyro example, I can work on the Bayesian Imputation example if that's ok.
Hi there @arijc76 , is this issue still available for contribution? I am keen to give Bayesian Imputation a try
Hi @willtai , Yes it's available. I am not working on the Bayesian Imputation example.
If the Bayesian imputation task is still open, I'd like to pick it up. @willtai @arijeetchatterjee