-
Notifications
You must be signed in to change notification settings - Fork 6
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
Freeze #75
Conversation
torchok/constructor/runner.py
Outdated
# 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 [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callbacks = callbacks or None
torchok/callbacks/freeze_unfreeze.py
Outdated
""" | ||
# Get all module names from self._epoch2module_names | ||
freeze_module_names = [] | ||
for _, module_names in self._epoch2module_names.items(): |
There was a problem hiding this comment.
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():
torchok/callbacks/freeze_unfreeze.py
Outdated
def freeze_before_training(self, pl_module: nn.Module): | ||
"""Freeze modules befor training. | ||
|
||
Freeze all the modules which names in self._epoch2module_names. |
There was a problem hiding this comment.
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.
torchok/callbacks/freeze_unfreeze.py
Outdated
"""Init FreezeUnfreeze. | ||
|
||
Args: | ||
epoch2module_names: Dictionary for incremental unfreeze. Keys - epoch for unfreeze, values - module names |
There was a problem hiding this comment.
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
torchok/callbacks/freeze_unfreeze.py
Outdated
|
||
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}') |
There was a problem hiding this comment.
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}
No description provided.