I am a little confused about the padding setting of the torch.nn.ConvTranspose2d.
As I see the document, it seems that the padding of the deconvolution is calculated by some settings of convolution. padding(deconv) = K(conv) - 1 - padding(conv)
If I want to upsample x3 using the deconvolution, the setting of the convolution is kernel = 3, stride = 2, padding = 0; According to the previous equation, the padding of the deconvolution should be 2;
And by using the this equation Hout=(Hin−1)∗stride−2∗padding+kernel_size+output_padding
, we can get the setting of deconvolution, kernel = 7, stride = 3, padding = 2;
I don’t know if my understanding is right. Actually, I don’t know if the first equation is required. If not, the setting of kernel = 5, stride = 3, padding = 1; also meets the second equation.
Any help would be much appreciated.
It would be better if you could provide some related material.