From ad5a262b22a640661aeef80791e875472119cee7 Mon Sep 17 00:00:00 2001 From: qasfb <36480216+qasfb@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:30:19 +0200 Subject: [PATCH] Update param_groups.py (#283) * Update param_groups.py Update lr decay rates for reg tokens * Update param_groups.py --- dinov2/utils/param_groups.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dinov2/utils/param_groups.py b/dinov2/utils/param_groups.py index c8d9a9e2a..72545547f 100644 --- a/dinov2/utils/param_groups.py +++ b/dinov2/utils/param_groups.py @@ -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: