ResNeSt¶
ConvNet
- class lucid.models.ResNeSt(config: ResNeStConfig)¶
The ResNeSt class extends the residual bottleneck design with split-attention convolutions and a deep stem. Its structure is described by ResNeStConfig, which captures the stage depths together with radix, cardinality, base width, and other backbone options used by the ResNeSt family.
Class Signature¶
class ResNeSt(ResNet):
def __init__(self, config: ResNeStConfig)
Parameters¶
config (ResNeStConfig): Configuration object describing the stage depths, split-attention settings, classifier size, deep-stem width, and shared residual-stage options.
Attributes¶
config (ResNeStConfig): The configuration used to construct the model.
base_width (int): Width parameter used to compute grouped bottleneck channels.
stem_width (int): Width of the deep stem.
cardinality (int): Number of groups in split-attention bottlenecks.
radix (int): Number of attention splits per grouped bottleneck.
avd (bool): Whether anti-aliasing average downsampling is enabled inside the bottleneck.
Examples¶
>>> import lucid
>>> import lucid.models as models
>>> config = models.ResNeStConfig(
... layers=[3, 4, 6, 3],
... base_width=40,
... stem_width=32,
... cardinality=2,
... radix=4,
... num_classes=10,
... )
>>> model = models.ResNeSt(config)
>>> output = model(lucid.zeros(1, 3, 224, 224))
>>> print(output.shape)
(1, 10)
Note
ResNeSt always uses a deep stem internally.
Factory helpers such as resnest_50 and resnest_50_4s2x40d provide the historical presets.