-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Added support for sampling from a Beta distribution. #21829
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
Conversation
Not yet, probably in the (distant) future. Replacing them sounds great. |
|
Thanks Anthony! Will take a closer look later today. |
| w = a * exp(v) | ||
| break | ||
| } | ||
|
|
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.
How about removing this empty line?
| /// algorithm, when both alpha and beta are greater than 1. | ||
| /// | ||
| /// - Parameters: | ||
| /// - alpha: First Beta distribution shape parameter. |
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.
Align - with "Parameters".
| /// - alpha: First Beta distribution shape parameter. | |
| /// - alpha: First Beta distribution shape parameter. |
|
Our CI is down. We'll have to wait for it. |
|
@eaplatanios I think we also need a protocol that unifies all distributions so that |
|
@rxwei I agree. I'll look into proposing one such protocol. I could do it as part of this PR but it will probably have to wait until after the ICML deadline (January 23rd) because I'm a bit busy until then. It would also be nice to allow distributions to be defined over tensors (e.g., passing in a TensorFlow tensor as the mean of a distribution and returning TensorFlow tensors as samples). |
|
@swift-ci please test tensorflow |
6 similar comments
|
@swift-ci please test tensorflow |
|
@swift-ci please test tensorflow |
|
@swift-ci please test tensorflow |
|
@swift-ci please test tensorflow |
|
@swift-ci please test tensorflow |
|
@swift-ci please test tensorflow |
This PR adds support for sampling from a Beta distribution. Are the Greek letters acceptable in the public API? If not I can replace them.
As a side note, I believe that we should ideally have a
Distributionprotocol that let's one sample from a distribution, but also compute other quantities like expectation, pdf, cdf, etc. For that reason, I believe a couple of interesting TODOs with respect to theRandommodule would be:Distributionprotocol that requires some more things for each distribution, such as computing expectation, pdf, cdf, etc.