se_resnet_50_cls(pretrained: bool | str = False, weights: SEResNet50Weights | None = None, overrides: object = {})SE-ResNet-50 image classifier (backbone + GAP + linear head).
Builds an SENetForImageClassification with the
SE-ResNet-50 backbone (_SEBottleneck blocks stacked
[3, 4, 6, 3]) followed by global average pooling and a
linear projection to config.num_classes. Approximately
28.1M parameters and 77.6% ImageNet-1k top-1 accuracy in
Hu et al., 2018 (Table 2) — the canonical SE variant.
Model Size
Parameters
pretrainedbool or str= FalseFalse → random init; True
→ the DEFAULT tag (SEResNet50Weights.RA2_IN1K); a
tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).pretrained.**overridesobject= {}SENetConfig
(typically num_classes to retarget the classifier).Returns
SENetForImageClassificationClassifier with the SE-ResNet-50 configuration applied (or
with overrides merged on top of it), optionally
initialised from pretrained weights.
Notes
See Hu et al., "Squeeze-and-Excitation Networks", CVPR 2018
(arXiv:1709.01507), Table 2. Pretrained weights are converted
from timm's seresnet50.ra2_in1k (RandAugment recipe, 78.5
top-1) and hosted on the Hugging Face Hub under
lucid-dl/se-resnet-50.
Examples
>>> import lucid
>>> from lucid.models.vision.senet import se_resnet_50_cls
>>> model = se_resnet_50_cls(num_classes=10)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 10)