Skip to content

Commit 6589b2a

Browse files
author
littletomatodonkey
authored
Merge pull request #277 from littletomatodonkey/dyg/adp-2.0b
fix loss
2 parents ea74648 + ab3735a commit 6589b2a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ppcls/modeling/loss.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def _crossentropy(self, input, target):
4747
if self._label_smoothing:
4848
target = self._labelsmoothing(target)
4949
input = -F.log_softmax(input, axis=-1)
50-
log_probs = -F.log_softmax(input, axis=-1)
51-
cost = paddle.reduce_sum(target * log_probs, dim=-1)
50+
cost = paddle.reduce_sum(target * input, dim=-1)
5251
else:
5352
# softmax_out = F.softmax(input)
5453
cost = F.cross_entropy(input=input, label=target)

0 commit comments

Comments
 (0)