Skip to content

Commit e890e41

Browse files
committed
Don't do softmax
1 parent b9fe636 commit e890e41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

supar/parsers/sdp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def _predict(self, loader):
454454
label_preds = self.model.decode(s_edge, s_label).masked_fill(~mask, -1)
455455
preds['labels'].extend(chart[1:i, :i].tolist() for i, chart in zip(lens, label_preds))
456456
if self.args.prob:
457-
preds['probs'].extend([prob[1:i, :i].cpu() for i, prob in zip(lens, s_edge.softmax(-1).unbind())])
457+
preds['probs'].extend([prob[1:i, :i].cpu() for i, prob in zip(lens, s_edge.unbind())])
458458
preds['labels'] = [CoNLL.build_relations([[self.LABEL.vocab[i] if i >= 0 else None for i in row] for row in chart])
459459
for chart in preds['labels']]
460460

0 commit comments

Comments
 (0)