From a26fe8e7bb4350503843a3471d48ffd7891805a3 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 13 Sep 2018 22:51:52 +0000 Subject: [PATCH] Small hack in Language.update to make torch work --- spacy/language.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/language.py b/spacy/language.py index a993f7eb3..e64768d05 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -426,6 +426,10 @@ class Language(object): def get_grads(W, dW, key=None): grads[key] = (W, dW) + get_grads.alpha = sgd.alpha + get_grads.b1 = sgd.b1 + get_grads.b2 = sgd.b2 + pipes = list(self.pipeline) random.shuffle(pipes) for name, proc in pipes: