swin_base(pretrained: bool = False, overrides: object = {})Swin-Base backbone (Liu et al., 2021).
Builds the canonical Swin-B configuration: embed_dim=128,
depths=(2, 2, 18, 2), num_heads=(4, 8, 16, 32). Same depth
as Swin-S but ~33% wider per stage; final feature dimension is
. Approximately 88M parameters.
Model Size
Parameters
pretrainedbool= FalseIf
True, loads ImageNet-1k or ImageNet-22k pretrained
weights when available. Defaults to False.**overridesobject= {}Keyword overrides on top of the canonical Swin-B config.
Returns
SwinTransformerA SwinTransformer backbone returning a flat
feature.
Notes
Swin-B reaches 83.5% top-1 on ImageNet-1k (224x224) and 86.4% top-1 when fine-tuned at 384x384 after ImageNet-22k pretraining (Liu et al., 2021, Tables 1 and 2).
Examples
>>> import lucid
>>> from lucid.models.vision.swin import swin_base
>>> model = swin_base()
>>> x = lucid.randn(1, 3, 224, 224)
>>> model.forward_features(x).shape
(1, 1024)