Skip to content

Commit f00c160

Browse files
committed
Fix default value for ignore_index to -100 to match with CrossEntropyLoss
1 parent 73dccc8 commit f00c160

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_toolbelt/losses/soft_ce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class SoftCrossEntropyLoss(nn.Module):
9-
def __init__(self, smooth_factor=1e-4, ignore_index=None):
9+
def __init__(self, smooth_factor=1e-4, ignore_index: int = -100):
1010
super().__init__()
1111
self.smooth_factor = smooth_factor
1212
self.ignore_index = ignore_index

0 commit comments

Comments
 (0)