Fix regression in parser.begin_training()

This commit is contained in:
Matthew Honnibal 2018-09-25 11:08:31 +02:00
parent 1759abf1e5
commit 500898907b
2 changed files with 2 additions and 4 deletions

View File

@ -213,8 +213,7 @@ class ParserModel(Model):
self._layers[-1]._layers[-1] = larger
def begin_training(self, X, y=None):
for layer in self._layers:
layer.begin_training(X, y=y)
self.lower.begin_training(X, y=y)
@property
def tok2vec(self):

View File

@ -525,8 +525,7 @@ cdef class Parser:
else:
if sgd is None:
sgd = self.create_optimizer()
self.model.begin_training(
self.model.ops.allocate((5, cfg['token_vector_width'])))
self.model.begin_training([])
self.cfg.update(cfg)
return sgd