Try drop_layer in parser

This commit is contained in:
Matthew Honnibal 2017-08-12 08:56:33 -05:00
parent 8870d491f1
commit cd5ecedf6a
1 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ from .. import util
from ..util import get_async, get_cuda_stream from ..util import get_async, get_cuda_stream
from .._ml import zero_init, PrecomputableAffine, PrecomputableMaxouts from .._ml import zero_init, PrecomputableAffine, PrecomputableMaxouts
from .._ml import Tok2Vec, doc2feats, rebatch, fine_tune from .._ml import Tok2Vec, doc2feats, rebatch, fine_tune
from .._ml import Residual, drop_layer
from ..compat import json_dumps from ..compat import json_dumps
from . import _parse_features from . import _parse_features
@ -255,7 +256,7 @@ cdef class Parser:
with Model.use_device('cpu'): with Model.use_device('cpu'):
upper = chain( 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)) zero_init(Affine(nr_class, drop_factor=0.0))
) )
# TODO: This is an unfortunate hack atm! # TODO: This is an unfortunate hack atm!