Add comment why we moved finish_update to a separate loop

This commit is contained in:
Daniël de Kok 2023-02-03 14:23:04 +01:00
parent 6357d62ca2
commit ef709de8ca

View File

@ -1168,6 +1168,9 @@ class Language:
examples,
):
eg.predicted = doc
# Only finish the update after all component updates are done. Some
# components may share weights (such as tok2vec) and we only want
# to apply weight updates after all gradients are accumulated.
for name, proc in self.pipeline:
if (
name not in exclude