se_resnet_18_cls(pretrained: bool | str = False, weights: SEResNet18Weights | None = None, overrides: object = {})SE-ResNet-18 image classifier (backbone + GAP + linear head).
Builds an SENetForImageClassification with the
SE-ResNet-18 backbone (_SEBasicBlock blocks stacked
[2, 2, 2, 2]) followed by global average pooling and a
linear projection to config.num_classes (default 1000 for
ImageNet-1k). Approximately 11.8M parameters.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (SEResNet18Weights.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
SENetConfig.Returns
SENetForImageClassificationClassifier with the SE-ResNet-18 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 legacy_seresnet18.in1k and hosted on the Hugging
Face Hub under lucid-dl/se-resnet-18.
Examples
>>> import lucid
>>> from lucid.models.vision.senet import se_resnet_18_cls
>>> model = se_resnet_18_cls(num_classes=10)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 10)