ConvTranspose2d

CLASStorch.nn.ConvTranspose2d(in_channelsout_channelskernel_sizestride=1padding=0output_padding=0groups=1bias=Truedilation=1padding_mode='zeros'device=Nonedtype=None)

 

Parameters

  • in_channels (int) – Number of channels in the input image

  • out_channels (int) – Number of channels produced by the convolution

  • kernel_size (int or tuple) – Size of the convolving kernel

  • stride (int or tupleoptional) – Stride of the convolution. Default: 1

  • padding (int or tupleoptional) – zero-padding will be added to both sides of each dimension in the input. Default: 0dilation (kernel_size 1) padding

  • output_padding (int or tupleoptional) – Additional size added to one side of each dimension in the output shape. Default: 0

  • groups (intoptional) – Number of blocked connections from input channels to output channels. Default: 1

  • bias (booloptional) – If , adds a learnable bias to the output. Default: TrueTrue

  • dilation (int or tupleoptional) – 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​ (Hin1× stride[0− × padding[0dilation[0× (kernel_size[0− 1output_padding[01

Wout​ (Win1× stride[1− × padding[1dilation[1× (kernel_size[1− 1output_padding[11

 

 

posted @ 2022-03-26 16:33  今天记笔记了吗  阅读(176)  评论(0)    收藏  举报