formatting

This commit is contained in:
svlandeg 2020-09-09 11:25:35 +02:00
parent a16afb79e3
commit e39242c4e6
1 changed files with 6 additions and 5 deletions

View File

@ -297,7 +297,8 @@ from spacy.ml import CharacterEmbed
from torch import nn from torch import nn
@spacy.registry.architectures("CustomTorchModel.v1") @spacy.registry.architectures("CustomTorchModel.v1")
def TorchModel(nO: int, def TorchModel(
nO: int,
width: int, width: int,
hidden_width: int, hidden_width: int,
embed_size: int, embed_size: int,
@ -324,19 +325,19 @@ Now you can use this model definition in any existing trainable spaCy component,
by specifying it in the config file: by specifying it in the config file:
```ini ```ini
### config.cfg (excerpt) {highlight="6-6"} ### config.cfg (excerpt) {highlight="5-5"}
[components.tagger] [components.tagger]
factory = "tagger" factory = "tagger"
[components.tagger.model] [components.tagger.model]
@architectures = "CustomTorchModel.v1" @architectures = "CustomTorchModel.v1"
nO = 50 nO = 50
nM = 64
nC = 8
dropout = 0.2
width = 96 width = 96
hidden_width = 48 hidden_width = 48
embed_size = 2000 embed_size = 2000
nM = 64
nC = 8
dropout = 0.2
``` ```
In this configuration, we pass all required parameters for the various In this configuration, we pass all required parameters for the various