%\documentclass{uai2023} % for initial submission
\documentclass[accepted]{uai2023} % after acceptance, for a revised
                                    % version; also before submission to
                                    % see how the non-anonymous paper
                                    % would look like

%% There is a class option to choose the math font
% \documentclass[mathfont=ptmx]{uai2023} % ptmx math instead of Computer
% Modern (has noticable issues)
% \documentclass[mathfont=newtx]{uai2023} % newtx fonts (improves upon
 % ptmx; less tested, no support)
% NOTE: Only keep *one* line above as appropriate, as it will be replaced
%       automatically for papers to be published. Do not make any other
%       change above this note for an accepted version.

%% Choose your variant of English; be consistent
\usepackage[american]{babel}
% \usepackage[british]{babel}

%% Some suggested packages, as needed:
\usepackage{natbib} % has a nice set of citation styles and commands
    \bibliographystyle{plainnat}
    \renewcommand{\bibsection}{\subsubsection*{References}}
\usepackage{mathtools} % amsmath with fixes and additions
% \usepackage{siunitx} % for proper typesetting of numbers and units
\usepackage{booktabs} % commands to create good-looking tables
\usepackage{tikz} % nice language for creating drawings and diagrams
\usepackage{times}
\usepackage{helvet}
\usepackage{courier}
\usepackage{color}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amsmath} % assumes amsmath package installed
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{threeparttable}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{url}
\newtheorem{mytheo}{Theorem}
\newtheorem{mylamma}{Lemma}
\newtheorem{myprop}{Proposition}
\newtheorem{mydef}{Definition}
\newtheorem{datamodel}{Data Model}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}

% for cross referencing the main text
% PLEASE ONLY USE xr IN THE SUPPLEMENTARY MATERIAL. 
% In the main paper, hard code any cross-reference to the supplementary material. 
%\usepackage{xr} 
%\externaldocument{main_UAI}

%% Provided macros
% \smaller: Because the class footnote size is essentially LaTeX's \small,
%           redefining \footnotesize, we provide the original \footnotesize
%           using this macro.
%           (Use only sparingly, e.g., in drawings, as it is quite small.)

%% Self-defined macros
\newcommand{\swap}[3][-]{#3#1#2} % just an example

\title{Scalable and Robust Tensor Ring Decomposition for Large-scale Data\\(Supplementary Material)}

% The standard author block has changed for UAI 2023 to provide
% more space for long author lists and allow for complex affiliations
%
% All author information is authomatically removed by the class for the
% anonymous submission version of your paper, so you can already add your
% information below.
%
% Add authors
\author[1]{\href{yicong.he@ucf.edu}{Yicong He}{}}
\author[1,2]{\href{George.Atia@ucf.edu}{George K. Atia}}

% Add affiliations after the authors
\affil[1]{%
    Department of Electrical and Computer
    Engineering, University of Central Florida, Orlando, FL, 32816, USA.
}
\affil[2]{%
    Department of Computer
    Science, University of Central Florida, Orlando, FL, 32816, USA.
}
  
\begin{document}
  
\onecolumn %% Turn this off if single column is desired for the supplement
\maketitle

Before presenting the proof of the propositions, we need the following definition on Tensor Connect Product (TCP), which computes the tensor core merging. 

\begin{mydef}
[Tensor Connect Product (TCP) \citep{wang2017efficient}]
Let $\mathcal{Z}_{k} \in$ $\mathbb{R}^{r_{k} \times I_{k} \times r_{k+1}}, k=1, \ldots, N$ be $N$ $3$-order tensors. The tensor connect product (TCP) between $\mathcal{Z}_{k}$ and $\mathcal{Z}_{k+1}$ is defined as,
$$
\begin{aligned}
\mathcal{Z}^{(k, k+1)}\!=\!\operatorname{\textcolor{black}{fold}}\left(\mathbf{L}\left(\mathcal{Z}_{k}\right) \times \mathbf{R}\left(\mathcal{Z}_{k+1}\right)\right)
\end{aligned}
$$
where \textcolor{black}{$\operatorname{fold}(\mathbf{X})$ denotes the operation of reshaping the unfolding matrix $\mathbf{X}$ back to tensor $\mathcal{X}$ and}
$$
\mathbf{L}(\mathcal{X})=\left(\mathbf{X}_{(3)}\right)^{T} \in \mathbb{R}^{\left(r_{k} I_{k}\right) \times r_{k+1}}
$$
$$
\mathbf{R}(\mathcal{X})=\mathbf{X}_{(1)} \in \mathbb{R}^{r_{k} \times\left(I_{k} r_{k+1}\right)}\:.
$$
\label{def:TCP}
\end{mydef}

First, we consider the computation of the Gram matrix using only two core tensors. According to the tensor core merging of two core tensors $\mathcal{Z}_{k}$ and $\mathcal{Z}_{k+1}$, we establish the following lamma.

\begin{mylamma}
\label{prop_1}
Let $\mathcal{Z}_{k} \in$ $\mathbb{R}^{r_{k} \times I_{k} \times r_{k+1}}, k=1, \ldots, N$, be $3$-rd order tensors. The Gram matrix of $\mathbf{Z}_{[2]}^{(k, k+1)}$ can be computed as
\begin{equation}
\begin{aligned}
\mathbf{G}_{\mathcal{Z}^{(k, k+1)}}=\mathbf{Z}_{[2]}^{(k, k+1),T}\mathbf{Z}_{[2]}^{(k, k+1)}=\Phi(\mathbf{Q}_{k}\mathbf{Q}_{k+1})
\end{aligned}
\label{eq:p1}
\end{equation}
where $\mathbf{Q}_k(:,i\times r_{k+1}+j)=\operatorname{vec}\{\left(\mathcal{Z}_{k}(:,:,i)\right)\mathcal{Z}_{k}(:,:,j)^T\}$, with $\operatorname{vec}\{.\}$ denoting the vectorization operation, and $\Phi(\mathbf{X})$ is a reshape operation by which $\mathbf{X}\in\mathbb{R}^{m^2\times n^2}$ is first divided into $m\times n$ blocks $\{\mathbf{X}_{ij}\}_{i,j=1}^{m,n}\in\mathbb{R}^{m\times n}$, then reshaped as 
$$
\Phi(\mathbf{X})=\left[\operatorname{vec}\{\mathbf{X}^T_{11}\}~\operatorname{vec}\{\mathbf{X}^T_{21}\}~\ldots~\operatorname{vec}\{\mathbf{X}^T_{mn}\}\right]^T\:.
$$
\end{mylamma}

\section{Proof of Lemma 1}
\begin{proof}
From TCP in Definition \ref{def:TCP}, we can express the fiber-wise relation between mode-$2$ fibers of $\mathcal{Z}_{k}$, $\mathcal{Z}_{k+1}$ and $\mathcal{Z}^{(k, k+1)}$ as % using the Kronecker product as
\begin{equation}
\mathcal{Z}^{(k, k+1)}(i,:,j)=\sum_{m=1}^{r_{k+1}}\mathcal{Z}_{k+1}(m,:,j)\otimes\mathcal{Z}_{k}(i,:,m)\:,
\label{eq:kp}
\end{equation}
with $i\in[1,r_k], j\in[1,r_{k+2}]$ and $\otimes$ denotes the kronecker product.
Then, the $(i,j)$-th entry of the Gram matrix of $\mathbf{Z}_{[2]}^{(k, k+1)}$ can be computed as
\begin{equation}
\begin{aligned}
&\left[\mathbf{Z}_{[2]}^{(k, k+1),T}\mathbf{Z}_{[2]}^{(k, k+1)}\right]_{i,j}
=\left(\mathcal{Z}^{(k, k+1)}(p_i,:,q_i)\right)^T\mathcal{Z}^{(k, k+1)}(p_j,:,q_j)\:,
\end{aligned}
\label{eq:kp2}
\end{equation}
where $p_i=\lceil i/r_{k+1}\rceil,q_i=\mod(i-1,r_{k+1})+1$.
Substituting \eqref{eq:kp} in \eqref{eq:kp2} and using the property 
\begin{equation}
(\mathbf{A}\otimes\mathbf{B})(\mathbf{C}\otimes\mathbf{D})=(\mathbf{A}\mathbf{C})\otimes(\mathbf{B}\mathbf{D})\:,
\label{eq:kron}
\end{equation}
we have that
\begin{equation}
\begin{aligned}
\left[\mathbf{Z}_{[2]}^{(k, k+1),T}\mathbf{Z}_{[2]}^{(k, k+1)}\right]_{i,j}=\mathbf{v}_1^T\mathbf{v}_2\:,
\end{aligned}
\label{eq:kp4}
\end{equation}
where 
$$
\mathbf{v}_1=\operatorname{vec}\{\mathcal{Z}_k(p_i,:,:)^T\mathcal{Z}_k(p_j,:,:)\}%[\left(\mathcal{Z}_{k}(p_i,:,1)\right)^T\mathcal{Z}_{k}(p_j,:,1) \ldots \left(\mathcal{Z}_{k}(p_i,:r_{k+1})\right)^T\mathcal{Z}_{k}(p_j,:r_{k+1})]^T
$$
$$
\mathbf{v}_2=\operatorname{vec}\{\mathcal{Z}_{k+1}(:,:,q_i)\mathcal{Z}_{k+1}(:,:,q_j)^T\}\:.
%[\left(\mathcal{Z}_{k+1}(1,:,q_i)\right)^T\mathcal{Z}_{k}(1,:,q_j) \ldots \left(\mathcal{Z}_{k}(r_{k+1},:,q_i)\right)^T\mathcal{Z}_{k}(r_{k+1},:,q_j)]^T
$$
% with $\operatorname{vec}\{\cdot\}$ denoting the vectorization operation. 
Therefore, by defining $\mathbf{Q}_k(:,i\times r_{k+1}+j)=\operatorname{vec}\{\left(\mathcal{Z}_{k}(:,:,i)\right)\mathcal{Z}_{k}(:,:,j)^T\}$, the Gram matrix of $\mathbf{Z}_{[2]}^{(k, k+1)}$ can be computed as
\begin{equation}
\begin{aligned}
\mathbf{G}_{\mathcal{Z}^{(k, k+1)}}=\mathbf{Z}_{[2]}^{(k, k+1),T}\mathbf{Z}_{[2]}^{(k, k+1)}=\Phi(\mathbf{Q}_{k}\mathbf{Q}_{k+1})
\end{aligned}
\end{equation}
where $\Phi(\mathbf{X})$ is a reshape operation by which $\mathbf{X}\in\mathbb{R}^{m^2\times n^2}$ is first divided into $m\times n$ blocks $\{\mathbf{X}_{ij}\}_{i,1,1}^{m,n}\in\mathbb{R}^{m\times n}$, then reshaped as 
$$
\Phi(\mathbf{X})=\left[\operatorname{vec}\{\mathbf{X}^T_{11}\}~\operatorname{vec}\{\mathbf{X}^T_{21}\}~\ldots~\operatorname{vec}\{\mathbf{X}^T_{mn}\}\right]^T\:.
$$
\end{proof}

\section{Proof of Proposition 1}
Following (1) in the proof of Lemma 1, for $\mathcal{Z}^{\leq c}\in\mathbb{R}^{r_1\times\prod_{k=1}^c I_k\times r_{c+1}}$ which is a subchain obtained by merging $c$ cores $\{\mathcal{Z}_{k}\}_{k=1}^c$, according to TCP, we can express the fiber-wise relation between mode-$2$ fibers of $\mathcal{Z}_{c}$ and $\mathcal{Z}^{\leq c-1}$ as
\begin{equation}
\mathcal{Z}^{\leq c}(i,:,j)=\sum_{m=1}^{r_{c}}\mathcal{Z}_{c}(m,:,j)\otimes\mathcal{Z}^{\leq c-1}(i,:,m)\:.
\end{equation}
With the above recursion equation we have
\begin{equation}
\begin{aligned}
&\mathcal{Z}^{\leq c}(i,:,j)\\
&=\sum_{m=1}^{r_{c}}\mathcal{Z}_{c}(m,:,j)\otimes\left(\sum_{m=1}^{r_{c-1}}\mathcal{Z}_{c-1}(m,:,j)\otimes\ldots\left(\sum_{m=1}^{r_{2}}\mathcal{Z}_{2}(m,:,j)\otimes\mathcal{Z}_{1}(i,:,m)\right)\right)
\end{aligned}
\label{eq:kpmulti}
\end{equation}
Again, using the property in \eqref{eq:kron}, we can obtain that
\begin{equation}
\begin{aligned}
\left[\mathbf{Z}_{[2]}^{{\leq c},T}\mathbf{Z}_{[2]}^{{\leq c}}\right]_{i,j}=\mathbf{v}_1^T\mathbf{Q}_{2}^T\ldots\mathbf{Q}_{c-1}^T\mathbf{v}_2\:,
\end{aligned}
\label{eq:kp22}
\end{equation}
where
$$
\mathbf{v}_1=\operatorname{vec}\{\mathcal{Z}_1(p_i,:,:)^T\mathcal{Z}_1(p_j,:,:)\}
$$
$$
\mathbf{v}_2=\operatorname{vec}\{\mathcal{Z}_{c}(:,:,q_i)\mathcal{Z}_{c}(:,:,q_j)^T\}
$$
$$
\mathbf{Q}_k(:,i\times r_{k+1}+j)=\operatorname{vec}\{\left(\mathcal{Z}_{k}(:,:,i)\right)\mathcal{Z}_{k}(:,:,j)^T\},k=2,\ldots,c-1
$$
$$
p_i=\lceil i/r_{c+1}\rceil,q_i=\mod(i-1,r_{c+1})+1\>
$$
Then, the Gram matrix of $\mathbf{Z}_{[2]}^{\leq c}$ can be computed as
\begin{equation}
\begin{aligned}
\mathbf{G}_{\mathcal{Z}^{\leq c}}=\mathbf{Z}_{[2]}^{\leq c,T}\mathbf{Z}_{[2]}^{\leq c}=\Phi\left(\prod_{k=1}^{c}\mathbf{Q}_{k}\right)\:,
\end{aligned}
\label{eq:FGMC}
\end{equation}
where $\mathbf{Q}_k(:,i\times r_{k+1}+j)=\operatorname{vec}\{\left(\mathcal{Z}_{k}(:,:,i)\right)\mathcal{Z}_{k}(:,:,j)^T\}$ for $k>1$ and
$$ \mathbf{Q}_1(:,i\times r_2+j)\!=\!\left\{
\begin{aligned}
\operatorname{vec}\{\left(\mathcal{Z}_{1}(:,:,i)\right)\!\mathcal{Z}_{1}(:,:,j)^T\},&~c~\text{is even} \\
\operatorname{vec}\{\left(\mathcal{Z}_{1}(:,:,j)\right)\!\mathcal{Z}_{1}(:,:,i)^T\},&~c~\text{is odd}
\end{aligned}
\right.
$$

\bibliography{ref}

\end{document}
