Skip to content

Fix docstring to clarify logits usage for multiclass case#51053

Closed
neerajprad wants to merge 6 commits intopytorch:masterfrom
neerajprad:multi-logit-doc
Closed

Fix docstring to clarify logits usage for multiclass case#51053
neerajprad wants to merge 6 commits intopytorch:masterfrom
neerajprad:multi-logit-doc

Conversation

@neerajprad
Copy link
Copy Markdown
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
Copy Markdown
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.

@neerajprad neerajprad requested a review from fritzo January 25, 2021 20:52
Comment thread torch/distributions/half_cauchy.py
Comment thread torch/distributions/categorical.py Outdated
Comment thread torch/distributions/half_cauchy.py
'logits': constraints.real}
support = constraints.real
'logits': constraints.real_vector}
support = constraints.real_vector
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

@neerajprad merged this pull request in e2041ce.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
)

Summary:
Fixes pytorch#50378.

Additionally, this has some minor fixes:
 - [x] Fix mean for half-cauchy to return `inf` instead of `nan`.
 - [x] Fix constraints/support for the relaxed categorical distribution.

Pull Request resolved: pytorch#51053

Reviewed By: heitorschueroff

Differential Revision: D26077966

Pulled By: neerajprad

fbshipit-source-id: ca0213baa9bbdbc661aebbb901ab5e7fded38a5f
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