SK-ResNet-18 feature-extracting backbone (no classification head).
Builds an SKNet with ResNet-18 topology
(_SelectiveKernelBasic blocks stacked [2, 2, 2, 2]).
Both convolutions inside every block are
replaced by Selective Kernel units, giving full SK treatment
of the basic-block design. Approximately 24.7M parameters.
Model Size
Parameters
pretrainedbool= Falsesk_resnet_18, so True raises
NotImplementedError rather than return randomly initialised weights.
sk_resnet_18_cls is the checkpointed variant.**overridesobject= {}SKNetConfig.Returns
SKNetBackbone with the SK-ResNet-18 configuration applied (or
with overrides merged on top of it).
Notes
See Li et al., "Selective Kernel Networks", CVPR 2019
(arXiv:1903.06586). _CFG_SK18 uses rd_ratio = 1/8,
rd_divisor = 16 and split_input = True, so each branch
receives half the input. Only the first of
each basic block is a Selective Kernel unit — the second stays a
plain conv-BN-act (see _SelectiveKernelBasic). ~11.5M
parameters.
Examples
>>> import lucid
>>> from lucid.models.vision.sknet import sk_resnet_18
>>> model = sk_resnet_18()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape
(1, 512, 7, 7)