Freezing tok2vec vs unfreezing tok2vec while updating pre-trained model #12518
-
I took a blank model and trained that (
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Hi!
If you have a
This will basically ensure that the component runs during training but isn't backpropagated into - i.e. it won't update as long as it's (also) in the frozen components list.
That's a good question with a somewhat complex answer but that might help you better understand what's going on. You can see the configuration of the models in the config file of
But the
In those cases (like in your original case), when you're using the listener mechanism for the The
This means that if you freeze the whole pipeline except for the NER, you're actually still (re)training the internal More background information on those two different patterns can be found here: https://spacy.io/usage/embeddings-transformers; it's basically the difference between having a "shared" Tok2Vec layer or an independent one - the first is a separate component by itself, the second is an independent layer within the model of another component. |
Beta Was this translation helpful? Give feedback.
Hi!
If you have a
tok2vec
component in the pipeline that you want to freeze but you also want to continue training other components on top of it, then you should add thistok2vec
component to theannotating_components
section in your config:This will basically ensure that the component runs during training but isn't backpropagated into - i.e. it won't update as long as it's (also) in the frozen components list.