# Image Completion with Hybrid Interpolation in Tensor Representation
## 3 Proposed Algorithm  
For interpolation of \(N\)-way incomplete tensor \(\mathcal{M}\), the points \(\mathbf{x}_{i}\) and \(\mathbf{x}_{j}\) in (7) are expressed by index values: \(\mathbf{x}_{i}=[i_{1},i_{2},\ldots,i_{N}]\in\mathbb{R}^{N}\) and \(\mathbf{x}_{j}=[j_{1},j_{2},\ldots,j_{N}]\in\mathbb{R}^{N}\). The distance measure in (6) can also be regarded in a wider sense, and hence the norm \(l_{2}\) can be replaced with the distance function \(D(\mathbf{x}_{i},\mathbf{x}_{j})\). For any distance function, the following conditions are satisfied: \(D(\mathbf{x},\mathbf{x})=0\), \(\forall\mathbf{x}\
eq\mathbf{y}:D(\mathbf{x},\mathbf{y})>0\), \(D(\mathbf{x},\mathbf{y})=D(\mathbf{y},\mathbf{x})\), and \(D(\mathbf{x},\mathbf{z})\leq D(\mathbf{x},\mathbf{y})+D(\mathbf{y},\mathbf{z})\). In the \(N\)-dimensional space, any data point \(y_{i_{1},\ldots,i_{N}}\) can be modelled with the interpolant  
\[ \begin{array}{rcl}y_{i_{1},i_{2},\ldots,i_{N}}&=&\sum_{j=1}^{I}w_{j}\psi \left(-\frac{D(\mathbf{x}_{i},\mathbf{x}_{j})}{\tau}\right)\\ &=&\sum_{j_{1}=1}^{I_{1}}\sum_{j_{2}=1}^{I_{2}}\cdots\sum_{j_{N}=1}^{I_{N}}w_{ j_{1},j_{2},\ldots,j_{N}}\psi\left(-\frac{D([i_{1},i_{2},\ldots,i_{N}],[j_{1},j_{2}, \ldots,j_{N}]]}{\tau}\right),\end{array}  \tag{9}\]  
where \(\tau>0\) is a scaling factor. Let \(D([i_{1},i_{2},\ldots,i_{N}],[j_{1},j_{2},\ldots,j_{N}])\) be an additively separable distance function, i.e.,  
\[D([i_{1},i_{2},\ldots,i_{N}],[j_{1},j_{2},\ldots,j_{N}])=\sum_{n=1}^{N}d^{(n)} (i_{n},j_{n}), \tag{10}\]  
where \(d^{(n)}(i_{n},j_{n})\) is a one-variable function that expresses the distance metrics for the variables \((i_{n},j_{n})\) in the \(n\)-th mode. We also assume that the RBF \(\psi\) is multiplicatively separable. That is  
\[\psi\left(\sum_{n=1}^{N}x_{n}\right)=\prod_{n=1}^{N}\psi^{(n)}(x_{n}). \tag{11}\]  
Considering separability conditions (10), (11), model (9) can be reformulated as follows:  
\[ \begin{array}{rcl}y_{i_{1},\ldots,i_{N}}&=&\sum_{j_{1}=1}^{I_{1}}\cdots \sum_{j_{N}=1}^{I_{N}}w_{j_{1}\ldots j_{N}}\psi\left(-\frac{\sum_{n=1}^{N}d^{( n)}(i_{n},j_{n})}{\tau}\right)\\ &=&\sum_{j_{1}=1}^{I_{1}}\cdots\sum_{j_{N}=1}^{I_{N}}w_{j_{1}\ldots j_{N}}\prod _{n=1}^{N}\psi^{(n)}\left(-\frac{d^{(n)}(i_{n},j_{n})}{\tau}\right)=\sum_{j_{1 }=1}^{I_{1}}\cdots\sum_{j_{N}=1}^{I_{N}}w_{j_{1}\ldots j_{N}}\prod_{n=1}^{N}f_{ i_{n}|_{n}}^{(n)}\\ &=&\sum_{j_{N}=1}^{I_{N}}\cdots\left(\sum_{j_{1}=1}^{I_{1}}w_{j_{1}\ldots j_{N} }f_{i_{1}j_{1}}^{(1)}\right)f_{i_{N}j_{N}j_{N}^{\prime}}^{(N)}\end{array}  \tag{12}\]  
where \(f_{i_{n},j_{n}}^{(n)}=\psi^{(n)}\left(-\frac{d^{(n)}(i_{n},j_{n})}{\tau}\right)\). Following the standard tensor-matrix contraction rule given in (4), formula (12) can be presented in the following form:  
\[\mathcal{Y}=\mathcal{W}\times_{1}\mathbf{F}^{(1)}\times_{2}\ldots\times_{N}\mathbf{F}^{ (N)}, \tag{13}\]  
where \(\mathcal{Y}=[y_{i_{1}\ldots,i_{N}}]\in\mathbb{R}^{I_{1}\times\ldots\times I_{N}}\), \(\mathcal{W}=[w_{h_{1}\ldots,j_{N}}]\in\mathbb{R}^{I_{1}\times\ldots\times I_{ N}}\), and \(\forall n:\mathbf{F}^{(n)}=[f^{(n)}_{i_{n}\mu_{n}}]\in\mathbb{R}^{I_{n}\times I_{n}}\). **Remark 1**. : _The model given in (13) has a form identical to model (3), where \(\mathcal{W}\) is the core tensor, and \(\{\mathbf{F}^{(n)}\}\) are factor matrices.