-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
add binary cross entropy with logit loss #26468
Conversation
Thanks for your contribution! |
python/paddle/nn/functional/loss.py
Outdated
label = paddle.to_tensor([1.0, 0.0, 1.0], dtype="float32") | ||
output = paddle.nn.functional.binary_cross_entropy_with_logits(input, label) | ||
print(output.numpy()) # [0.45618808] | ||
paddle.enable_static() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete 一行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
python/paddle/nn/layer/loss.py
Outdated
N is batch_size, `*` means number of additional dimensions. The ``logit`` | ||
is usually the output of Linear layer. Available dtype is float32, float64. | ||
label (Tensor): The target labels tensor. 2-D tensor with the same shape as | ||
``input``. The target labels which values should be numbers between 0 and 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input->logit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
APIs
Describe
add binary cross entropy with logit loss