resnest_50_cls(pretrained: bool | str = False, weights: ResNeSt50Weights | None = None, overrides: object = {})ResNeSt-50 image classifier (backbone + GAP + linear head).
Builds a ResNeStForImageClassification with the
canonical ResNeSt-50 backbone ([3, 4, 6, 3], radix = 2)
followed by global average pooling and a linear projection.
Approximately 27.5M parameters and 81.1% ImageNet-1k top-1
accuracy in Zhang et al., 2022 (Table 4) — the canonical
ResNeSt configuration.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (ResNeSt50Weights.IN1K); 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 forwarded into
ResNeStConfig
(typically num_classes to retarget the classifier).Returns
ResNeStForImageClassificationClassifier with the ResNeSt-50 configuration applied (or
with overrides merged on top of it).
Notes
See Zhang et al., "ResNeSt: Split-Attention Networks", CVPR
Workshops 2022 (arXiv:2004.08955), Table 4. Pretrained weights are
converted from timm's resnest50d.in1k and hosted under
lucid-dl/resnest-50.
Examples
>>> import lucid
>>> from lucid.models.vision.resnest import resnest_50_cls
>>> model = resnest_50_cls(num_classes=10)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 10)