mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Fix history size option
This commit is contained in:
parent
278a4c17c6
commit
dc3c791947
|
@ -70,8 +70,8 @@ from ..attrs cimport ID, TAG, DEP, ORTH, NORM, PREFIX, SUFFIX, TAG
|
||||||
from . import _beam_utils
|
from . import _beam_utils
|
||||||
|
|
||||||
USE_HISTORY = True
|
USE_HISTORY = True
|
||||||
HIST_SIZE = 2
|
HIST_SIZE = 8 # Max 8
|
||||||
HIST_DIMS = 16
|
HIST_DIMS = 8
|
||||||
|
|
||||||
def get_templates(*args, **kwargs):
|
def get_templates(*args, **kwargs):
|
||||||
return []
|
return []
|
||||||
|
@ -276,8 +276,8 @@ cdef class Parser:
|
||||||
upper.is_noop = True
|
upper.is_noop = True
|
||||||
elif USE_HISTORY:
|
elif USE_HISTORY:
|
||||||
upper = chain(
|
upper = chain(
|
||||||
HistoryFeatures(nr_class=nr_class, hist_size=8, nr_dim=8),
|
HistoryFeatures(nr_class=nr_class, hist_size=HIST_SIZE, nr_dim=HIST_DIMS),
|
||||||
Maxout(hidden_width, hidden_width+8*8),
|
Maxout(hidden_width, hidden_width+HIST_SIZE*HIST_DIMS),
|
||||||
zero_init(Affine(nr_class, hidden_width, drop_factor=0.0))
|
zero_init(Affine(nr_class, hidden_width, drop_factor=0.0))
|
||||||
)
|
)
|
||||||
upper.is_noop = False
|
upper.is_noop = False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user