torch.nn.ConvTranspose2d vs torch.nn.Upsample

In the Unet paper, they’ve stated that “up-convolutions” were used. I would assume that this means they would have implemented/used ConvTranspose2d.

As for which one to use, it really depends on the network you’re designing. If you are sure of the kind of upsampling that needs to be done (bilinear, etc.) then you can use nn.Upsample. However, if you think it would be important to “learn” how to upsample instead of just using a hardcoded method then the trainable parametes in ConvTranspose2d would be useful.

3 Likes