Adjsut example in docs

This commit is contained in:
thomashacker 2023-01-27 14:05:22 +01:00
parent 05a2f560ad
commit 000aa083f9
2 changed files with 7 additions and 4 deletions

View File

@ -352,8 +352,10 @@ the "catastrophic forgetting" problem. Please note that `Language.rehearse` need
>
> ```python
> optimizer = nlp.resume_training()
> update_losses = nlp.update(examples, sgd=optimizer)
> rehearse_losses = nlp.rehearse(examples, sgd=optimizer)
> update_losses = nlp.update(examples, sgd=None)
> rehearse_losses = nlp.rehearse(examples, sgd=None)
> for name, proc in nlp.pipeline:
> proc.finish_update(optimizer)
> ```
| Name | Description |

View File

@ -251,8 +251,9 @@ the "catastrophic forgetting" problem. Please note that `TrainablePipe.update` n
> ```python
> pipe = nlp.add_pipe("your_custom_pipe")
> optimizer = nlp.resume_training()
> update_losses = pipe.update(examples, sgd=optimizer)
> rehearse_losses = pipe.rehearse(examples, sgd=optimizer)
> update_losses = pipe.update(examples, sgd=None)
> rehearse_losses = pipe.rehearse(examples, sgd=None)
> pipe.finish_update(optimizer)
> ```
| Name | Description |