From 7b3f391f80a8c30b815cd202f5340933280120d5 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 18 Sep 2017 11:35:59 -0500 Subject: [PATCH] Try dropping the Affine layer, conditionally --- spacy/_ml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index ce818c8e1..dde78af8a 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -251,7 +251,8 @@ def Tok2Vec(width, embed_size, pretrained_dims=0): tok2vec = ( embed >> with_flatten( - Affine(width, width+pretrained_dims) + (Affine(width, width+pretrained_dims) + if pretrained_dims else noop()) >> convolution ** 4, pad=4) )