Introduction

Tutorials

API Reference

public depthwise_sep_conv_bnfunction

depthwise_sep_conv_bn(kernelsize, inplanes, outplanes, activation = relu;
                      rev = false,
                      stride = 1, pad = 0, dilation = 1, [bias, weight, init],
                      initβ = Flux.zeros32, initγ = Flux.ones32,
                      ϵ = 1f-5, momentum = 1f-1)

Create a depthwise separable convolution chain as used in MobileNet v1. This is sequence of layers:

  • a kernelsize depthwise convolution from inplanes => inplanes
  • a batch norm layer + activation
  • a kernelsize convolution from inplanes => outplanes
  • a batch norm layer + activation

See Fig. 3 in reference.

Arguments

  • kernelsize: size of the convolution kernel (tuple)
  • inplanes: number of input feature maps
  • outplanes: number of output feature maps
  • activation: the activation function for the final layer
  • rev: set to true to place the batch norm before the convolution
  • stride: stride of the first convolution kernel
  • pad: padding of the first convolution kernel
  • dilation: dilation of the first convolution kernel
  • bias, weight, init: initialization for the convolution kernel (see Flux.Conv)
  • initβ, initγ: initialization for the batch norm (see Flux.BatchNorm)
  • ϵ, momentum: batch norm parameters (see Flux.BatchNorm)