Conv3DTranspose
类tf_keras.layers.Conv3DTranspose(
filters,
kernel_size,
strides=(1, 1, 1),
padding="valid",
output_padding=None,
data_format=None,
dilation_rate=(1, 1, 1),
activation=None,
use_bias=True,
kernel_initializer="glorot_uniform",
bias_initializer="zeros",
kernel_regularizer=None,
bias_regularizer=None,
activity_regularizer=None,
kernel_constraint=None,
bias_constraint=None,
**kwargs
)
转置卷积层(有时称为反卷积)。
通常需要转置卷积是因为需要使用与普通卷积方向相反的变换,即从某个具有普通卷积输出形状的内容,变换到具有其输入形状的内容,同时保持与该卷积兼容的连接模式。
当将此层用作模型的第一个层时,请提供关键字参数 input_shape
(整数元组或 None
,不包括样本轴),例如,如果 data_format="channels_last"
,对于具有 3 个通道的 128x128x128 体积,input_shape=(128, 128, 128, 3)
。
参数
dilation_rate
值不兼容。"valid"
或 "same"
之一(不区分大小写)。"valid"
表示无填充。"same"
会在输入的左/右、上/下或前/后均匀填充零,使得输出具有与输入相同的深度、高度和宽度维度。None
(默认),则推断输出形状。channels_last
(默认)或 channels_first
之一。输入中的维度顺序。channels_last
对应形状为 (batch_size, depth, height, width, channels)
的输入,而 channels_first
对应形状为 (batch_size, channels, depth, height, width)
的输入。如果未指定,则使用 ~/.keras/keras.json
(如果存在)中的 Keras 配置文件中的 image_data_format
值,否则使用 'channels_last'。默认为 'channels_last'。dilation_rate
值与指定任何 != 1 的步幅值不兼容。keras.activations
)。kernel
权重矩阵的初始化器(参见 keras.initializers
)。默认为 'glorot_uniform'。keras.initializers
)。默认为 'zeros'。kernel
权重矩阵的正则化函数(参见 keras.regularizers
)。keras.regularizers
)。keras.regularizers
)。keras.constraints
)。keras.constraints
)。输入形状
5D 张量,形状为:如果 data_format='channels_first',则为 (batch_size, channels, depth, rows, cols)
;如果 data_format='channels_last',则为 (batch_size, depth, rows, cols, channels)
。
输出形状
5D 张量,形状为:如果 data_format='channels_first',则为 (batch_size, filters, new_depth, new_rows, new_cols)
;如果 data_format='channels_last',则为 (batch_size, new_depth, new_rows, new_cols, filters)
。由于填充,depth
、rows
和 cols
的值可能已更改。如果指定了 output_padding
:
new_depth = ((depth - 1) * strides[0] + kernel_size[0] - 2 * padding[0] +
output_padding[0])
new_rows = ((rows - 1) * strides[1] + kernel_size[1] - 2 * padding[1] +
output_padding[1])
new_cols = ((cols - 1) * strides[2] + kernel_size[2] - 2 * padding[2] +
output_padding[2])
返回值
表示 activation(conv3dtranspose(inputs, kernel) + bias)
的 5 阶张量。
抛出
padding
为 `"causal"`。strides
> 1 且 dilation_rate
> 1 时。参考文献