From ce321b03225149aaa0d847e9ac4e00fac96ec801 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 18 Aug 2017 22:24:46 +0200 Subject: [PATCH] Restore changes from nn-beam-parser to spacy/_ml --- spacy/_ml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index b3b0d3e46..91b530fad 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -9,7 +9,7 @@ import cytoolz from thinc.neural._classes.convolution import ExtractWindow from thinc.neural._classes.static_vectors import StaticVectors -from thinc.neural._classes.batchnorm import BatchNorm as BN +from thinc.neural._classes.batchnorm import BatchNorm from thinc.neural._classes.layernorm import LayerNorm as LN from thinc.neural._classes.resnet import Residual from thinc.neural import ReLu @@ -229,14 +229,14 @@ def Tok2Vec(width, embed_size, preprocess=None): suffix = get_col(cols.index(SUFFIX)) >> HashEmbed(width, embed_size//2, name='embed_suffix') shape = get_col(cols.index(SHAPE)) >> HashEmbed(width, embed_size//2, name='embed_shape') - embed = (norm | prefix | suffix | shape ) >> LN(Maxout(width, width*4, pieces=3)) + embed = (norm | prefix | suffix | shape ) >> Maxout(width, width*4, pieces=3) tok2vec = ( with_flatten( asarray(Model.ops, dtype='uint64') >> uniqued(embed, column=5) >> drop_layer( Residual( - (ExtractWindow(nW=1) >> BN(Maxout(width, width*3))) + (ExtractWindow(nW=1) >> ReLu(width, width*3)) ) ) ** 4, pad=4 )