From b73295557c7b0638a9163669360dab6545f4e74f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 30 Aug 2016 11:00:27 +0200 Subject: [PATCH] Fix regression on cost --- spacy/syntax/_neural.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/syntax/_neural.pyx b/spacy/syntax/_neural.pyx index 752bf86d9..30064222c 100644 --- a/spacy/syntax/_neural.pyx +++ b/spacy/syntax/_neural.pyx @@ -43,9 +43,8 @@ cdef class ParserPerceptron(AveragedPerceptron): continue loss += (-eg.c.costs[clas] - eg.c.scores[clas]) ** 2 d_loss = 2 * (-eg.c.costs[clas] - eg.c.scores[clas]) - step = d_loss * 0.001 for feat in eg.c.features[:eg.c.nr_feat]: - self.update_weight(feat.key, clas, feat.value * step) + self.update_weight(feat.key, clas, feat.value * -d_loss) return int(loss) cdef int set_featuresC(self, FeatureC* feats, const void* _state) nogil: