Other models

This is the API reference for some of the other models supported by Metalhead.jl that do not fit into the other categories.

The higher-level model constructors

Metalhead.AlexNetType
AlexNet(; pretrain::Bool = false, inchannels::Integer = 3,
        nclasses::Integer = 1000)

Create a AlexNet. (reference).

Arguments

  • pretrain: set to true to load pre-trained weights for ImageNet
  • inchannels: The number of input channels.
  • nclasses: the number of output classes
Warning

AlexNet does not currently support pretrained weights.

See also alexnet.

source
Metalhead.VGGType
VGG(imsize::Dims{2}; config, inchannels, batchnorm = false, nclasses, fcsize, dropout_prob)

Construct a VGG model with the specified input image size. Typically, the image size is (224, 224).

Keyword Arguments:

  • config : VGG convolutional block configuration. It is defined as a vector of tuples (output_channels, num_convolutions) for each block
  • inchannels: number of input channels
  • batchnorm: set to true to use batch normalization after each convolution
  • nclasses: number of output classes
  • fcsize: intermediate fully connected layer size (see Metalhead.vgg_classifier_layers)
  • dropout_prob: dropout level between fully connected layers
source
Metalhead.SqueezeNetType
SqueezeNet(; pretrain::Bool = false, inchannels::Integer = 3,
           nclasses::Integer = 1000)

Create a SqueezeNet (reference).

Arguments

  • pretrain: set to true to load the pre-trained weights for ImageNet
  • inchannels: number of input channels.
  • nclasses: the number of output classes.

See also squeezenet.

source

The mid-level functions

Metalhead.alexnetFunction
alexnet(; dropout_prob = 0.5, inchannels::Integer = 3, nclasses::Integer = 1000)

Create an AlexNet model (reference).

Arguments

  • dropout_prob: dropout probability for the classifier
  • inchannels: The number of input channels.
  • nclasses: the number of output classes
source
Metalhead.vggFunction
vgg(imsize; config, inchannels, batchnorm = false, nclasses, fcsize, dropout_prob)

Create a VGG model (reference).

Arguments

  • imsize: input image width and height as a tuple
  • config: the configuration for the convolution layers (see Metalhead.vgg_convolutional_layers)
  • inchannels: number of input channels
  • batchnorm: set to true to use batch normalization after each convolution
  • nclasses: number of output classes
  • fcsize: intermediate fully connected layer size (see Metalhead.vgg_classifier_layers)
  • dropout_prob: dropout level between fully connected layers
source
Metalhead.squeezenetFunction
squeezenet(; dropout_prob = 0.5, inchannels::Integer = 3, nclasses::Integer = 1000)

Create a SqueezeNet model. (reference).

Arguments

  • dropout_prob: dropout probability for the classifier head. Set to nothing to disable dropout.
  • inchannels: number of input channels.
  • nclasses: the number of output classes.
source