Skip to content
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

Fix docstring to clarify logits usage for multiclass case #51053

Closed
wants to merge 6 commits into from

Conversation

neerajprad
Copy link
Contributor

@neerajprad neerajprad commented Jan 25, 2021

Fixes #50378.

Additionally, this has some minor fixes:

  • Fix mean for half-cauchy to return inf instead of nan.
  • Fix constraints/support for the relaxed categorical distribution.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jan 25, 2021

💊 CI failures summary and remediations

As of commit add24ff (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

torch/distributions/categorical.py Outdated Show resolved Hide resolved
torch/distributions/half_cauchy.py Show resolved Hide resolved
'logits': constraints.real}
support = constraints.real
'logits': constraints.real_vector}
support = constraints.real_vector
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc. @fritzo.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm not sure whether real_vector is the optimal constraint, but I believe it is the tightest valid constraint that we currently implement. I think that's fine since most users will use the wrapper class with the exact simplex constraint.

'logits': constraints.real}
support = constraints.real
'logits': constraints.real_vector}
support = constraints.real_vector
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm not sure whether real_vector is the optimal constraint, but I believe it is the tightest valid constraint that we currently implement. I think that's fine since most users will use the wrapper class with the exact simplex constraint.

@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

Merging #51053 (61f2576) into master (48b6b92) will increase coverage by 0.00%.
The diff coverage is 98.20%.

@@           Coverage Diff           @@
##           master   #51053   +/-   ##
=======================================
  Coverage   80.91%   80.91%           
=======================================
  Files        1925     1926    +1     
  Lines      210008   210019   +11     
=======================================
+ Hits       169919   169947   +28     
+ Misses      40089    40072   -17     

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neerajprad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neerajprad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@neerajprad merged this pull request in e2041ce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Categorical logits argument is treated as log probabilities
4 participants