Introduction

Tutorials

Developer guide

API Reference

public invertedresidualfunction

invertedresidual(kernel_size, inplanes, hidden_planes, outplanes, activation = relu;
                 stride, reduction = nothing)

Create a basic inverted residual block for MobileNet variants (reference).

Arguments

  • kernel_size: The kernel size of the convolutional layers
  • inplanes: The number of input feature maps
  • hidden_planes: The number of feature maps in the hidden layer
  • outplanes: The number of output feature maps
  • activation: The activation function for the first two convolution layer
  • stride: The stride of the convolutional kernel, has to be either 1 or 2
  • reduction: The reduction factor for the number of hidden feature maps in a squeeze and excite layer (see squeeze_excite). Must be ≥ 1 or nothing for no squeeze and excite layer.