From 233945bfe0847e9e9c43156c7360e181e8490ecd Mon Sep 17 00:00:00 2001 From: Matthw Honnibal Date: Tue, 30 Jun 2020 11:50:24 +0200 Subject: [PATCH] Fix init for padding --- spacy/ml/_precomputable_affine.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/ml/_precomputable_affine.py b/spacy/ml/_precomputable_affine.py index 896f972c1..3b5f09e7b 100644 --- a/spacy/ml/_precomputable_affine.py +++ b/spacy/ml/_precomputable_affine.py @@ -110,6 +110,7 @@ def init(model, X=None, Y=None): ops = model.ops W = normal_init(ops, W.shape, mean=float(ops.xp.sqrt(1.0 / nF * nI))) + pad = normal_init(ops, pad.shape, mean=1.0) model.set_param("W", W) model.set_param("b", b) model.set_param("pad", pad)