Only train one task per iter, holding grads
@@ -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.
