From 000aa083f96b20b09a7b3579a563e8a45d952cef Mon Sep 17 00:00:00 2001 From: thomashacker Date: Fri, 27 Jan 2023 14:05:22 +0100 Subject: [PATCH] Adjsut example in docs --- website/docs/api/language.mdx | 6 ++++-- website/docs/api/pipe.mdx | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/website/docs/api/language.mdx b/website/docs/api/language.mdx index aea8e51bd..9831030d4 100644 --- a/website/docs/api/language.mdx +++ b/website/docs/api/language.mdx @@ -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 | diff --git a/website/docs/api/pipe.mdx b/website/docs/api/pipe.mdx index e5b33e50d..744186e18 100644 --- a/website/docs/api/pipe.mdx +++ b/website/docs/api/pipe.mdx @@ -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 |