ResNet-34 feature-extracting backbone (no classification head).
Builds a ResNet with the paper-cited ResNet-34 topology:
_BasicBlock blocks stacked [3, 4, 6, 3] over four
stages, yielding approximately 21.8M parameters. Reaches 73.31%
ImageNet-1k top-1 in He et al., 2015 (Table 4). A good middle
ground when ResNet-18 is too small but ResNet-50's bottleneck
overhead is unwanted.
Model Size
Parameters
pretrainedbool= FalseReserved for future pretrained-weight loading. Currently
ignored.
**overridesobject= {}Keyword overrides forwarded into
ResNetConfig to
customise individual fields without writing a config by hand.Returns
ResNetBackbone with the ResNet-34 configuration applied (or with
overrides merged on top of it).
Notes
See He et al., "Deep Residual Learning for Image Recognition", CVPR 2016 (arXiv:1512.03385), Table 1. Like ResNet-18 this variant uses two-layer residual blocks, so the final-stage output is 512 channels (not 2048 as in the bottleneck variants).
Examples
>>> import lucid
>>> from lucid.models.vision.resnet import resnet_34
>>> model = resnet_34()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape # (B, 512, H/32, W/32)
(1, 512, 7, 7)