From cd5ecedf6a02c0ce1fe2c2157e2281751cec98cb Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 12 Aug 2017 08:56:33 -0500 Subject: [PATCH] Try drop_layer in parser --- spacy/syntax/nn_parser.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 201b988b9..bd56ba40b 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -47,6 +47,7 @@ from .. import util from ..util import get_async, get_cuda_stream from .._ml import zero_init, PrecomputableAffine, PrecomputableMaxouts from .._ml import Tok2Vec, doc2feats, rebatch, fine_tune +from .._ml import Residual, drop_layer from ..compat import json_dumps from . import _parse_features @@ -255,7 +256,7 @@ cdef class Parser: with Model.use_device('cpu'): upper = chain( - clone(Maxout(hidden_width), (depth-1)), + clone(drop_layer(Residual(Maxout(hidden_width))), (depth-1)), zero_init(Affine(nr_class, drop_factor=0.0)) ) # TODO: This is an unfortunate hack atm!