Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze #75

Merged
merged 15 commits into from
Aug 2, 2022
Merged

Freeze #75

merged 15 commits into from
Aug 2, 2022

Conversation

PososikTeam
Copy link
Collaborator

No description provided.

@Animatory
Copy link
Collaborator

Animatory commented Jul 28, 2022

@VladVin VladVin added the enhancement New feature or request label Jul 28, 2022
@VladVin VladVin linked an issue Jul 28, 2022 that may be closed by this pull request
# Create callbacks
callbacks_config = train_config.callbacks
if callbacks_config is not None and len(callbacks_config) != 0:
callbacks = callbacks if callbacks is not None else []
Copy link
Collaborator

@Animatory Animatory Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callbacks = callbacks or None

"""
# Get all module names from self._epoch2module_names
freeze_module_names = []
for _, module_names in self._epoch2module_names.items():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for module_names in self._epoch2module_names.values():

def freeze_before_training(self, pl_module: nn.Module):
"""Freeze modules befor training.

Freeze all the modules which names in self._epoch2module_names.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Freeze all the modules named in self._epoch2module_names.

"""Init FreezeUnfreeze.

Args:
epoch2module_names: Dictionary for incremental unfreeze. Keys - epoch for unfreeze, values - module names
Copy link
Collaborator

@Animatory Animatory Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epoch2module_names: Incremental unfreeze dictionary. Keys - unfreeze epoch, values - module names to unfreeze. By default, all the modules named in this dictionary will be frozen before training


not_found_modules = module_names - found_module_names
if len(not_found_modules) != 0:
logging.warning(f'Get modules_by_names function, can`t found modules with names = {not_found_modules}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_modules_by_names function can`t find modules with names {not_found_modules}

@Animatory Animatory merged commit ad850da into dev Aug 2, 2022
@Animatory Animatory deleted the feature-freeze-unfreeze branch August 2, 2022 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incremental model unfreeze
3 participants