Skip to content

Commit

Permalink
using new api cross_entropy. (PaddlePaddle#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHUI authored Jun 16, 2021
1 parent fa1e0ba commit 840149d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/text_graph/erniesage/models/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, config):
super(SoftmaxWithCrossEntropy, self).__init__()

def forward(self, logits, label):
return paddle.mean(F.softmax_with_cross_entropy(logits, label))
return F.cross_entropy(logits, label, reduction="mean")


class HingeLoss(nn.Layer):
Expand Down

0 comments on commit 840149d

Please sign in to comment.