Skip to content
data

MobileNetConfig

extendsModelConfig
MobileNetConfig(num_classes: int = 1000, in_channels: int = 3, width_mult: float = 1.0, dropout: float = 0.001)

Configuration for MobileNet v1.

width_mult — uniform channel multiplier (α in the paper). 1.0 → full model; 0.75 / 0.5 / 0.25 → slimmer variants.

The paper's second knob, the resolution multiplier ρ, is not a field here: it scales the input image, not the architecture, so a caller applies it by feeding a smaller image. It was previously documented as resolution_mult, which never existed — constructing with it raised TypeError.

dropout — classifier dropout. The paper never mentions dropout; §3.2 only says "we use less regularization ... because small models have less trouble with overfitting". 0.001 is TF-Slim's dropout_keep_prob=0.999 restated as a drop probability, which is what the released model was trained with.

Examples

>>> from lucid.models.vision.mobilenet._config import MobileNetConfig
>>> cfg = MobileNetConfig()
>>> cfg.model_type
'mobilenet'
>>> cfg.num_classes, cfg.in_channels
(1000, 3)

Used by 3