Add ViT-H (#2)

pull/509/head
Han Chong 2024-10-03 15:06:50 +08:00 committed by GitHub
parent 18ef3c8f7e
commit 5917521c34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -405,6 +405,20 @@ def vit_large(patch_size=16, num_register_tokens=0, **kwargs):
return model
def vit_huge(patch_size=16, num_register_tokens=0, **kwargs):
model = DinoVisionTransformer(
patch_size=patch_size,
embed_dim=1280,
depth=32,
num_heads=16,
mlp_ratio=4,
block_fn=partial(Block, attn_class=MemEffAttention),
num_register_tokens=num_register_tokens,
**kwargs,
)
return model
def vit_giant2(patch_size=16, num_register_tokens=0, **kwargs):
"""
Close to ViT-giant, with embed-dim 1536 and 24 heads => embed-dim per head 64