Conversation
|
cc @fritzo |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
ingmarschuster
left a comment
There was a problem hiding this comment.
This is fine modulo correcting the semantics of unnormalized probability and normalization constant 👍
Build failures are legitimate. |
|
@vishwakftw indeed... I think it might be that the scipy nbinom uses the probability and number of successes... almost bed time here so will investigate in the morning. |
fritzo
left a comment
There was a problem hiding this comment.
Looks good. I have not checked the math.
Could you please add a docs section to docs/source/distributions.rst ?
| raise ValueError("Either `probs` or `logits` must be specified, but not both.") | ||
| if probs is not None: | ||
| self.total_count, self.probs, = broadcast_all(total_count, probs) | ||
| self.total_count = self.total_count.type_as(self.logits) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| else: | ||
| self.total_count, self.logits, = broadcast_all(total_count, logits) | ||
| self.total_count = self.total_count.type_as(self.logits) | ||
| is_scalar = isinstance(self.logits, Number) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
cc @alicanb |
|
|
||
| def sample(self, sample_shape=torch.Size()): | ||
| with torch.no_grad(): | ||
| rate = torch.distributions.Gamma(concentration=self.total_count, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Code is currently failing due to divide by 0 in |
|
thanks @alicanb for the review... will get it done |
|
@alicanb is there a way to replicate the divide by 0 error? |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@kashif We can get you the docker image for ASAN builds, will that help? |
|
@ezyang no I have a GPU box, can you tell me how exactly to run the tests with GPU enabled? Thanks! |
| @lazy_property | ||
| def _gamma(self): | ||
| return torch.distributions.Gamma(concentration=self.total_count, | ||
| rate=(1. - self.probs) / self.probs) |
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.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
aten/src/ATen/native/Distributions.h
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
facebook-github-bot
left a comment
There was a problem hiding this comment.
ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
cool thanks all! |
Summary: - [x] implement distribution - [x] add tests - [x] docs cc ingmarschuster Pull Request resolved: pytorch/pytorch#9345 Differential Revision: D8807023 Pulled By: ezyang fbshipit-source-id: 7bf7f352dd455e0909c58dd94e1bdebba0e8b5c8
Summary: - [x] implement distribution - [x] add tests - [x] docs cc ingmarschuster Pull Request resolved: pytorch#9345 Differential Revision: D8807023 Pulled By: ezyang fbshipit-source-id: 7bf7f352dd455e0909c58dd94e1bdebba0e8b5c8
cc @ingmarschuster