DenseNet

This is the API reference for the DenseNet model present in Metalhead.jl.

The higher level model

Metalhead.DenseNetType
DenseNet(config::Int; pretrain = false, growth_rate = 32,
         reduction = 0.5, inchannels = 3, nclasses = 1000)

Create a DenseNet model with specified configuration. Currently supported values are (121, 161, 169, 201) (reference).

Arguments

  • config: the configuration of the model
  • pretrain: whether to load the model with pre-trained weights for ImageNet.
  • growth_rate: the output feature map growth probability of dense blocks (i.e. k in the ref)
  • reduction: the factor by which the number of feature maps is scaled across each transition
  • inchannels: the number of input channels
  • nclasses: the number of output classes
Warning

DenseNet does not currently support pretrained weights.

See also Metalhead.densenet.

source

The core function

Metalhead.densenetFunction
densenet(nblocks::AbstractVector{Int}; growth_rate = 32,
         reduction = 0.5, dropout_prob = nothing, inchannels = 3,
         nclasses = 1000)

Create a DenseNet model (reference).

Arguments

  • nblocks: number of dense blocks between transitions
  • growth_rate: the output feature map growth probability of dense blocks (i.e. k in the ref)
  • reduction: the factor by which the number of feature maps is scaled across each transition
  • dropout_prob: the dropout probability for the classifier head. Set to nothing to disable dropout
  • inchannels: the number of input channels
  • nclasses: the number of output classes
source