From b082f764944a1e5ebc2e9f5e7b44a48221cbbe6c Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 27 May 2017 18:32:21 -0500 Subject: [PATCH] Randomize pipeline order during training --- spacy/language.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 7adae0ed5..e874dbb78 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -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)