vit_base_32_cls(pretrained: bool | str = False, weights: ViTBase32Weights | None = None, overrides: object = {})ViT-Base/32 image classifier (Dosovitskiy et al., 2020).
Combines the vit_base_32 backbone (dim=768, depth=12,
num_heads=12, patch size 32) with a linear classification head on
the CLS token. The /32 patching yields a 49-token sequence,
making this the cheapest ViT-Base classifier.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (ViTBase32Weights.IMAGENET1K_V1); a
tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).Explicit weights enum member. Takes precedence over
pretrained.**overridesobject= {}Keyword overrides on top of the canonical ViT-Base/32 config.
Returns
ViTForImageClassificationClassifier whose logits has shape (B, num_classes).
Notes
Reference: Dosovitskiy et al. (2020), Table 1. Pretrained weights are
converted from torchvision's ViT_B_32_Weights.IMAGENET1K_V1
(75.912% top-1) and hosted under lucid-dl/vit-base-32.
Examples
>>> import lucid
>>> from lucid.models.vision.vit import vit_base_32_cls
>>> model = vit_base_32_cls(num_classes=10)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 10)