Introduction

Tutorials

Developer guide

API Reference

private bottleneckfunction

bottleneck(inplanes, outplanes, downsample = false; stride = [1, (downsample ? 2 : 1), 1])

Create a bottleneck residual block (reference). The bottleneck is composed of 3 convolutional layers each with the given stride. By default, stride implements “ResNet v1.5” which uses stride == [1, 2, 1] when downsample == true. This version is standard across various ML frameworks. The original paper uses stride == [2, 1, 1] when downsample == true instead.

Arguments:

  • inplanes: the number of input feature maps
  • outplanes: a list of the number of output feature maps for each convolution within the residual block
  • downsample: set to true to downsample the input
  • stride: a list of the stride of the 3 convolutional layers