# 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
The operator, metric calculation, logarithmic mapping function, exponential mapping function in Euclidean space, and \(\kappa\)_-stereographic_ model are shown in Formulas (7)-(16) and \[exp_{x}(v)=x+v \tag{8}\]1  
The key to representation learning is to obtain the representation of event relations in Euclidean space, hyperbolic space, and spherical space, respectively, and then fuse the node representation in mixed-curvature space to achieve the representation of complex relations between events. (2) Single-Component Space Learning  
In GNN, single-component space learning is used to learn the event association graph structure in the constant curvature space. In this layer, for a constant curvature space, we introduce Attention to learn to assign weights and aggregate the representations of all adjacent nodes \(x_{i}\). Since each neighbor node \(x_{j}\) of \(x_{i}\) has a different importance to \(x_{i}\), we introduce edge support to learn the importance of neighbor nodes. Specifically, we first use the logarithmic function \(log_{0}^{k}\) to map the current node \(x_{i}\) to the tangent space to use mature calculation methods in Euclidean space and use \(\theta_{single-space}\) to model the importance of neighbor nodes. For an n-dimensional matrix \(\mathsf{X}\in\mathbb{R}^{n\times d}\), \(d\) is the embedding dimension, and the edge support is calculated as follows:  
\[exp_{x}(v)=x+v \tag{8}\]2 \begin{table}
\begin{tabular}{c c c} \hline \hline
**Operation** & **Formalism in \(\mathbb{E}\)** & **Formalism in \(\mathbb{H}/\mathsf{S}\)** \\ \hline Addition & \(x\bigoplus_{k}y=x+y\) & \(x\bigoplus_{k}y=\frac{\big{(}1+2 kx^{i}y+K||y||^{2}\big{)}+\big{(}1-K||x||^{2} \big{)}y}{1+2 kx^{i}y+K||y||^{2}\big{[}||x||^{2}\big{]}}\) \\ Scalar-vector Multiplication & \(r\bigoplus_{k}x=rx\) & \(r\bigoplus_{k}x=exp_{0}^{k}\big{(}\text{r}log_{0}^{k}(x)\big{)}\) \\ Matrix-vector Multiplication & \(M\bigoplus_{k}x=Mx\) & \(M\bigoplus_{k}x=exp_{0}^{k}\big{(}\text{M}log_{0}^{k}(x)\big{)}\) \\ Applying Functions & \(f^{\bigoplus_{k}}(x)=f(x)\) & \(f^{\bigoplus_{k}}(x)=exp_{0}^{k}\Big{(}f\Big{(}log_{0}^{k}(x)\Big{)}\Big{)}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Basic operation formulas in Riemann space. where \(x_{i}\in X_{i}\), \(W\in\mathbb{R}^{d\times e}\) is the Euclidean shared weight matrix, \(\sigma(\cdot)\) is the logistic sigmoid function \(\frac{1}{1+exp(-x)}\), and \(log_{0}^{k}\) denote the logarithmic map at the origin 0 in the \(\kappa\)-_stereographic_ model. Then, normalize the calculation of the support:  
\[\hat{S}_{ij}=\frac{exp\Big{(}s_{single-space}\big{(}x_{i},x_{j}\big{)}\Big{)}} {\sum_{k\in\mathcal{N}_{i}}exp\Big{(}s_{single-space}(x_{i},x_{k})\Big{)}} \tag{19}\]  
where \(\hat{S}\) is the normalized edge support, \(\mathcal{N}_{i}\) is the index of the neighbor node of node \(x_{i}\) in the graph, \(k=(i,j,\cdots,n)\). Then, we use the self-loop in the attention-based GNN to keep the previous step information, that is, \(S=I+\hat{S}\), \(I\) is the identity matrix, and \(exp_{0}^{k}\) denote the exponential map at the origin 0 in the \(\kappa\)-_stereographic_ model. Next, the combination of support and representation is carried out. For the GNN, the expression of the relationship between nodes is to combine the embedding vectors of each node. This paper uses the combination of node support and node representation. In Euclidean space, the fusion of embedding vectors is given by the left multiplication [11; 16] of the adjacency matrix of the embedding matrix with the embedding matrix, resulting in the matrix product \((AX)_{i\bullet}=A_{i1}X_{1\bullet}+\cdots+A_{in}X_{i\bullet}\). That is, the new representation of node \(i\) is obtained by calculating the linear combination of all neighbor node embeddings of node \(i\), where the linear combination is weighted by the \(i\)-th row of the adjacency matrix \(A\).