ConvTranspose2d
CLASStorch.nn.
ConvTranspose2d
(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1, padding_mode='zeros', device=None, dtype=None)
Parameters
-
in_channels (int) – Number of channels in the input image
-
out_channels (int) – Number of channels produced by the convolution
-
stride (int or tuple, optional) – Stride of the convolution. Default: 1
-
padding (int or tuple, optional) – zero-padding will be added to both sides of each dimension in the input. Default: 0
dilation * (kernel_size - 1) - padding
-
output_padding (int or tuple, optional) – Additional size added to one side of each dimension in the output shape. Default: 0
-
groups (int, optional) – Number of blocked connections from input channels to output channels. Default: 1
-
bias (bool, optional) – If , adds a learnable bias to the output. Default:
True
True
-
dilation (int or tuple, optional) – Spacing between kernel elements. Default: 1
shape:
input:(N,Cin,Hin,Win) or (Cin,Hin,Win)
output:(N,Cout,Hout,Wout) or (Cout,Hout,Wout)
转置卷积运算步骤:
1、在输入特征图元素间填充s-1行、列0
2、在输入特征图四周填充k-p-1行、列0
3、将卷积核参数上下、左右翻转
4、做正常卷积运算(填充0,步距1)
Hout = (Hin−1) × stride[0] − 2 × padding[0] + dilation[0] × (kernel_size[0] − 1) + output_padding[0] + 1
Wout = (Win−1) × stride[1] − 2 × padding[1] + dilation[1] × (kernel_size[1] − 1) + output_padding[1] + 1
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人