pvt_v2_b4_cls(pretrained: bool | str = False, weights: PVTv2B4Weights | None = None, overrides: object = {})PVT v2-B4 image classifier (Wang et al., 2022).
Combines the pvt_v2_b4 backbone with a mean pool + linear
classification head. ~62.6M parameters.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (PVTv2B4Weights.IN1K); 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 on top of the canonical PVT v2-B4 config.
Returns
PVTForImageClassificationClassifier whose logits has shape (B, num_classes).
Notes
PVT v2-B4 reaches 83.6% top-1 on ImageNet-1k at 224x224 (Wang
et al., 2022, Table 1). Pretrained weights are converted from
timm's pvt_v2_b4.in1k and hosted under lucid-dl/pvt-v2-b4.
Examples
>>> import lucid
>>> from lucid.models.vision.pvt import pvt_v2_b4_cls
>>> model = pvt_v2_b4_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)