Added more info to docs

This commit is contained in:
thomashacker 2023-01-19 13:33:49 +01:00
parent ab316c74ad
commit 2bb8db88f8
2 changed files with 6 additions and 4 deletions

View File

@ -346,13 +346,14 @@ and custom registered functions if needed. See the
Perform a "rehearsal" update from a batch of data. Rehearsal updates teach the Perform a "rehearsal" update from a batch of data. Rehearsal updates teach the
current model to make predictions similar to an initial model, to try to address current model to make predictions similar to an initial model, to try to address
the "catastrophic forgetting" problem. Please note that this function needs to be used together with `Language.update`. This feature is experimental. the "catastrophic forgetting" problem. Please note that `Language.rehearse` needs to be used together with `Language.update`. This feature is experimental.
> #### Example > #### Example
> >
> ```python > ```python
> optimizer = nlp.resume_training() > optimizer = nlp.resume_training()
> losses = nlp.rehearse(examples, sgd=optimizer) > update_losses = nlp.update(examples, sgd=optimizer)
> rehearse_losses = nlp.rehearse(examples, sgd=optimizer)
> ``` > ```
| Name | Description | | Name | Description |

View File

@ -244,14 +244,15 @@ predictions and gold-standard annotations, and update the component's model.
Perform a "rehearsal" update from a batch of data. Rehearsal updates teach the Perform a "rehearsal" update from a batch of data. Rehearsal updates teach the
current model to make predictions similar to an initial model, to try to address current model to make predictions similar to an initial model, to try to address
the "catastrophic forgetting" problem. Please note that this function needs to be used together with `TrainablePipe.update`. This feature is experimental. the "catastrophic forgetting" problem. Please note that `TrainablePipe.update` needs to be used together with `TrainablePipe.update`. This feature is experimental.
> #### Example > #### Example
> >
> ```python > ```python
> pipe = nlp.add_pipe("your_custom_pipe") > pipe = nlp.add_pipe("your_custom_pipe")
> optimizer = nlp.resume_training() > optimizer = nlp.resume_training()
> losses = pipe.rehearse(examples, sgd=optimizer) > update_losses = pipe.update(examples, sgd=optimizer)
> rehearse_losses = pipe.rehearse(examples, sgd=optimizer)
> ``` > ```
| Name | Description | | Name | Description |