Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Labatut committed Oct 27, 2023
1 parent ad5a262 commit da4b382
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dinov2/utils/param_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ 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 or ".register_tokens" 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 or "register_tokens" 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 da4b382

Please sign in to comment.