[Fix] Fix `loss_weight` in `LabelSmoothLoss`. (#1058)

pull/1062/head
whcao 2022-09-28 08:18:12 +08:00 committed by GitHub
parent 51b7c754e7
commit 8c5d86a388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ class LabelSmoothLoss(nn.Module):
f'and target.shape: {one_hot_like_label.shape}'
smoothed_label = self.smooth_label(one_hot_like_label)
return self.ce.forward(
return self.loss_weight * self.ce.forward(
cls_score,
smoothed_label,
weight=weight,