tom:

As the note say, padding serves to correspond to the padding argument in convs.
Now, when you have a nontrivial stride, you typically have that there are several input sizes to the convolution giving the same output size (with the larger one having the last row(s)/column(s) ignored). This is adjusted for by the output_padding argument.

As we see,

* without output padding, we get the “just fits” input size, 
* with output padding we get a row and column of zeros for the values that the conv would have ignored. 

Note that transposed convolutions are more an adjoint (in the linear map sense) than an inverse operation.



Thanks a lot for the swift response Thomas!
So, if I understood correctly what you said is that:


The convolution layer is many-to-one mapping due to the VALID (tensorflow nomenclature) behavior combined with the possible padding and stride that are given. This does not allow the function to be a bijective function, thus we do not have an inverse to it.


For deconvolution, we have one-to-many mapping and while padding behaves the same as for convolution, output_padding tries to match the input to one of the many possible output shapes by padding the output shape of its output_padding=0 counterpart before starting the computing and then make sure the computing results in an output shape that is “padded” with the output_padding that was given to it.


Am I right?
Best regards and stay safe,
Dan