Skip to content
fn

efficientformer_l3_cls

→EfficientFormerForImageClassification31.3M
efficientformer_l3_cls(pretrained: bool | str = False, weights: EfficientFormerL3Weights | None = None, overrides: object = {})

EfficientFormer-L3 image classifier (Li et al., 2022).

Combines the efficientformer_l3 backbone (depths= (4, 4, 12, 6), embed_dims=(64, 128, 320, 512)) with a final LayerNorm, mean pool, and a distilled dual head (head + head_dist) averaged at inference. ~31.4M parameters.

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag (EfficientFormerL3Weights.SNAP_DIST_IN1K); a tag string → that specific checkpoint. Mutually exclusive with weights (which wins if both are given).
weights(EfficientFormerL3Weights, optional, keyword - only)= None
Explicit weights enum member. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides on top of the canonical L3 config.

Returns

EfficientFormerForImageClassification

Classifier whose logits has shape (B, num_classes).

Notes

EfficientFormer-L3 reaches 82.4% top-1 on ImageNet-1k (Li et al., 2022, Table 4). Pretrained weights are converted from timm's efficientformer_l3.snap_dist_in1k and hosted under lucid-dl/efficientformer-l3.

Examples

>>> import lucid
>>> from lucid.models.vision.efficientformer import efficientformer_l3_cls
>>> model = efficientformer_l3_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)

Used by 1