|
|
@ -488,7 +488,7 @@ def _create_vision_transformer(variant, pretrained=False, distilled=False, **kwa
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def vit_small_patch16_224(pretrained=False, **kwargs):
|
|
|
|
def vit_small_patch16_224(pretrained=False, **kwargs):
|
|
|
|
""" My custom 'small' ViT model. Depth=8, heads=8= mlp_ratio=3."""
|
|
|
|
""" My custom 'small' ViT model. Depth=8, heads=8, mlp_ratio=3."""
|
|
|
|
model_kwargs = dict(
|
|
|
|
model_kwargs = dict(
|
|
|
|
patch_size=16, embed_dim=768, depth=8, num_heads=8, mlp_ratio=3.,
|
|
|
|
patch_size=16, embed_dim=768, depth=8, num_heads=8, mlp_ratio=3.,
|
|
|
|
qkv_bias=False, norm_layer=nn.LayerNorm, **kwargs)
|
|
|
|
qkv_bias=False, norm_layer=nn.LayerNorm, **kwargs)
|
|
|
@ -784,4 +784,4 @@ def vit_deit_base_distilled_patch16_384(pretrained=False, **kwargs):
|
|
|
|
model_kwargs = dict(patch_size=16, embed_dim=768, depth=12, num_heads=12, **kwargs)
|
|
|
|
model_kwargs = dict(patch_size=16, embed_dim=768, depth=12, num_heads=12, **kwargs)
|
|
|
|
model = _create_vision_transformer(
|
|
|
|
model = _create_vision_transformer(
|
|
|
|
'vit_deit_base_distilled_patch16_384', pretrained=pretrained, distilled=True, **model_kwargs)
|
|
|
|
'vit_deit_base_distilled_patch16_384', pretrained=pretrained, distilled=True, **model_kwargs)
|
|
|
|
return model
|
|
|
|
return model
|
|
|
|