mirror of https://github.com/explosion/spaCy.git
Randomize pipeline order during training
This commit is contained in:
parent
a1d4c97fb7
commit
b082f76494
|
@ -215,7 +215,9 @@ class Language(object):
|
||||||
grads = {}
|
grads = {}
|
||||||
def get_grads(W, dW, key=None):
|
def get_grads(W, dW, key=None):
|
||||||
grads[key] = (W, dW)
|
grads[key] = (W, dW)
|
||||||
for proc in self.pipeline[1:]:
|
pipes = list(self.pipeline[1:])
|
||||||
|
random.shuffle(pipes)
|
||||||
|
for proc in pipes:
|
||||||
if not hasattr(proc, 'update'):
|
if not hasattr(proc, 'update'):
|
||||||
continue
|
continue
|
||||||
tokvecses, bp_tokvecses = tok2vec.model.begin_update(feats, drop=drop)
|
tokvecses, bp_tokvecses = tok2vec.model.begin_update(feats, drop=drop)
|
||||||
|
|
Loading…
Reference in New Issue