This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
Support freezing model anywhere in fine tuning #728
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Add support for freezing the model anywhere in the fine tuning task. Users can specify a specific module to freeze the model until in finetuning. Functionality is useful for situations, like the FixRes paper, where both the head and the last batch norm layer are trained during fine tuning.
Example fblearner run using freeze_until to freeze the trunk model: f259575699
Example fblearner run using freeze_until to unfreeze the last batchnorm and head:
f259575306
freeze_until
to specify what point to freeze the model to. Options arehead
or the name of a module in the model. The model will be frozen until but not including that module and unfrozen at that point onwards.freeze_until: 'head'
has the same functionality asfreeze_trunk: true
.Differential Revision: D27199092