VGG-16 with BatchNorm — feature-extracting backbone.
Builds a VGG with the VGG-16 topology
arch=(2, 2, 3, 3, 3) and lucid.nn.BatchNorm2d between
each Conv and its ReLU. 14.72 M parameters without the FC head (vgg_16_bn_cls adds it for 138.4 M). Often
preferred over plain vgg_16 for downstream fine-tuning
because BatchNorm stabilises gradient statistics in the early conv
stack.
Model Size
Parameters
pretrainedbool= FalseNo checkpoint is published for
vgg_16_bn, so True raises
NotImplementedError rather than return randomly initialised weights.
vgg_16_bn_cls is the checkpointed variant.**overridesobject= {}Keyword overrides forwarded into
VGGConfig.Returns
VGGBackbone with the VGG-16-BN configuration applied (or with
overrides merged on top of it).
Examples
>>> import lucid
>>> from lucid.models.vision.vgg import vgg_16_bn
>>> model = vgg_16_bn()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape
(1, 512, 7, 7)