chickadee » nanograd-components » make-downsample

make-resnet block-fn layers num-classes #!key (dtype 'f32) (name ResNet)procedure
make-residual-layer block-fn in-channels out-channels num-blocks #!key (stride 1) (dtype 'f32) (name Layer)procedure
make-residual-block in-channels out-channels #!key (stride 1) (downsample #f) (dtype 'f32) (name BasicBlock)procedure
make-bottleneck-block in-channels out-channels #!key (stride 1) (downsample #f) (dtype 'f32) (name Bottleneck)procedure
make-downsample in-channels out-channels stride dtypeprocedure

Building blocks. make-resnet builds an ImageNet-style model from a block constructor and a list of four block counts. make-residual-layer gives the first block the stride, and also a downsample shortcut when the stride or the channel count changes. make-downsample is a 1x1 convolution followed by batch normalization; its dtype argument is positional.

The predicates are resnet?, residual-block? and bottleneck-block?.