diff --git a/spacy/_ml.py b/spacy/_ml.py index 77d6e0615..47f5c545e 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -1,33 +1,28 @@ import ujson +from thinc.v2v import Model, Maxout, Softmax, Affine, ReLu, SELU +from thinc.i2v import HashEmbed, StaticVectors +from thinc.t2t import ExtractWindow, ParametricAttention +from thinc.t2v import Pooling, max_pool, mean_pool, sum_pool +from thinc.misc import Residual +from thinc.misc import BatchNorm as BN +from thinc.misc import LayerNorm as LN + from thinc.api import add, layerize, chain, clone, concatenate, with_flatten -from thinc.neural._classes.model import Model -from thinc.neural._classes.maxout import Maxout -from thinc.neural._classes.softmax import Softmax -from thinc.neural._classes.affine import Affine -from thinc.neural._classes.hash_embed import HashEmbed +from thinc.api import FeatureExtracter, with_getitem +from thinc.api import uniqued, wrap, flatten_add_lengths, noop + +from thinc.linear.linear import LinearModel from thinc.neural.ops import NumpyOps, CupyOps from thinc.neural.util import get_array_module + import random 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.layernorm import LayerNorm as LN -from thinc.neural._classes.resnet import Residual -from thinc.neural._classes.relu import ReLu -from thinc.neural._classes.selu import SELU from thinc import describe from thinc.describe import Dimension, Synapses, Biases, Gradient from thinc.neural._classes.affine import _set_dimensions_if_needed -from thinc.api import FeatureExtracter, with_getitem -from thinc.neural.pooling import Pooling, max_pool, mean_pool, sum_pool -from thinc.neural._classes.attention import ParametricAttention -from thinc.linear.linear import LinearModel -from thinc.api import uniqued, wrap, flatten_add_lengths, noop import thinc.extra.load_nlp - from .attrs import ID, ORTH, LOWER, NORM, PREFIX, SUFFIX, SHAPE, TAG, DEP, CLUSTER from .tokens.doc import Doc from . import util diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index f6ee257d8..8d935335c 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -13,20 +13,18 @@ import ujson import msgpack from thinc.api import add, layerize, chain, clone, concatenate, with_flatten -from thinc.neural._classes.model import Model -from thinc.neural._classes.maxout import Maxout -from thinc.neural._classes.softmax import Softmax -from thinc.neural._classes.affine import Affine -from thinc.neural._classes.hash_embed import HashEmbed +from thinc.v2v import Model, Maxout, Softmax, Affine, ReLu, SELU +from thinc.i2v import HashEmbed +from thinc.t2v import Pooling, max_pool, mean_pool, sum_pool +from thinc.t2t import ExtractWindow, ParametricAttention +from thinc.misc import Residual +from thinc.misc import BatchNorm as BN +from thinc.misc import LayerNorm as LN + from thinc.neural.util import to_categorical -from thinc.neural.pooling import Pooling, max_pool, mean_pool from thinc.neural._classes.difference import Siamese, CauchySimilarity -from thinc.neural._classes.convolution import ExtractWindow -from thinc.neural._classes.resnet import Residual -from thinc.neural._classes.batchnorm import BatchNorm as BN - from .tokens.doc cimport Doc from .syntax.parser cimport Parser as LinearParser from .syntax.nn_parser cimport Parser as NeuralParser diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 4043d6dd3..459c94463 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -38,13 +38,9 @@ from preshed.maps cimport MapStruct from preshed.maps cimport map_get from thinc.api import layerize, chain, noop, clone, with_flatten -from thinc.neural._classes.model import Model -from thinc.neural._classes.affine import Affine -from thinc.neural._classes.relu import ReLu -from thinc.neural._classes.maxout import Maxout -from thinc.neural._classes.batchnorm import BatchNorm as BN -from thinc.neural._classes.selu import SELU -from thinc.neural._classes.layernorm import LayerNorm +from thinc.v2v import Model, Maxout, Softmax, Affine, ReLu, SELU +from thinc.misc import LayerNorm + from thinc.neural.ops import NumpyOps, CupyOps from thinc.neural.util import get_array_module