# CDSTAEP: Cross-Domain Spatial-Temporal Association Learning for Abnormal Events Prediction
## 4 Methodology
### Graph Representation Learning in Mixed-Curvature Spaces
#### 4.2.1 Metric and Map Representations in Curvature Spaces
Particularly, matrix left multiplication is the basic operation on the value range of embedded vector \(X\); that is, the result of matrix left multiplication is to obtain the change of the value of embedded vector \(X\), which is the latest result of vector fusion we expect to obtain. The right multiplication of the matrix is to change the base of the domain of the definition, so the result of the right multiplication is not what we expected. We fuse the support of nodes with node representation through left matrix multiplication, and finally obtain node \(x_{i}\) aggregate representation, including the support of all neighbor nodes. The calculation definition of the combination of support and representation is as follows:  
\[(S\boxtimes_{k}X)_{i\bullet}:=\left(\sum_{j}S_{ij}\right)\bigotimes_{k}m_{k}( X_{1\bullet},X_{2\bullet},\cdots,X_{i\bullet};S_{i\bullet}) \tag{20}\]  
where \(S\) is the support adjacency matrix of embedded vector matrix \(X\), \(\boxtimes_{k}\) means \(\kappa\)-left-matrix-multiplication, \(S=\sum_{j}S_{ij}\), Euclidean midpoint function \(m_{k}\) is defined as follows:  
\[m_{k}(X_{1\bullet},X_{2\bullet},\cdots,X_{n\bullet};S_{i\bullet})=\frac{1}{2 }\bigotimes_{k}\left(\sum_{i=1}^{n}\frac{S_{ij}\lambda_{x_{i\bullet}}^{K}}{ \sum_{j=1}^{n}S_{ij}\Big{(}\lambda_{x_{j\bullet}}^{K}-1\Big{)}}X_{i\bullet}\right) \tag{21}\]  
where \(\lambda_{x_{i\bullet}}^{K}\) has been defined in Formula (17). In GNN, for a component space \(\mathcal{M}_{i}\) with any curvature \(k_{i}\), if the current layer is \(l\), then the input of layer \(l\) is \(X_{\mathcal{M}_{i}}^{l-1}\), and the output can be summarized as the following general expression:  
\[X_{\mathcal{M}_{i}}^{(l)}=\sigma^{\otimes_{k}}\Big{(}S_{\mathcal{M}_{i}}^{(l) }\boxtimes_{k}\Big{(}X_{\mathcal{M}_{i}}^{(l-1)}\bigotimes_{k}W_{\mathcal{M}_ {i}}^{(l-1)}\Big{)}\Big{)} \tag{22}\]  
where \(\Big{(}X_{\mathcal{M}_{i}}^{(l-1)}\bigotimes_{k}W_{\mathcal{M}_{i}}^{(l-1)} \Big{)}_{i\bullet}:=exp_{0}^{k}\Big{(}log_{0}^{k}\Big{(}\Big{(}X_{\mathcal{M} _{i}}^{(l-1)}\Big{)}_{i\bullet}\Big{)}W_{\mathcal{M}_{i}}^{(l-1)}\Big{)}\). (3) Across-Component Spaces Learning  
In GNN, cross-component space learning is used to fuse node representations from multiple different curvature spaces. First, in order to facilitate the subsequent calculation of GNN, we encode multi-curvature spaces in tangent space, calculate the mean value of node features in multi-curvature spaces through mean pooling, and perform forward propagation in the GNN model. The calculation formula for mean pooling is as follows:  
\[\mu=Pooling\left(log_{0}^{k}\left(W_{i}\bigotimes_{k}x_{\mathcal{M}_{i}}\right)\right) \tag{23}\]  
where \(x_{i}\in\) X, W \(\in\mathbb{R}^{d\times\varepsilon}\) is the Euclidean shared weight matrix, and \(log_{0}^{k}\) denotes the logarithmic map at the origin 0 in the \(\kappa\)_-stereographic_ model. Next, we calculate the support between nodes in different curvature spaces by \(\theta_{cross-space}\):  
\[s_{cross-space}\left(x_{\mathcal{M}_{i}},\mu\right)=\sigma\Big{(}\theta_{ cross-space}^{\top}\left(log_{0}^{k}\left(W_{i}\bigotimes_{k}x_{\mathcal{M}_{i}} \right)-\mu\right)\Big{)} \tag{24}\]  
where \(\sigma(\cdot)\) is the sigmoid. Next, we calculate the normalized support between nodes through the softmax function:  
\[\hat{w}_{i}=\frac{exp\big{(}s_{cross-space}\big{(}x_{\mathcal{M}_{i}},\mu\big{)} \big{)}}{\sum_{k\in\mathcal{N}_{i}}exp\big{(}s_{cross-space}\big{(}x_{ \mathcal{M}_{k}},\mu\big{)}\big{)}} \tag{25}\]  
Finally, we connect the node representations from the multi-curvature space to obtain the fused weighted representation of the relationship nodes in the multi-curvature Riemannian space:  
\[x=\parallel_{i}^{k}\left(\hat{w}_{i}\bigotimes_{k}x_{\mathcal{M}_{i}}\right) \tag{26}\]  
where \(\mid\mid\) means vector concatenation and \(\bigotimes\) means multiplication of space vectors. The final output is the fused vector sequence \(x^{R}=\left\{x_{1}^{R},x_{2}^{R},\ldots,x_{k}^{R}\right\}\) in the Riemannian space, where \(R\) means the Riemannian space.