MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / conv3d

Function conv3d

tensorflow/python/keras/backend.py:5010–5049  ·  view source on GitHub ↗

3D convolution. Arguments: x: Tensor or variable. kernel: kernel tensor. strides: strides tuple. padding: string, `"same"` or `"valid"`. data_format: string, `"channels_last"` or `"channels_first"`. dilation_rate: tuple of 3 integers. Returns: A tensor

(x,
           kernel,
           strides=(1, 1, 1),
           padding='valid',
           data_format=None,
           dilation_rate=(1, 1, 1))

Source from the content-addressed store, hash-verified

5008
5009@keras_export('keras.backend.conv3d')
5010def conv3d(x,
5011 kernel,
5012 strides=(1, 1, 1),
5013 padding='valid',
5014 data_format=None,
5015 dilation_rate=(1, 1, 1)):
5016 """3D convolution.
5017
5018 Arguments:
5019 x: Tensor or variable.
5020 kernel: kernel tensor.
5021 strides: strides tuple.
5022 padding: string, `"same"` or `"valid"`.
5023 data_format: string, `"channels_last"` or `"channels_first"`.
5024 dilation_rate: tuple of 3 integers.
5025
5026 Returns:
5027 A tensor, result of 3D convolution.
5028
5029 Raises:
5030 ValueError: if `data_format` is neither `channels_last` or
5031 `channels_first`.
5032 """
5033 if data_format is None:
5034 data_format = image_data_format()
5035 if data_format not in {'channels_first', 'channels_last'}:
5036 raise ValueError('Unknown data_format: ' + str(data_format))
5037
5038 x, tf_data_format = _preprocess_conv3d_input(x, data_format)
5039 padding = _preprocess_padding(padding)
5040 x = nn.convolution(
5041 input=x,
5042 filter=kernel,
5043 dilation_rate=dilation_rate,
5044 strides=strides,
5045 padding=padding,
5046 data_format=tf_data_format)
5047 if data_format == 'channels_first' and tf_data_format == 'NDHWC':
5048 x = array_ops.transpose(x, (0, 4, 1, 2, 3))
5049 return x
5050
5051
5052def conv3d_transpose(x,

Callers

nothing calls this directly

Calls 4

image_data_formatFunction · 0.85
_preprocess_conv3d_inputFunction · 0.85
_preprocess_paddingFunction · 0.85
transposeMethod · 0.80

Tested by

no test coverage detected