Randomize pipeline order during training

This commit is contained in:
Matthew Honnibal 2017-05-27 18:32:21 -05:00
parent a1d4c97fb7
commit b082f76494

View File

@ -215,7 +215,9 @@ class Language(object):
grads = {}
def get_grads(W, dW, key=None):
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'):
continue
tokvecses, bp_tokvecses = tok2vec.model.begin_update(feats, drop=drop)