Transfer convolution transposed convolution

Source: Internet
Author: User
Tags theano

[emphasis] on the interpretation of convolution to avoid three misunderstandings: Click on the Open link

The Y = CX convolution operations Matrix C definition is arranged as follows:


Many articles say that the transpose of the convolution nucleus can be used to reverse convolution, and lost in confusion "even if the volume of nuclear transfer (or flip up and down), convolution after the output is smaller (or unchanged, at least not increase) ah" ... Until you see the literature and the corresponding animation (other animations in github-convolution Arithmetic1)


Convolution I=4,k=3,p=0,s=1, then o=2 Reverse convolution I=2,k=3,p=0,s=1, then o=4


Note that the blue (below) is the input, the green (above) is the output, convolution and deconvolution in P, S, K and other parameters, is equivalent to I and O adjusted a bit.

This explains the deconvolution of the time, is a 0, even if someone else is called no padding (p =), this is because the convolution from the blue 4x4 reduced to a green 2x2, so the corresponding P/s deconvolution should be extended from the blue 2x2 to green 4x4. And the transpose does not mean that this 3x3 kernel W becomes wT, but the transpose of the value convolution operation Matrix C. However, if the convolution calculation is written as matrix multiplication (in the program, in order to increase the efficiency of the convolution operation, you can do so, such as in the TensorFlow is this implementation), Y⃗=cx⃗ (where Y⃗ means to pull y⃗ into a one-dimensional vector, x⃗ the same), then the deconvolution can indeed To express as Cty⃗, and such a matrix multiplication, is exactly equal to W flip and then upside down and the 0 of the Y convolution. Specific View link Blog





Full text: convolution arithmetic Tutorial click Open link

Dynamic diagram of convolution and GitHub on the open link

Conclusion: Quick reference

Convolution relationship

A convolution specified by input size, kernel size, stride, padding size,

has an output size given by

In Theano, this translates to

Output = theano.tensor.nnet.conv2d (
    input, filters, input_shape= (b, C2, I1, I2), filter_shape= (c1, c2, K1, K2),
    b Order_mode= (P1, p2), subsample= (S1, S2))
# output.shape[2] = = (i

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.