  
      def begin_training(self, get_examples=lambda: [], pipeline=None,
                          tok2vec=None, sgd=None, **kwargs):
          link_vectors_to_models(self.vocab)
          if self.model is True:
              self.model = self.Model(self.vocab, tok2vec)
          X = self.model.ops.alloc((5, self.model.get_ref("tok2vec").get_dim("nO")))
          self.model.initialize()
          self.model.output_layer.begin_training(X)
          if sgd is None:
              sgd = self.create_optimizer()
          return sgd
 
</s> remove         self.cfg["entity_width"] = self.kb.entity_vector_length
        if self.model is True:
            self.model = self.Model(**self.cfg)
 </s> add         nO = self.kb.entity_vector_length
        self.set_output(nO) </s> remove         if self.model is True:
            for hp in ["token_vector_width", "conv_depth"]:
                if hp in kwargs:
                    self.cfg[hp] = kwargs[hp]
            self.model = self.Model(len(self.labels), **self.cfg)
 </s> add         self.set_output(len(self.labels))
        self.model.initialize() </s> remove         if self.model is True:
            self.cfg.update(kwargs)
            self.require_labels()
            self.model = self.Model(len(self.labels), **self.cfg)
            link_vectors_to_models(self.vocab)
 </s> add         self.require_labels()
        docs = [Doc(Vocab(), words=["hello"])]
        truths, _ = self._examples_to_truth(examples)
        self.set_output(len(self.labels))
        self.model.initialize(X=docs, Y=truths) </s> remove         if self.model is True:
            self.model = self.Model(**self.cfg)
 </s> add         self.model.initialize()
  
      def begin_training(self, get_examples=lambda: [], pipeline=None,
                          tok2vec=None, sgd=None, **kwargs):
          link_vectors_to_models(self.vocab)



          self.model.initialize()
          self.model.output_layer.begin_training(X)
          if sgd is None:
              sgd = self.create_optimizer()
          return sgd
keep keep keep keep replace replace replace keep keep keep keep keep
 Default settings to configurations (#4995)

* fix grad_clip naming

* cleaning up pretrained_vectors out of cfg

* further refactoring Model init's

* move Model building out of pipes

* further refactor to require a model config when creating a pipe

* small fixes

* making cfg in nn_parser more consistent

* fixing nr_class for parser

* fixing nn_parser's nO

* fix printing of loss

* architectures in own file per type, consistent naming

* convenience methods default_tagger_config and default_tok2vec_config

* let create_pipe access default config if available for that component

* default_parser_config

* move defaults to separate folder

* allow reading nlp from package or dir with argument 'name'

* architecture spacy.VocabVectors.v1 to read static vectors from file

* cleanup

* default configs for nel, textcat, morphologizer, tensorizer

* fix imports

* fixing unit tests

* fixes and clean up

* fixing defaults, nO, fix unit tests

* restore parser IO

* fix IO

* 'fix' serialization test

* add *.cfg to manifest

* fix example configs with additional arguments

* replace Morpohologizer with Tagger

* add IO bit when testing overfitting of tagger (currently failing)

* fix IO - don't initialize when reading from disk

* expand overfitting tests to also check IO goes OK

* remove dropout from HashEmbed to fix Tagger performance

* add defaults for sentrec

* update thinc

* always pass a Model instance to a Pipe

* fix piped_added statement

* remove obsolete W029

* remove obsolete errors

* restore byte checking tests (work again)

* clean up test

* further test cleanup

* convert from config to Model in create_pipe

* bring back error when component is not initialized

* cleanup

* remove calls for nlp2.begin_training

* use thinc.api in imports

* allow setting charembed's nM and nC

* fix for hardcoded nM/nC + unit test

* formatting fixes

* trigger build 
spacy/pipeline/pipes.pyx