cvt_21_cls(pretrained: bool | str = False, weights: CvT21Weights | None = None, overrides: object = {})CvT-21 image classifier (Wu et al., 2021).
Combines the cvt_21 backbone (dims=(64, 192, 384),
depths=(1, 4, 16)) with a mean pool + LayerNorm + linear
classification head. Approximately 31.6M parameters.
Model Size
Parameters
pretrainedbool= FalseIf
True, loads ImageNet-1k pretrained weights when
available. Defaults to False.Explicit weights enum member; takes precedence over
pretrained.**overridesobject= {}Keyword overrides on top of the canonical CvT-21 config.
Returns
CvTForImageClassificationClassifier whose logits has shape (B, num_classes).
Notes
CvT-21 reaches 82.5% top-1 on ImageNet-1k at 224x224 (Wu et al., 2021, Table 1).
Examples
>>> import lucid
>>> from lucid.models.vision.cvt import cvt_21_cls
>>> model = cvt_21_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)