vis4d.op.layer.util

Utility functions for layer ops.

Functions

build_activation_layer(activation[, inplace])

Build activation layer.

build_conv_layer(in_planes, out_planes[, ...])

Build a convolution layer.

build_norm_layer(norm, out_channels[, ...])

Build normalization layer.

build_activation_layer(activation, inplace=False)[source]

Build activation layer.

Parameters:
  • activation (str) – Activation layer type.

  • inplace (bool, optional) – If to set inplace. Defaults to False. It will be ignored if the activation layer is not inplace.

Return type:

Module

build_conv_layer(in_planes, out_planes, kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=False, norm=None, activation=None, use_dcn=False)[source]

Build a convolution layer.

Return type:

Module

build_norm_layer(norm, out_channels, num_groups=None)[source]

Build normalization layer.

Parameters:
  • norm (str) – Normalization layer type.

  • out_channels (int) – Number of output channels.

  • num_groups (int | None, optional) – Number of groups for GroupNorm. Defaults to None.

Return type:

Module