mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-02 02:43:36 +03:00
Adjsut example in docs
This commit is contained in:
parent
05a2f560ad
commit
000aa083f9
|
@ -352,8 +352,10 @@ the "catastrophic forgetting" problem. Please note that `Language.rehearse` need
|
||||||
>
|
>
|
||||||
> ```python
|
> ```python
|
||||||
> optimizer = nlp.resume_training()
|
> optimizer = nlp.resume_training()
|
||||||
> update_losses = nlp.update(examples, sgd=optimizer)
|
> update_losses = nlp.update(examples, sgd=None)
|
||||||
> rehearse_losses = nlp.rehearse(examples, sgd=optimizer)
|
> rehearse_losses = nlp.rehearse(examples, sgd=None)
|
||||||
|
> for name, proc in nlp.pipeline:
|
||||||
|
> proc.finish_update(optimizer)
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|
|
|
@ -251,8 +251,9 @@ the "catastrophic forgetting" problem. Please note that `TrainablePipe.update` n
|
||||||
> ```python
|
> ```python
|
||||||
> pipe = nlp.add_pipe("your_custom_pipe")
|
> pipe = nlp.add_pipe("your_custom_pipe")
|
||||||
> optimizer = nlp.resume_training()
|
> optimizer = nlp.resume_training()
|
||||||
> update_losses = pipe.update(examples, sgd=optimizer)
|
> update_losses = pipe.update(examples, sgd=None)
|
||||||
> rehearse_losses = pipe.rehearse(examples, sgd=optimizer)
|
> rehearse_losses = pipe.rehearse(examples, sgd=None)
|
||||||
|
> pipe.finish_update(optimizer)
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user