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
Potential bug when sampling from categorical distribution #5062
Comments
Yes this is a bug. Fortunately it seems to have been fixed on master. Thanks for reporting! |
@christinaheinze you can follow instructions here to easily compile for master: https://github.com/pytorch/pytorch#from-source |
Ok, thanks! |
On master the issue has been solved for the categorial distribution but not for the multinomial distribution as it seems:
and also
|
I'll take a look at this tomorrow. |
|
@alicanb It's maintaining a |
On second thought, what is the bug here? |
@alicanb It's CPU |
@alicanb Btw, do you know why |
@ssnl |
@christinaheinze if you're trying to implement multinomial distribution btw, we have |
Summary: Pull Request resolved: pytorch/glow#5062 Pull Request resolved: pytorch#45556 User defined classes can be used as constants. This is useful when freezing and removing the module from the graph. Test Plan: waitforsadcastle Reviewed By: eellison Differential Revision: D23994974 fbshipit-source-id: 6c494269e222b7e1b5ecddf0c460ae8c09ac0556
Summary: Pull Request resolved: pytorch/glow#5062 Pull Request resolved: #45556 User defined classes can be used as constants. This is useful when freezing and removing the module from the graph. Test Plan: waitforsadcastle Reviewed By: eellison Differential Revision: D23994974 fbshipit-source-id: 5b4a5c91158aa7f22df39d71f2658afce1d29317
Hi,
I would like to sample from a categorical distribution where the probabilities passed are the columns of a tensor p_dG:
The output from
print(c)
is[ 29 25 196]
. So the distribution is completely off since the bulk of the observations should be equal to 1 (instead of being equal to 2).In contrast, the following code works as expected:
Is this a bug or am I missing something?
I am using:
Thanks!
The text was updated successfully, but these errors were encountered: