Pass optimizer defined in config to resume/begin_training

Otherwise, this would create a default optimizer, which isn't what we want?
This commit is contained in:
Ines Montani 2020-08-14 14:59:22 +02:00
parent e4d0990857
commit ab1d165bba

View File

@ -102,9 +102,9 @@ def train(
if resume_components: if resume_components:
with nlp.select_pipes(enable=resume_components): with nlp.select_pipes(enable=resume_components):
msg.info(f"Resuming training for: {resume_components}") msg.info(f"Resuming training for: {resume_components}")
nlp.resume_training() nlp.resume_training(sgd=optimizer)
with nlp.select_pipes(disable=[*frozen_components, *resume_components]): with nlp.select_pipes(disable=[*frozen_components, *resume_components]):
nlp.begin_training(lambda: train_corpus(nlp)) nlp.begin_training(lambda: train_corpus(nlp), sgd=optimizer)
if tag_map: if tag_map:
# Replace tag map with provided mapping # Replace tag map with provided mapping