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

Check on target being between 0-1 for binary cross entropy loss #87373

Closed
dinkarjuyal opened this issue Oct 20, 2022 · 1 comment
Closed

Check on target being between 0-1 for binary cross entropy loss #87373

dinkarjuyal opened this issue Oct 20, 2022 · 1 comment
Labels
actionable module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@dinkarjuyal
Copy link

dinkarjuyal commented Oct 20, 2022

📚 The doc issue

In the docstring of https://pytorch.org/docs/stable/_modules/torch/nn/functional.html#binary_cross_entropy it is mentioned that target: Tensor of the same shape as input with values between 0 and 1. However there is no such check added anywhere.

Suggest a potential alternative/fix

Add a check similar to the one for the input here

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are

@albanD albanD added module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module actionable labels Oct 21, 2022
@albanD
Copy link
Collaborator

albanD commented Oct 21, 2022

We would be happy to accept a PR adding such a check to the cpu kernel you linked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants