Skip to content

Commit 5943ae4

Browse files
committed
unscrew with the reshaping
1 parent a334cf9 commit 5943ae4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stanza/models/coref/model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,12 @@ def train(self, log=False):
576576

577577
if (res.zeros_y == 1).any():
578578
zeros_preds = res.zeros_scores[res.zeros_y != -100].reshape(-1, 2)
579-
labels = res.zeros_y[res.zeros_y != -100].reshape(-1, 2)
579+
labels = res.zeros_y[res.zeros_y != -100].reshape(-1)
580580
# reweight such that the zeros and nonzeros count for equal weighting
581581
# that is, artifically balance the "number of samples" by weighting between
582582
# them equally
583-
zeros_loss = self._zeros_loss(zeros_preds, labels.float())
583+
# print(labels.float())
584+
zeros_loss = self._zeros_loss(zeros_preds, labels.long())
584585
else:
585586
zeros_loss = 0.0 # don't apply loss if there's nothing to learn
586587

0 commit comments

Comments
 (0)