From 943af4423a9b3f0eced972c420ae023d8e3a1dd4 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 4 Oct 2017 20:06:05 -0500 Subject: [PATCH] Make depth setting in parser work again --- 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 016807e87..422b0fdc7 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -277,6 +277,7 @@ cdef class Parser: upper = chain( HistoryFeatures(nr_class=nr_class, hist_size=HIST_SIZE, nr_dim=HIST_DIMS), Maxout(hidden_width, hidden_width+HIST_SIZE*HIST_DIMS), + clone(Maxout(hidden_width, hidden_width), depth-2), zero_init(Affine(nr_class, hidden_width, drop_factor=0.0)) ) upper.is_noop = False @@ -286,7 +287,7 @@ cdef class Parser: zero_init(Affine(nr_class, hidden_width, drop_factor=0.0)) ) upper.is_noop = False - + # TODO: This is an unfortunate hack atm! # Used to set input dimensions in network. lower.begin_training(lower.ops.allocate((500, token_vector_width)))