From dc3c79194763d28e5d9e34918c22a05585d151cc Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Oct 2017 13:41:23 +0200 Subject: [PATCH] Fix history size option --- spacy/syntax/nn_parser.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 4a874e834..87099aa4f 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -70,8 +70,8 @@ from ..attrs cimport ID, TAG, DEP, ORTH, NORM, PREFIX, SUFFIX, TAG from . import _beam_utils USE_HISTORY = True -HIST_SIZE = 2 -HIST_DIMS = 16 +HIST_SIZE = 8 # Max 8 +HIST_DIMS = 8 def get_templates(*args, **kwargs): return [] @@ -276,8 +276,8 @@ cdef class Parser: upper.is_noop = True elif USE_HISTORY: upper = chain( - HistoryFeatures(nr_class=nr_class, hist_size=8, nr_dim=8), - Maxout(hidden_width, hidden_width+8*8), + HistoryFeatures(nr_class=nr_class, hist_size=HIST_SIZE, nr_dim=HIST_DIMS), + Maxout(hidden_width, hidden_width+HIST_SIZE*HIST_DIMS), zero_init(Affine(nr_class, hidden_width, drop_factor=0.0)) ) upper.is_noop = False