MobileNet family of models

This is the API reference for the MobileNet family of models supported by Metalhead.jl.

Metalhead.MobileNetv1Type
MobileNetv1(width_mult::Real = 1; pretrain::Bool = false,
            inchannels::Integer = 3, nclasses::Integer = 1000)

Create a MobileNetv1 model with the baseline configuration (reference).

Arguments

  • width_mult: Controls the number of output feature maps in each block (with 1 being the default in the paper; this is usually a value between 0.1 and 1.4)
  • pretrain: Whether to load the pre-trained weights for ImageNet
  • inchannels: The number of input channels.
  • nclasses: The number of output classes
Warning

MobileNetv1 does not currently support pretrained weights.

See also Metalhead.mobilenetv1.

source
Metalhead.MobileNetv2Type
MobileNetv2(width_mult = 1.0; inchannels::Integer = 3, pretrain::Bool = false,
            nclasses::Integer = 1000)

Create a MobileNetv2 model with the specified configuration. (reference).

Arguments

  • width_mult: Controls the number of output feature maps in each block (with 1 being the default in the paper; this is usually a value between 0.1 and 1.4)
  • pretrain: Whether to load the pre-trained weights for ImageNet
  • inchannels: The number of input channels.
  • nclasses: The number of output classes
Warning

MobileNetv2 does not currently support pretrained weights.

See also Metalhead.mobilenetv2.

source
Metalhead.MobileNetv3Type
MobileNetv3(config::Symbol; width_mult::Real = 1, pretrain::Bool = false,
            inchannels::Integer = 3, nclasses::Integer = 1000)

Create a MobileNetv3 model with the specified configuration. (reference). Set pretrain = true to load the model with pre-trained weights for ImageNet.

Arguments

  • config: :small or :large for the size of the model (see paper).
  • width_mult: Controls the number of output feature maps in each block (with 1 being the default in the paper; this is usually a value between 0.1 and 1.4)
  • pretrain: whether to load the pre-trained weights for ImageNet
  • inchannels: number of input channels
  • nclasses: the number of output classes
Warning

MobileNetv3 does not currently support pretrained weights.

See also Metalhead.mobilenetv3.

source
Metalhead.MNASNetType
MNASNet(config::Symbol; width_mult::Real = 1, pretrain::Bool = false,
        inchannels::Integer = 3, nclasses::Integer = 1000)

Creates a MNASNet model with the specified configuration. (reference)

Arguments

  • config: configuration of the model. One of B1, A1 or small. B1 is without squeeze-and-excite layers, A1 is with squeeze-and-excite layers, and small is a smaller version of A1.
  • width_mult: Controls the number of output feature maps in each block (with 1 being the default in the paper; this is usually a value between 0.1 and 1.4)
  • pretrain: Whether to load the pre-trained weights for ImageNet
  • inchannels: The number of input channels.
  • nclasses: The number of output classes
Warning

MNASNet does not currently support pretrained weights.

See also Metalhead.mnasnet.

source