mobilenet_v2(pretrained: bool = False, overrides: object = {})MobileNet-v2 backbone at width multiplier .
Builds a MobileNetV2 with the canonical paper topology
from Sandler et al., 2018 (Table 2): seven inverted-residual
stages with block repeats (1, 2, 3, 4, 3, 3, 1) and channel
progression 16 → 24 → 32 → 64 → 96 → 160 → 320, followed
by a 1×1 head expansion to 1280 channels. Approximately
3.5M parameters and 72.0% ImageNet-1k top-1 accuracy (Table 4).
Model Size
Parameters
pretrainedbool= FalseReserved for future pretrained-weight loading. Currently
ignored — the returned model is randomly initialised.
**overridesobject= {}Keyword overrides forwarded into
MobileNetV2Config
(e.g. in_channels=1 for grayscale input).Returns
MobileNetV2Backbone with the MobileNet-v2 ()
configuration applied (or with overrides merged on top
of it).
Notes
See Sandler et al., "MobileNetV2: Inverted Residuals and Linear Bottlenecks", CVPR 2018 (arXiv:1801.04381), Table 2 and Table 4.
Examples
>>> import lucid
>>> from lucid.models.vision.mobilenet_v2 import mobilenet_v2
>>> model = mobilenet_v2()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape
(1, 1280, 1, 1)