swin_small_cls(pretrained: bool | str = False, weights: SwinSmallWeights | None = None, overrides: object = {})Swin-Small image classifier (Liu et al., 2021).
Combines the swin_small backbone (embed_dim=96,
depths=(2, 2, 18, 2)) with a global average pool plus a linear
classification head. ~50M parameters.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (SwinSmallWeights.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 Swin-S config.
Returns
SwinTransformerForImageClassificationClassifier whose logits has shape (B, num_classes).
Notes
Swin-S reaches 83.0% top-1 on ImageNet-1k (Liu et al., 2021,
Table 1). Pretrained weights are converted from torchvision's
Swin_S_Weights.IMAGENET1K_V1 and hosted under
lucid-dl/swin-small.
Examples
>>> import lucid
>>> from lucid.models.vision.swin import swin_small_cls
>>> model = swin_small_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)