def resume_training(self, sgd=None, **cfg):
if cfg.get("<STR_LIT>", -<NUM_LIT:1>) >= <NUM_LIT:0>:<EOL><INDENT>util.use_gpu(cfg["<STR_LIT>"])<EOL>if self.vocab.vectors.data.shape[<NUM_LIT:1>] >= <NUM_LIT:1>:<EOL><INDENT>self.vocab.vectors.data = Model.ops.asarray(self.vocab.vectors.data)<EOL><DEDENT><DEDENT>link_vectors_to_models(self.vocab)<EOL>if self.vocab.vectors.data.shape[<NUM_LIT:1>]:<EOL><INDENT>cfg["<STR_LIT>"] = self.vocab.vectors.name<EOL><DEDENT>if sgd is None:<EOL><INDENT>sgd = create_default_optimizer(Model.ops)<EOL><DEDENT>self._optimizer = sgd<EOL>for name, proc in self.pipeline:<EOL><INDENT>if hasattr(proc, "<STR_LIT>"):<EOL><INDENT>proc._rehearsal_model = deepcopy(proc.model)<EOL><DEDENT><DEDENT>return self._optimizer<EOL>
Continue training a pre-trained model.

        Create and return an optimizer, and initialize "rehearsal" for any pipeline
        component that has a .rehearse() method. Rehearsal is used to prevent
        models from "forgetting" their initialised "knowledge". To perform
        rehearsal, collect samples of text you want the models to retain performance
        on, and call nlp.rehearse() with a batch of Doc objects.