-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Allowing for vectorized counts in Binomial Distribution #6720
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
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
There seems to be an overflow error when we construct the message string in |
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/distributions/binomial.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_distributions.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@yf225 GPU perf test failed on this one |
|
@ezyang The GPU perf test suite wasn't updated at the time. Fixed in pytorch/examples#332. |
|
@pytorchbot retest this please |
1 similar comment
|
@pytorchbot retest this please |
|
@apaszke - I will address all your comments shortly. Thanks for reviewing! |
|
@apaszke - On a related note, are there plans to have implicit casting for operations, like |
|
LGTM, but the tests are failing. Yes, we are planning to add more and more support for cross-type ops. |
7a8c4c2 to
bfcd553
Compare
|
@pytorchbot retest this please |
Currently the
Binomialdistribution only allows for integer counts, i.e.total_countremains fixed while we can vary the probability tensor. Since we are drawing Bernoullis internally when sampling from Binomial, there is no need to restricttotal_countto be an integer, and we can support vectorized counts with a small modification. This will be really useful for building beta-binomial regression models, for instance.Additionally, some of the methods assumed that
total_count > 0. Made some minor changes to ensure thattotal_count = 0works as expected, and added this special case to the tests.Hat tip to @fritzo for suggesting this. Math reviewed in probtorch#148.
cc. @apaszke