Skip to content

Commit

Permalink
Update param_groups.py (#283)
Browse files Browse the repository at this point in the history
* Update param_groups.py

Update lr decay rates for reg tokens

* Update param_groups.py
  • Loading branch information
qasfb committed Oct 27, 2023
1 parent e203621 commit ad5a262
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dinov2/utils/param_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def get_vit_lr_decay_rate(name, lr_decay_rate=1.0, num_layers=12, force_is_backb
"""
layer_id = num_layers + 1
if name.startswith("backbone") or force_is_backbone:
if ".pos_embed" in name or ".patch_embed" in name or ".mask_token" in name or ".cls_token" in name:
if ".pos_embed" in name or ".patch_embed" in name or ".mask_token" in name or ".cls_token" in name or ".register_tokens" in name:
layer_id = 0
elif force_is_backbone and (
"pos_embed" in name or "patch_embed" in name or "mask_token" in name or "cls_token" in name
"pos_embed" in name or "patch_embed" in name or "mask_token" in name or "cls_token" in name or "register_tokens" in name
):
layer_id = 0
elif ".blocks." in name and ".residual." not in name:
Expand Down

0 comments on commit ad5a262

Please sign in to comment.