DenseNet
This is the API reference for the DenseNet model present in Metalhead.jl.
The higher level model
Metalhead.DenseNet
— TypeDenseNet(config::Integer; pretrain::Bool = false, growth_rate::Integer = 32,
reduction = 0.5, inchannels::Integer = 3, nclasses::Integer = 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
DenseNet
does not currently support pretrained weights.
See also Metalhead.densenet
.
The core function
Metalhead.densenet
— Functiondensenet(nblocks::AbstractVector{<:Integer}; growth_rate::Integer = 32,
reduction = 0.5, dropout_prob = nothing, inchannels::Integer = 3,
nclasses::Integer = 1000)
Create a DenseNet model (reference).
Arguments
nblocks
: number of dense blocks between transitionsgrowth_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 transitiondropout_prob
: the dropout probability for the classifier head. Set tonothing
to disable dropoutinchannels
: the number of input channelsnclasses
: the number of output classes