未验证 提交 3200006a 编写于 作者: L littletomatodonkey 提交者: GitHub

Merge pull request #153 from littletomatodonkey/fix_ls

fix label smooth for paddle1.7
...@@ -41,6 +41,7 @@ class Loss(object): ...@@ -41,6 +41,7 @@ class Loss(object):
label=one_hot_target, epsilon=self._epsilon, dtype="float32") label=one_hot_target, epsilon=self._epsilon, dtype="float32")
soft_target = fluid.layers.reshape( soft_target = fluid.layers.reshape(
soft_target, shape=[-1, self._class_dim]) soft_target, shape=[-1, self._class_dim])
soft_target.stop_gradient = True
return soft_target return soft_target
def _crossentropy(self, input, target): def _crossentropy(self, input, target):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册