You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Implements functions to avoid optimizing certain parameters
Authors
* Titouan Parcollet 2023
"""
defrm_vector_weight_decay(modules):
"""Put vectors in a parameter group without weight decay
Takes in a list of modules and separates their parameters into two parameter groups,
which can be passed to a PyTorch Optimizer class. Vector parameters get weight_decay overridden to zero.
This is particularly useful for biases and norms, which we expect to deviate from zero. Other vectors as parameters are also likely not meant to be pushed toward zero.
Arguments
---------
modules : torch.ModuleList, torch.Module
Torch modules to operate on
Returns
-------
list
The parameter groups in the Pytorch Optimizer specification format.