-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
JAX: Implement geometric RV sampling #1444
Conversation
sample_num = jax.numpy.log(jax.random.uniform(sampling_key, size)) | ||
sample = sample_num / jax.numpy.log1p(-p) | ||
sample_ceil = jax.numpy.ceil(sample) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference: http://www.nrbook.com/devroye/Devroye_files/chapter_ten.pdf (pg. 15-16)
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1444 +/- ##
=======================================
Coverage 74.81% 74.81%
=======================================
Files 194 194
Lines 49995 50007 +12
Branches 10572 10572
=======================================
+ Hits 37402 37414 +12
Misses 10267 10267
Partials 2326 2326
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but appears to need some conflicts resolved.
552346f
Thank you @Smit-create! |
Fixes #1323
Here are a few important guidelines and requirements to check before your PR can be merged:
pre-commit
is installed and set up.