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.basicblockandMetalhead.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_identityandMetalhead.skip_projectioncan 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.basicblockandMetalhead.bottleneck) -
shortcut_config: the type of shortcut style (either:A,:B, or:C):A: uses aMetalhead.skip_identityfor all residual blocks:B: uses aMetalhead.skip_projectionfor the first residual block andMetalhead.skip_identityfor the remaining residual blocks:C: uses aMetalhead.skip_projectionfor 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