未验证 提交 182bf943 编写于 作者: B Bin Lu 提交者: GitHub

Update celoss.py

上级 8edec09d
...@@ -111,4 +111,5 @@ class KLDivLoss(paddle.nn.Layer): ...@@ -111,4 +111,5 @@ class KLDivLoss(paddle.nn.Layer):
if is_logit: if is_logit:
p = paddle.nn.functional.softmax(p) p = paddle.nn.functional.softmax(p)
q = paddle.nn.functional.softmax(q) q = paddle.nn.functional.softmax(q)
return -(p * paddle.log(q + 1e-8)).sum(1).mean() return -(p * paddle.log(q + 1e-8)).sum(1).mean()
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册