mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Expose the softmax layer in the tagger model, to allow setting tensors
This commit is contained in:
parent
b30dd36179
commit
b3264aa5f0
|
@ -409,12 +409,14 @@ def build_tagger_model(nr_class, **cfg):
|
||||||
else:
|
else:
|
||||||
tok2vec = Tok2Vec(token_vector_width, embed_size,
|
tok2vec = Tok2Vec(token_vector_width, embed_size,
|
||||||
pretrained_dims=pretrained_dims)
|
pretrained_dims=pretrained_dims)
|
||||||
|
softmax = with_flatten(Softmax(nr_class, token_vector_width))
|
||||||
model = (
|
model = (
|
||||||
tok2vec
|
tok2vec
|
||||||
>> with_flatten(Softmax(nr_class, token_vector_width))
|
>> softmax
|
||||||
)
|
)
|
||||||
model.nI = None
|
model.nI = None
|
||||||
model.tok2vec = tok2vec
|
model.tok2vec = tok2vec
|
||||||
|
model.softmax
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user