From 3e3a309764cf6923fcae48f4abcb07c641555f89 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 13 Sep 2018 14:14:38 +0200 Subject: [PATCH] Fix tagger --- spacy/pipeline.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index 7b4572db5..17d002c43 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -681,7 +681,7 @@ class Tagger(Pipe): idx += 1 correct = self.model.ops.xp.array(correct, dtype='i') d_scores = scores - to_categorical(correct, nb_classes=scores.shape[1]) - d_scores *= self.ops.asarray(known_labels) + d_scores *= self.model.ops.asarray(known_labels) loss = (d_scores**2).sum() d_scores = self.model.ops.unflatten(d_scores, [len(d) for d in docs]) return float(loss), d_scores