You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing the same parameters to nn.ConvTranspose2d does not revert nn.Conv2d in terms of dimension shape conservation, and an output_padding option can solve it.
The padding argument effectively adds dilation * (kernel_size - 1) - padding amount of zero padding to both sizes of the input. This is set so that when a Conv2d and a ConvTranspose2d are initialized with same parameters, they are inverses of each other in regard to the input and output shapes. However, when stride > 1, Conv2d maps multiple input shapes to the same output shape. output_padding is provided to resolve this ambiguity by effectively increasing the calculated output shape on one side. Note that output_padding is only used to find output shape, but does not actually add zero-padding to output.
The text was updated successfully, but these errors were encountered:
Passing the same parameters to
nn.ConvTranspose2d
does not revertnn.Conv2d
in terms of dimension shape conservation, and anoutput_padding
option can solve it.Reference from PyTorch's docs:
The text was updated successfully, but these errors were encountered: