private
resnet
— function
resnet(block, residuals::NTuple{2, Any}, connection = addrelu;
channel_config, block_config, nclasses = 1000)
Create a ResNet model (reference).
Arguments
block
: a function with input(inplanes, outplanes, downsample=false)
that returns a new residual block (seeMetalhead.basicblock
andMetalhead.bottleneck
)residuals
: a 2-tuple of functions with input(inplanes, outplanes, downsample=false)
, each of which will return a function that will be used as a new “skip” path to match a residual block.Metalhead.skip_identity
andMetalhead.skip_projection
can be used here.connection
: the binary function applied to the output of residual and skip paths in a blockchannel_config
: the growth rate of the output feature maps within a residual blockblock_config
: a list of the number of residual blocks at each stagenclasses
: the number of output classes
resnet(block, shortcut_config::Symbol, connection = addrelu;
channel_config, block_config, nclasses = 1000)
Create a ResNet model (reference).
Arguments
-
block
: a function with input(inplanes, outplanes, downsample=false)
that returns a new residual block (seeMetalhead.basicblock
andMetalhead.bottleneck
) -
shortcut_config
: the type of shortcut style (either:A
,:B
, or:C
):A
: uses aMetalhead.skip_identity
for all residual blocks:B
: uses aMetalhead.skip_projection
for the first residual block andMetalhead.skip_identity
for the remaining residual blocks:C
: uses aMetalhead.skip_projection
for all residual blocks
-
connection
: the binary function applied to the output of residual and skip paths in a block -
channel_config
: the growth rate of the output feature maps within a residual block -
block_config
: a list of the number of residual blocks at each stage -
nclasses
: the number of output classes