-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Request: Consider using a more compatible polya-gamma random sampler #4520
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
Comments
Yes, using a library with a more NumPy-like interface would be much better; however, the Pólya-gamma distribution itself should actually be removed from this repository.
Once we finalize the changes proposed in #4440, we can move the Besides that, one important consideration when switching packages is stability. The |
Thanks for the detailed response. I was not aware of these project plans. Nonetheless, I did update the project and added some basic CI and test coverage reporting. |
This would need to be done in the |
Are you suggesting i submit a PR to said branch? |
Yeah, that would be possible now. The package would likely need to be a conditional dependency (i.e. require a |
@brandonwillard see #4531 for a draft. I am not sure how random generators are passed around by the distributions in the continuous.py module. The distribution class in distribution.py uses a |
At the moment, it's safe to assume that most design questions like that probably haven't been completely worked out, yet. |
Description of your feature request
This is a feature request following a comment by @brandonwillard in pymc-devs/symbolic-pymc#107 .
Looking at the source code, it appears that for random sampling, aesara uses a polya-gamma distribution random sampler whose API isn't quite compatible to scipy's.
https://github.com/pymc-devs/aesara/blob/6c5a8fa044aae27a7ce2b6f90ef49f119bf5bdcd/aesara/tensor/random/basic.py#L387-L421
I would like to propose an alternative that has a scipy compatible API, which I think would ease the maintenance burden.
polyagamma
(repo: https://github.com/zoj613/polya-gamma) uses the same API as scipy/numpy statistical functions and is flexible and performant.Here is an example usage:
The text was updated successfully, but these errors were encountered: