Skip to content

Commit

Permalink
Update param_groups.py
Browse files Browse the repository at this point in the history
Update lr decay rates for reg tokens
  • Loading branch information
qasfb authored Oct 27, 2023
1 parent e203621 commit d3b77f1
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 d3b77f1

Please sign in to comment.