mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-25 03:13:41 +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
|
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 |
|
||||||
|
|
|
@ -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 |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user