# Fast Flow Reconstruction via Robust Invertible \(n\times n\) Convolution
## 4 Invertible \(n\times n\) Convolution
### Invertible \(n\times n\) Convolution  
[PERSON] [29] proposed invertible \(1\times 1\) convolution as the smart way to learn the permutation matrix instead of the fixed permutation [31; 32]. However, the \(1\times 1\) suffers from limited flexibility compared to the standard convolution. In particular, the receptive fields of \(1\times 1\) convolution is limited. When the network goes deeper, the receptive fields of \(1\times 1\) convolutions are still small areas; these, therefore, cannot generalize or model large objects of high-dimensional data. However, the \(1\times 1\) convolution has its own advantages compared to the standard convolution. First, the \(1\times 1\) convolution allows the network to compress the data of the input volume to be smaller. Second, \(1\times 1\) suffers less over-fitting due to small kernel sizes. Therefore, in our proposal, we still take advantages of the \(1\times 1\) convolution. Specifically, we adopt the successfully invertible \(1\times 1\) convolution of [PERSON] [29] in our design.  
In the previous subsection, we proved that the shift function \(\mathcal{S}\) is invertible and proved the tractability of the Jacobian determinant. In Section 3.2, we indicated that if we can share shifted inputs regardless of the kernel index via the shift function \(\mathcal{S}\), we can simplify the standard \(n\times n\) convolution to the composition of the \(\mathcal{S}\) and \(1\times 1\) convolution. Therefore, the invertible \(n\times n\) convolution will be equivalent to the combination of the invertible shift function \(\mathcal{S}\) and the invertible \(1\times 1\) convolution. Specifically, the input will first beforwarded to the shift function \(\mathcal{S}\) and then convoluted with the \(1\times 1\) filter. Algorithm 1 illustrates the pseudo code of the invertible \(n\times n\) convolution.  
```
Input: An input \(\mathbf{X}\in\mathbb{R}^{N\times H\times W\times C}\) Result: An output of invertible \(n\times n\) convolution and the log Jacobian determinant  Initialize \(\alpha,\beta\in\mathbb{R}^{C}\) for the invertible shift function;  Initialize \(\mathbf{W}\in\mathbb{R}^{C\times C}\) as a rotation matrix for the invertible \(1\times 1\) convolution function;  logdet = 0.0; The invertible shift function; \(\mathbf{Y}=\mathbf{X}\times\alpha+\beta\) (Channel-wise operations);  The inverse will be \(\mathbf{X}=\frac{\mathbf{Y}-\beta}{\alpha}\);  logdet = logdet + \(\sum_{i=1}^{C}\log(\alpha_{i})\); The invertible \(1\times 1\) convolution; \(\mathbf{Z}=Conv(\mathbf{Y},\mathbf{W})\);  The inverse will be \(\mathbf{Y}=Conv(\mathbf{Z},\mathbf{W}^{-1})\);  logdet = logdet + \(\log(\det(\mathbf{W}))\)\({}^{*}H\)\({}^{*}W\);  Return \(\mathbf{Z}\) and logdet;
```  
**Algorithm 1**Invertible \(n\times n\) Convolution  
Figure 3a illustrates our one step of flow. We adopt the common design of a flow step [29; 35; 46] in our design. Our proposal can be easily integrated to the multi-scale architecture designed by [PERSON] et al. [32] (Figure 3b). From our proposal, we can generalize the invertible \(1\times 1\) convolution to the invertible \(n\times n\) convolution through the shift function \(\mathcal{S}\). It can help to encourage the filters to learn a more efficient data representation and embed more useful latent features than the invertible \(1\times 1\) convolution used in Glow [29]. Besides, we use fewer parameters and have less inference time compared to the standard \(n\times n\) convolutions.