当前位置:网站首页>nn. Conv2d and nn Convtranspose2d differences

nn. Conv2d and nn Convtranspose2d differences

2022-06-13 02:32:00 Prodigal son's private dishes

nn.Conv2d and nn.ConvTranspose2d Parameter description and difference

1、nn.Conv2d(in_channels,out_channels,kernel_size,stride=1,padding=0,dilation=1,groups=1,bias=True)

in_channels: Input dimensions
out_channels: Output dimension
kernel_size: Convolution kernel size
stride: Step size
padding: repair 0
dilation:kernel spacing
groups(int, optional) : The number of blocked connections from the input channel to the output channel

nn.Conv2d The function is : Two dimensional convolution is performed on the input signal composed of multiple input planes .

Calculation formula of image size after convolution :N = (W − F + 2P )/S+1

w Is the original image size 、F Is the convolution kernel size 、P by padding size 、S It's the step length

2、nn.ConvTranspose2d The function of is to perform deconvolution

nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1)

padding(int or tuple, optional) - Each side of the input adds 0 The number of layers , Both height and width are increased 2*padding

output_padding(int or tuple, optional) - Output side supplement 0 The number of layers , Both height and width are increased padding

Output size calculation :
output = (input-1)stride+outputpadding -2padding+kernelsize

原网站

版权声明
本文为[Prodigal son's private dishes]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280540496867.html