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
值 != 1 不兼容。"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/keras.json
(如果存在)中找到的 image_data_format
值,否则为 'channels_last'。默认为 'channels_last'。dilation_rate
值 != 1 与指定任何步长值 != 1 不兼容。keras.activations
)。kernel
权重矩阵的初始化器(请参阅 keras.initializers
)。默认为 'glorot_uniform'。keras.initializers
)。默认为 'zeros'。kernel
权重矩阵的正则化函数(请参阅 keras.regularizers
)。keras.regularizers
)。keras.regularizers
)。keras.constraints
)。keras.constraints
)。输入形状
如果 data_format='channels_first',则为形状为 (batch_size, channels, depth, rows, cols)
的 5D 张量;如果 data_format='channels_last',则为形状为 (batch_size, depth, rows, cols, channels)
的 5D 张量。
输出形状
如果 data_format='channels_first',则为形状为 (batch_size, filters, new_depth, new_rows, new_cols)
的 5D 张量;如果 data_format='channels_last',则为形状为 (batch_size, new_depth, new_rows, new_cols, filters)
的 5D 张量。由于填充,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 时。参考