Signal Processing Asked by SheppLogan on November 5, 2021
Can someone define the weights in a transposed conv2D kernel used to perform interpolation (NN or bilinear or whatever)?
The idea is to get “convinced” that one can perform upsampling (interpolation) by the process of transposed convolution (aka. “deconv layers” although this name is not entierly correct)
e.g. take a small image of size 2×2 e.g with grayscale values. (lets forget depth)
How would you defined your “transposed conv2D” kernel (shape, weights) in such as way as to perform this upsampling/interpolation?
1D nearest neighbor interpolation is $K = begin{bmatrix}1 & 1 & 0end{bmatrix}^T$ or $K = begin{bmatrix}0 & 1 & 1end{bmatrix}^T$. This depends on whether your library flips the kernel (i.e. cross correlation vs convolution). To increase the sampling frequency just increase the kernel size e.g. $begin{bmatrix}0 & 1 & 1 & 1 & 0end{bmatrix}$. See also my other answer.
For 2D NN interpolation compute the outer product $K^TK = begin{bmatrix}0 & 0 & 0\0 & 1 & 1\0 & 1 & 1end{bmatrix}$.
Answered by displayname on November 5, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP