mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 01:34:30 +03:00
Bug fix to tagger: wasnt backproping to token vectors
This commit is contained in:
parent
877f83807f
commit
692bd2a186
|
@ -137,9 +137,12 @@ class NeuralTagger(object):
|
||||||
self.model.nI = tokvecs.shape[1]
|
self.model.nI = tokvecs.shape[1]
|
||||||
|
|
||||||
tag_scores, bp_tag_scores = self.model.begin_update(tokvecs, drop=drop)
|
tag_scores, bp_tag_scores = self.model.begin_update(tokvecs, drop=drop)
|
||||||
|
|
||||||
loss, d_tag_scores = self.get_loss(docs, golds, tag_scores)
|
loss, d_tag_scores = self.get_loss(docs, golds, tag_scores)
|
||||||
d_tokvecs = bp_tag_scores(d_tag_scores, sgd)
|
d_tokvecs = bp_tag_scores(d_tag_scores, sgd)
|
||||||
|
|
||||||
|
bp_tokvecs(d_tokvecs, sgd=sgd)
|
||||||
|
|
||||||
state['tag_scores'] = tag_scores
|
state['tag_scores'] = tag_scores
|
||||||
state['bp_tag_scores'] = bp_tag_scores
|
state['bp_tag_scores'] = bp_tag_scores
|
||||||
state['d_tag_scores'] = d_tag_scores
|
state['d_tag_scores'] = d_tag_scores
|
||||||
|
|
Loading…
Reference in New Issue
Block a user