Skip to content
fn

resnext_50_32x4d

→ResNeXt
resnext_50_32x4d(pretrained: bool = False, overrides: object = {})

ResNeXt-50 (32x4d) feature-extracting backbone.

Builds a ResNeXt with the paper-cited ResNeXt-50 (32x4d) topology: per-stage block counts (3, 4, 6, 3) (same as ResNet-50), cardinality C=32C = 32, width per group d=4d = 4. 23.0 M parameters without a classifier head (resnext_50_32x4d_cls adds 2.05 M more for the 1000-way head, reaching the 25.0 M the paper quotes) — within roughly 1% of ResNet-50's budget while achieving ≈1pp higher ImageNet top-1 accuracy (77.8%, i.e. the 22.2% top-1 error Xie et al., 2017 report for this configuration).

Model Size

Parameters

pretrainedbool= False
No checkpoint is published for resnext_50_32x4d, so True raises NotImplementedError rather than return randomly initialised weights. resnext_50_32x4d_cls is the checkpointed variant.
**overridesobject= {}
Keyword overrides forwarded into ResNeXtConfig to customise in_channels, num_classes, cardinality, width_per_group, or dropout.

Returns

ResNeXt

Backbone with the ResNeXt-50 (32x4d) configuration applied (or with overrides merged on top of it).

Notes

See Xie et al., "Aggregated Residual Transformations for Deep Neural Networks", CVPR 2017, Table 1. The 32x4d shorthand encodes C×dC \times d — cardinality times width-per-group. Final-stage output is 2048 channels.

Examples

>>> import lucid
>>> from lucid.models.vision.resnext import resnext_50_32x4d
>>> model = resnext_50_32x4d()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape   # (B, 2048, 7, 7)
(1, 2048, 7, 7)

Used by 1