Knet.jl
Knet.jl copied to clipboard
deconv/unpool default output size not always correct
Multiple x sizes can lead to the same y size in conv and pool operations. Our current API picks one in the deconv and unpool implementations. Check out whether other frameworks use the same default and how we can give the user the option to pick different sizes in the API.
Tensorflow needs an output size to be specified. However, Pytorch does not need an output size to be specified according to their definitions here: https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/nn/conv3d_transpose https://pytorch.org/docs/stable/generated/torch.nn.ConvTranspose3d.html The Pytorch implementation, however, takes arguments to add zero paddings to one (specified by 'output_padding' argument) or both sides (specified by 'padding' argument) to get a desired output shape. More information about the output shape and padding is available on the PyTorch link above. However, I think specifying the output shape and adding the 'SAME' padding as in tensorflow implementation seems more user friendly.
The PyTorch implementation also takes an optional output size parameter which calculates/ modifies the 'output_padding' parameter to match the output size specified by the user as can be checked here: https://pytorch.org/docs/stable/_modules/torch/nn/modules/conv.html#ConvTranspose2d