Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port NumPyro introductory examples to Pyro #2995

Open
3 tasks
eb8680 opened this issue Dec 14, 2021 · 12 comments
Open
3 tasks

Port NumPyro introductory examples to Pyro #2995

eb8680 opened this issue Dec 14, 2021 · 12 comments
Labels
Examples good first issue help wanted Issues suitable for, and inviting external contributions

Comments

@eb8680
Copy link
Member

eb8680 commented Dec 14, 2021

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:

@eb8680 eb8680 added help wanted Issues suitable for, and inviting external contributions Examples good first issue labels Dec 14, 2021
@arijeetchatterjee
Copy link

I can start working on the Bayesian Regression example if no one else is working on it.

@eb8680
Copy link
Member Author

eb8680 commented Jan 4, 2022

@arijc76 great, go for it!

@arijeetchatterjee
Copy link

@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.

@eb8680
Copy link
Member Author

eb8680 commented Jan 10, 2022

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.

@arijeetchatterjee
Copy link

arijeetchatterjee commented Jan 16, 2022

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.

@eb8680
Copy link
Member Author

eb8680 commented Jan 16, 2022

@arijc76 that should be fine - we can help you get CI tests working in the PR.

@JamesTrick
Copy link
Contributor

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.

@eb8680
Copy link
Member Author

eb8680 commented Jan 20, 2022

@JamesTrick sorry for the delay, that sounds great! Please let us know if you need any help getting started.

@arijeetchatterjee
Copy link

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.

@willtai
Copy link

willtai commented May 26, 2022

Hi there @arijc76 , is this issue still available for contribution? I am keen to give Bayesian Imputation a try

@arijeetchatterjee
Copy link

Hi @willtai , Yes it's available. I am not working on the Bayesian Imputation example.

@nikolageorgiev2000
Copy link

If the Bayesian imputation task is still open, I'd like to pick it up. @willtai @arijeetchatterjee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Examples good first issue help wanted Issues suitable for, and inviting external contributions
Projects
None yet
Development

No branches or pull requests

5 participants