当前位置:网站首页>Transposed convolution
Transposed convolution
2022-04-23 05:36:00 【Idea reply】
Catalog
1 Definition of convolution operation and transpose convolution
1.3 The steps of transpose convolution
2 The understanding of transpose convolution
2.1 stride=1 The understanding of transpose convolution
2.1.1 One dimensional form
2.2 stride>1 The understanding of transpose convolution
2.2.1 One dimensional form
Transposition convolution (Transpose Convolution), Some places are also called “ deconvolution ”, In deep learning, it is expressed as an inverse process of convolution , According to the size of convolution kernel and the size of output , Restore the image size before convolution , Instead of restoring the original value .
1 Definition of convolution operation and transpose convolution
1.1 Convolution operation
For an input, the size is
Image , The convolution kernel size is
:

Calculate the output
The specific implementation method is matrix multiplication .
The convolution kernel is expressed as a sparse matrix ![]()

Each line vector represents the convolution operation at one position ,0 Filling indicates the area not covered by the convolution kernel .
Enter
Expand to column vector :

Then the convolution operation can be expressed as :
Output vector
The size is
The column vector , Rewritten as a matrix is
.
1.2 Transposition convolution
Now? , Think about how we can change the direction of calculation . in other words , We want to build on a matrix 1 Values and... In another matrix 9 Relationship between two values . This is it. image In the reverse operation of convolution , This is the core idea of transpose convolution .
( translator's note : From the perspective of information theory , Convolution is irreversible . So it's not from output Matrix and kernel The matrix calculates the original input matrix . Instead, it calculates a matrix that maintains the positional relationship .)


Transpose convolution is to
The inputs and outputs in the are interchangeable :

Represents matrix transpose , Now the size is
.- by
The input of
, After transpose convolution , The output size is
The column vector
, here
Of The value is different from the original , Just consistent in shape .
1.3 The steps of transpose convolution

Example :


How to calculate convolution :

Calculation steps of transpose matrix :







2 The understanding of transpose convolution
2.1 stride=1 The understanding of transpose convolution
2.1.1 One dimensional form

In this way, we can get the same result as transpose convolution . It's actually the input for transpose convolution
Add extra padding, The convolution kernel is mirror flipped . It's still Compare the correspondence of element position relationship , Regardless of the numerical value .
What's the use of such an understanding ?
Because the convolution kernel of transposed convolution is also learning Of , Given the size of the input and convolution kernel , We can think of transpose convolution as having padding The general convolution of . in other words , So called transpose convolution , Equivalent to ordinary convolution , No more than is padding large , It can achieve the effect of up sampling .
2.1.2 Two dimensional form


2.1.3 Formula calculation
about
The general convolution of , The output size of the equivalent transpose convolution is :
. At the same time, the input of transpose convolution is required to add
. That is, the output of transpose convolution becomes larger is the influence of convolution kernel .

2.2 stride>1 The understanding of transpose convolution
2.2.1 One dimensional form

2.2.2 Two dimensional form

It is also equivalent to adding holes to the input , additional padding, Ordinary convolution with horizontal and vertical flip of convolution kernel :

2.2.3 Formula calculation

The following figure shows the different in transpose convolution s and p The situation of :
![]() |
![]() |
![]() |
| s=1, p=0, k=3 | s=2, p=0, k=3 | s=2, p=1, k=3 |
3 summary
Transposed convolution and ordinary convolution have the same essence : The relationship between some values is established . It's just , The relationship established by transpose convolution is the same as that established by ordinary convolution , In the opposite direction .
We can Upsampling using transpose convolution . also , The weights in transpose convolution can be learned . therefore , We don't need any interpolation method to do up sampling .
Although it is called transpose convolution , However, this does not mean that we take the transpose of an existing convolution matrix as the weight matrix to carry out the transpose convolution operation . Compared with ordinary convolution ,intput and output The relationship is reversed ( Transpose convolution is 1 For more than , Instead of ordinary many pairs 1), Is the essence of transpose convolution .
Because of this , Strictly speaking, transpose convolution is not convolution . But we can put input Fill in some positions in the matrix with 0 And perform ordinary convolution to obtain the same result as transpose convolution output matrix . You can find a lot of articles on how to use this method to realize transpose convolution . However , Because before the convolution operation , Go to input Fill in a lot of 0, This method actually has some efficiency problems .
Warning : Transpose convolution will cause checkerboard effect in the generated image (checkerboard artifacts).. In this paper, it is recommended to use transpose convolution for up sampling operation, and then use a common convolution to reduce this kind of problem . If you are mainly concerned with how to generate images without checkerboard effect , You need to read paper.
Transposition convolution (Transpose Convolution) - You know
Transposition convolution ( deconvolution ) thought - Chen The yankees' - Blog Garden
Transposition convolution (transposed convolution)_ Bili, Bili _bilibili
版权声明
本文为[Idea reply]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230530487047.html
边栏推荐
- Formal parameters, local variables and local static variables
- Xiuxian real world and game world
- AcWing 836. Merge set (merge set)
- Markdown syntax support test
- QT drawpixmap and DrawImage blur problem
- Pavlov and hobbies
- Excel 2016 cannot open the file for the first time. Sometimes it is blank and sometimes it is very slow. You have to open it for the second time
- Use of qwbengneview and qwebchannel.
- refused connection
- Nécessité de précharger les cookies dans le sélénium
猜你喜欢
Basic knowledge of redis

弘玑|数字化时代下,HR如何进行自我变革和组织变革?

Necessity of selenium preloading cookies

Generation of straightening body in 3D slicer

Radar equipment (greedy)

分支与循环语句

what is wifi6?

‘EddiesObservations‘ object has no attribute ‘filled‘

Quick app bottom navigation bar

Pytorch deep learning practice_ 11 convolutional neural network
随机推荐
[the background color changes after clicking a line]
Call the interface to get the time
五一劳动节期间什么理财产品会有收益?
shell指令学习1
[untitled] Notepad content writing area
Breadth first search topics (BFS)
The title bar will be pushed to coincide with the status bar
可执行程序执行流程
Ehcache Memcache redis three caches
Multiple mainstream SQL queries only take the latest one of the data
Find the number of "blocks" in the matrix (BFS)
转置卷积(Transposed Convolution)
refused connection
MySQL创建oracle练习表
Three methods of list rendering
Phlli in a VM node
Parameter analysis of open3d material setting
Tslint annotations ignore errors and restful understanding
Use pagoda + Xdebug + vscode to debug code remotely
mysql中duplicate key update


