swin_base_cls(pretrained: bool | str = False, weights: SwinBaseWeights | None = None, overrides: object = {})Swin-Base image classifier (Liu et al., 2021).
Combines the swin_base backbone (embed_dim=128,
depths=(2, 2, 18, 2)) with a global average pool plus a linear
classification head. Final feature width is . ~88M parameters.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (SwinBaseWeights.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-B config.
Returns
SwinTransformerForImageClassificationClassifier whose logits has shape (B, num_classes).
Notes
Swin-B reaches 83.5% top-1 on ImageNet-1k (224x224) and
86.4% top-1 at 384x384 after ImageNet-22k pretraining (Liu
et al., 2021, Tables 1 and 2). The shipped checkpoint is converted
from torchvision's Swin_B_Weights.IMAGENET1K_V1 and hosted under
lucid-dl/swin-base.
Examples
>>> import lucid
>>> from lucid.models.vision.swin import swin_base_cls
>>> model = swin_base_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)