调用的是如下情况的转置卷积函数
import tensorflow as tf
from tensorflow.keras import layers
# 搭建网络
G_model = tf.keras.Sequential([
# 其他层1
# 其他层2
# 其他层...
# 转置卷积层
layers.Conv2DTranspose(filters=128,
kernel_size=5,
strides=1,
padding='same',
output_padding=None)
# 其他层...
])
1. 调用函数:layers.Conv2DTranspose
2. 转置卷积核尺寸 kernel_size
3. 转置卷积步长 strides
4. 内补0模式 padding
5. 外补0模式 output_padding
6. 输入尺寸 in_size
out_size = (in_size-1) * strides + kernel_size
out_size = in_size * strides
out_size = (in_size-1) * strides + kernel_size + output_padding
out_size = (in_size-1) * strides + kernel_size -2 + output_padding
https://blog.csdn.net/u011913417/article/details/110857982