Update docs [ci skip]

This commit is contained in:
Ines Montani 2020-08-19 20:37:54 +02:00
parent 7a8cc64ea8
commit 15e6feed01

View File

@ -484,20 +484,21 @@ still look good.
## Custom Functions {#custom-functions} ## Custom Functions {#custom-functions}
Registered functions in the training config files can refer to built-in Registered functions in the training config files can refer to built-in
implementations, but you can also plug in fully custom implementations. To do implementations, but you can also plug in fully **custom implementations**. All
so, you first write your own implementation of a custom architectures, data you need to do is register your function using the `@spacy.registry` decorator
reader or any other functionality, and then register this function with the with the name of the respective [registry](/api/top-level#registry), e.g.
correct [registry](/api/top-level#registry). This allows you to plug in models `@spacy.registry.architectures`, and a string name to assign to your function.
defined in PyTorch or Tensorflow, make custom modifications to the `nlp` object, Registering custom functions allows you to **plug in models** defined in PyTorch
create custom optimizers or schedules, or write a function that streams in data or TensorFlow, make **custom modifications** to the `nlp` object, create custom
and preprocesses it on the fly while training. optimizers or schedules, or **stream in data** and preprocesses it on the fly
while training.
Each custom function can have any numbers of arguments that should be passed Each custom function can have any numbers of arguments that are passed in via
into them through the config similar as with the built-in functions. If your the [config](#config), just the built-in functions. If your function defines
function defines **default argument values**, spaCy is able to auto-fill your **default argument values**, spaCy is able to auto-fill your config when you run
config when you run [`init fill-config`](/api/cli#init-fill-config). If you want [`init fill-config`](/api/cli#init-fill-config). If you want to make sure that a
to make sure that a given parameter is always explicitely set in the config, given parameter is always explicitely set in the config, avoid setting a default
avoid setting a default value for it. value for it.
<!-- TODO: possibly link to new (not yet created) page on creating models ? --> <!-- TODO: possibly link to new (not yet created) page on creating models ? -->