mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
fix label smooth for paddle1.7
This commit is contained in:
parent
38ad51ca0d
commit
c38fd9f9bb
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user