From 1aa5ddf6274cc73d1146d4a86095100a1f176a15 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 31 Dec 2024 13:34:54 -0800 Subject: [PATCH] Update dependencyvit.py --- timm/models/dependencyvit.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/timm/models/dependencyvit.py b/timm/models/dependencyvit.py index 6734466f9..4f297fde5 100644 --- a/timm/models/dependencyvit.py +++ b/timm/models/dependencyvit.py @@ -231,6 +231,7 @@ def __init__( prune_layers: Optional[Union[List[int], Tuple[int]]] = None, prune_ratio: Optional[float] = None, cpe_depth: int = 1, + pos_embed: str = 'none', *args, **kwargs ) -> None: @@ -349,6 +350,12 @@ def dependencyvit_tiny_patch16_224(pretrained: bool = False, **kwargs) -> Depend model_args = dict(patch_size=16, embed_dim=192, depth=12, num_heads=12) model = _create_dependencyvit('dependencyvit_tiny_patch16_224', pretrained=pretrained, **dict(model_args, **kwargs)) return model + +@register_model +def dependencyvit_tiny_cpe1_lpe_patch16_224(pretrained: bool = False, **kwargs) -> DependencyViT: + model_args = dict(patch_size=16, embed_dim=192, depth=12, num_heads=12, pos_embed='learn') + model = _create_dependencyvit('dependencyvit_tiny_patch16_224', pretrained=pretrained, **dict(model_args, **kwargs)) + return model @register_model def dependencyvit_tiny_cpe5_patch16_224(pretrained: bool = False, **kwargs) -> DependencyViT: