swin_tiny(pretrained: bool = False, overrides: object = {})Swin-Tiny backbone (Liu et al., 2021).
Builds the canonical Swin-T configuration: embed_dim=96,
depths=(2, 2, 6, 2), num_heads=(3, 6, 12, 24),
window_size=7. With the default 224x224 input the trunk
produces a feature after the final stage's
map is globally pooled. Approximately
28M parameters.
Model Size
Parameters
pretrainedbool= FalseIf
True, loads ImageNet-1k pretrained weights when available
in the model zoo. Defaults to False (random initialization).**overridesobject= {}Keyword overrides applied on top of the canonical Swin-T config.
Common examples:
image_size=384, in_channels=1,
window_size=12. Each override must match a field of
SwinConfig.Returns
SwinTransformerA SwinTransformer backbone returning a flat
feature.
Notes
Swin-T reaches 81.3% top-1 / 95.5% top-5 on ImageNet-1k (Liu et al., 2021, Table 1). See arXiv:2103.14030.
Examples
>>> import lucid
>>> from lucid.models.vision.swin import swin_tiny
>>> model = swin_tiny()
>>> x = lucid.randn(1, 3, 224, 224)
>>> feat = model.forward_features(x)
>>> feat.shape
(1, 768)