From 9b84f987bdca50891b293a65762a00145307a3af Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Tue, 11 Feb 2020 02:33:16 +0100 Subject: [PATCH] fix grad_clip naming (#4967) --- spacy/util.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 53fa81402..0cc11cef7 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -796,8 +796,6 @@ def create_default_optimizer(): beta2 = env_opt("optimizer_B2", 0.999) eps = env_opt("optimizer_eps", 1e-8) L2 = env_opt("L2_penalty", 1e-6) - max_grad_norm = env_opt("grad_norm_clip", 1.0) - optimizer = Adam(learn_rate, L2=L2, beta1=beta1, beta2=beta2, eps=eps, ops=ops) - optimizer.max_grad_norm = max_grad_norm - optimizer.device = ops.device_type + grad_clip = env_opt("grad_norm_clip", 1.0) + optimizer = Adam(learn_rate, L2=L2, beta1=beta1, beta2=beta2, eps=eps, ops=ops, grad_clip=grad_clip) return optimizer