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

Fix the normalization of logits in Categorical #70964

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

guhaohao0991
Copy link

PR Category

PR Types

Description

paddle.distribution.categorical对接受的logits参数并未采用softmax函数进行归一后传递给self._prob,导致其创建的概率分布时的逻辑与torch.distributions.Categorical接受probs参数一致,而与torch接受logits参数的逻辑不同。因此将归一方法更正为softmax函数,更改后categorical的行为与torch一致。
测试效果参考文档:https://ku.baidu-int.com/knowledge/HFVrC7hq1Q/pKzJfZczuc/qv-vZnw7HE/HnwAXB-xDS0-4B

Copy link

paddle-bot bot commented Jan 23, 2025

你的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.

@CLAassistant
Copy link

CLAassistant commented Jan 23, 2025

CLA assistant check
All committers have signed the CLA.

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