mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
More fixes for #3112
This commit is contained in:
parent
e485241003
commit
f31dbec528
|
@ -268,7 +268,7 @@ class ParserStepModel(Model):
|
||||||
def backprop_parser_step(d_scores, sgd=None):
|
def backprop_parser_step(d_scores, sgd=None):
|
||||||
# If we have a non-zero gradient for a previously unseen class,
|
# If we have a non-zero gradient for a previously unseen class,
|
||||||
# replace the weight with 0.
|
# replace the weight with 0.
|
||||||
new_classes = self.ops.xp.logical_and(
|
new_classes = self.vec2scores.ops.xp.logical_and(
|
||||||
self.vec2scores.ops.xp.isnan(self.vec2scores.b),
|
self.vec2scores.ops.xp.isnan(self.vec2scores.b),
|
||||||
d_scores.any(axis=0)
|
d_scores.any(axis=0)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user