CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Hackathon 6th No.29】为 paddle.nn.functional.kl_div 进行功能增强 -part #63860
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
self.log_target = False | ||
|
||
|
||
class TestKLDivLossOp5(TestKLDivLossOp): |
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.
log_target为True时,再加一个不同shape的测试case吧
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.
已增加
|
||
class TestKLDivLossOp4(TestKLDivLossOp): | ||
def initTestCase(self): | ||
self.x_shape = (5, 20) | ||
self.reduction = 'none' | ||
self.log_target = False | ||
|
||
class TestKLDivLossOp5(TestKLDivLossOp): |
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.
同上
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.
已增加
@@ -1649,6 +1655,7 @@ def kl_div(input, label, reduction='mean', name=None): | |||
if `reduction` is ``'sum'``, the reduced sum loss is returned; | |||
if `reduction` is ``'none'``, no reduction will be applied. | |||
Default is ``'mean'``. | |||
log_target (bool, optional): Indicate whether `label` is passed in log space. Default is False. |
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.
下面的示例代码,可以加一个log_target=True时的代码
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.
已修改
@@ -1054,6 +1060,7 @@ class KLDivLoss(Layer): | |||
if `reduction` is ``'sum'``, the reduced sum loss is returned; | |||
if `reduction` is ``'none'``, no reduction will be applied. | |||
Default is ``'mean'``. | |||
log_target (bool, optional): Indicate whether `label` is passed in log space. Default is False. |
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.
下面的示例代码,可以加一个log_target=True时的代码
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.
已修改
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
@NKNaN PR-CI-Static-Check显示示例代码有问题,需要再看一下 |
已修改 |
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
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 for docs
…le#63860) * udpate kldiv_loss * update xpu * fix xpu test * add docs code example and add test case * fix code example * fix code example * fix code example
…le#63860) * udpate kldiv_loss * update xpu * fix xpu test * add docs code example and add test case * fix code example * fix code example * fix code example
…le#63860) * udpate kldiv_loss * update xpu * fix xpu test * add docs code example and add test case * fix code example * fix code example * fix code example
…le#63860) * udpate kldiv_loss * update xpu * fix xpu test * add docs code example and add test case * fix code example * fix code example * fix code example
…le#63860) * udpate kldiv_loss * update xpu * fix xpu test * add docs code example and add test case * fix code example * fix code example * fix code example
…le#63860) * udpate kldiv_loss * update xpu * fix xpu test * add docs code example and add test case * fix code example * fix code example * fix code example
PR Category
User Experience
PR Types
Improvements
Description
paddle.nn.functional.kl_div 增加参数 log_target
#62986