tf.keras.layers.DepthwiseConv2D

View source on GitHub

Depthwise separable 2D convolution.

Inherits From: Conv2D

tf.keras.layers.DepthwiseConv2D(
    kernel_size, strides=(1, 1), padding='valid', depth_multiplier=1,
    data_format=None, activation=None, use_bias=True,
    depthwise_initializer='glorot_uniform', bias_initializer='zeros',
    depthwise_regularizer=None, bias_regularizer=None, activity_regularizer=None,
    depthwise_constraint=None, bias_constraint=None, **kwargs
)

Depthwise Separable convolutions consists in performing just the first step in a depthwise spatial convolution (which acts on each input channel separately). The depth_multiplier argument controls how many output channels are generated per input channel in the depthwise step.

Arguments:

Input shape:

4D tensor with shape: [batch, channels, rows, cols] if data_format='channels_first' or 4D tensor with shape: [batch, rows, cols, channels] if data_format='channels_last'.

Output shape:

4D tensor with shape: [batch, filters, new_rows, new_cols] if data_format='channels_first' or 4D tensor with shape: [batch, new_rows, new_cols, filters] if data_format='channels_last'. rows and cols values might have changed due to padding.