MCPcopy Create free account
hub / github.com/geekcomputers/Python / VisionTransformer

Function VisionTransformer

ML/src/python/neuralforge/models/vit.py:4–24  ·  view source on GitHub ↗
(
    img_size=224,
    patch_size=16,
    in_channels=3,
    num_classes=1000,
    embed_dim=768,
    depth=12,
    num_heads=12,
    mlp_ratio=4.0,
    dropout=0.1
)

Source from the content-addressed store, hash-verified

2from ..nn.attention import VisionTransformerBlock
3
4def VisionTransformer(
5 img_size=224,
6 patch_size=16,
7 in_channels=3,
8 num_classes=1000,
9 embed_dim=768,
10 depth=12,
11 num_heads=12,
12 mlp_ratio=4.0,
13 dropout=0.1
14):
15 return VisionTransformerBlock(
16 img_size=img_size,
17 patch_size=patch_size,
18 in_channels=in_channels,
19 embed_dim=embed_dim,
20 num_heads=num_heads,
21 num_layers=depth,
22 num_classes=num_classes,
23 dropout=dropout
24 )

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected