Skip to content

[Accuracy diff No.127] Fix accuracy diff for paddle.nn.functional.sigmoid_focal_loss API - #292

Merged
Cutelemon6 merged 2 commits into
PFCCLab:mainfrom
NKNaN:focal_loss-fix
Jun 19, 2025
Merged

Cutelemon6 merged 2 commits into
PFCCLab:mainfrom
NKNaN:focal_loss-fix

Conversation

@NKNaN

@NKNaN NKNaN commented Jun 18, 2025 •

Copy link
Copy Markdown
Contributor

修改 config_analyzer 在 sigmoid_focal_loss 生成label时只生成 0 或 1 的值。并且由于paddle在计算时调用了 sigmoid_cross_entropy_with_logits,这部分反向计算不算 label_grad,所以 sigmoid_focal_loss 也不能检查 label_grad。

回测结果:
image

@paddle-bot

paddle-bot Bot commented Jun 18, 2025

Copy link
Copy Markdown

Thanks for your contribution!

@cangtianhuang cangtianhuang left a comment

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

@cangtianhuang
cangtianhuang requested a review from Cutelemon6 June 19, 2025 06:26
@Cutelemon6

Copy link
Copy Markdown
Collaborator

@cangtianhuang 加入到 grad_diff 的配置无需从原处删除?

@Cutelemon6 Cutelemon6 left a comment

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

@Cutelemon6
Cutelemon6 merged commit 8428f30 into PFCCLab:main Jun 19, 2025
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.

3 participants