mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-25 11:23:40 +03:00
Added more info to docs
This commit is contained in:
parent
ab316c74ad
commit
2bb8db88f8
|
@ -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
|
||||
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
|
||||
>
|
||||
> ```python
|
||||
> 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 |
|
||||
|
|
|
@ -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
|
||||
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
|
||||
>
|
||||
> ```python
|
||||
> pipe = nlp.add_pipe("your_custom_pipe")
|
||||
> 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 |
|
||||
|
|
Loading…
Reference in New Issue
Block a user