swin_tiny_cls(pretrained: bool | str = False, weights: SwinTinyWeights | None = None, overrides: object = {})Swin-Tiny image classifier (Liu et al., 2021).
Combines the swin_tiny backbone with a global average pool
- single
nn.Linearclassification head. Default output isnum_classes=1000(ImageNet-1k). Approximately 28M parameters for the 1000-class head.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (SwinTinyWeights.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-T config.
Commonly used:
num_classes to switch label space,
image_size to fine-tune at a different resolution.Returns
SwinTransformerForImageClassificationClassifier returning ImageClassificationOutput whose
logits has shape (B, num_classes).
Notes
Swin-T reaches 81.3% top-1 on ImageNet-1k (Liu et al., 2021).
Pretrained weights are converted from torchvision's
Swin_T_Weights.IMAGENET1K_V1 and hosted under
lucid-dl/swin-tiny.
Examples
>>> import lucid
>>> from lucid.models.vision.swin import swin_tiny_cls
>>> model = swin_tiny_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(1, 1000)