From 8500d9b1da9f0c4badabcc377c340283f66c0a17 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 25 May 2017 06:47:42 -0500 Subject: [PATCH] Only train one task per iter, holding grads --- spacy/language.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/language.py b/spacy/language.py index d48fec048..65416f208 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -222,8 +222,9 @@ class Language(object): continue tokvecses, bp_tokvecses = tok2vec.model.begin_update(feats, drop=drop) d_tokvecses = proc.update((docs, tokvecses), golds, - drop=drop, sgd=sgd, losses=losses) - bp_tokvecses(d_tokvecses, sgd=sgd) + drop=drop, sgd=get_grads, losses=losses) + bp_tokvecses(d_tokvecses, sgd=get_grads) + break for key, (W, dW) in grads.items(): sgd(W, dW, key=key) # Clear the tensor variable, to free GPU memory.