vgg_16_cls(pretrained: bool | str = False, weights: VGG16Weights | None = None, overrides: object = {})VGG-16 image classifier (config D, no BatchNorm).
Builds a VGGForImageClassification with the paper-cited
VGG-16 topology (arch=(2, 2, 3, 3, 3)) followed by the standard
4096 → 4096 → num_classes FC head. Approximately 138.4 M
parameters total and a top-1 ImageNet validation accuracy of 71.59%
(torchvision eval) — the most widely used VGG variant.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (VGG16Weights.IMAGENET1K_V1); a
tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).Explicit weights enum member. Takes precedence over
pretrained.**overridesobject= {}Keyword overrides forwarded into
VGGConfig.Returns
VGGForImageClassificationClassifier with the VGG-16 configuration applied (or with
overrides merged on top of it), optionally initialised from
pretrained weights.
Notes
Pretrained weights are converted from torchvision's VGG16_Weights
and hosted on the Hugging Face Hub under lucid-dl/vgg-16.
Examples
>>> import lucid
>>> from lucid.models.vision.vgg import vgg_16_cls
>>> model = vgg_16_cls(pretrained=True)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 1000)