Getting the output shape of deconvolution layer using tf.nn.conv2d_transpose in tensorflow

后端 未结 3 875
终归单人心
终归单人心 2020-12-15 01:39

According to this paper, the output shape is N + H - 1, N is input height or width, H is kernel height or width. This is obvious inver

3条回答
  •  醉酒成梦
    2020-12-15 02:22

    The formula for the output size from the tutorial assumes that the padding P is the same before and after the image (left & right or top & bottom). Then, the number of places in which you put the kernel is: W (size of the image) - F (size of the kernel) + P (additional padding before) + P (additional padding after).

    But tensorflow also handles the situation where you need to pad more pixels to one of the sides than to the other, so that the kernels would fit correctly. You can read more about the strategies to choose the padding ("SAME" and "VALID") in the docs. The test you're talking about uses method "VALID".

提交回复
热议问题