Skip to content

Conversation

@LielinJiang
Copy link
Contributor

@LielinJiang LielinJiang commented Jul 9, 2024

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

binary_cross_entropy get wrong value when pos_weight option was given. Here is an example:

logit = paddle.to_tensor([-14.913008])
label = paddle.to_tensor([1.0])

output = paddle.nn.functional.binary_cross_entropy_with_logits(logit, label, reduction='none', pos_weight=paddle.to_tensor(3.0))
# we expect to get ouput=44.73, but got 14.913

@paddle-bot
Copy link

paddle-bot bot commented Jul 9, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jul 10, 2024
@PaddlePaddle PaddlePaddle unlocked this conversation Jul 10, 2024
Copy link
Contributor

@DesmonDay DesmonDay left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants