mobilenet_v1_cls(pretrained: bool | str = False, weights: MobileNetV1Weights | None = None, overrides: object = {})MobileNet-v1 image classifier at width multiplier .
Builds a MobileNetV1ForImageClassification with the
canonical paper topology (13 depthwise+pointwise blocks) followed
by global average pooling and a linear projection to
config.num_classes (default 1000 for ImageNet-1k).
Approximately 4.2M parameters and 70.6% ImageNet-1k top-1 in
Howard et al., 2017 (Table 7).
Model Size
Parameters
pretrainedbool or str= FalseFalse → random init; True
→ the DEFAULT tag (MobileNetV1Weights.RA4_E3600_R224_IN1K);
a tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).pretrained.**overridesobject= {}MobileNetV1Config
(typically num_classes to retarget the classifier).Returns
MobileNetV1ForImageClassificationClassifier with the MobileNet-v1 ()
configuration applied (or with overrides merged on top
of it).
Notes
See Howard et al., "MobileNets: Efficient Convolutional Neural
Networks for Mobile Vision Applications", arXiv:1704.04861, 2017,
Table 7. Pretrained weights are converted from timm's
mobilenetv1_100.ra4_e3600_r224_in1k (75.4% top-1 at 224x224
under the RA4 recipe) and hosted under lucid-dl/mobilenet-v1.
Examples
>>> import lucid
>>> from lucid.models.vision.mobilenet import mobilenet_v1_cls
>>> model = mobilenet_v1_cls(num_classes=10)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 10)