# MSEN: A Multi-Scale Evolutionary Network for Modeling the Evolution of Temporal Knowledge Graphs
## 3 The Proposed Method
### Global Memory Encoder  
To extract cross-timestamp entity dependencies, we construct a global knowledge graph by associating historical snapshots containing the same entities [28]. We introduce a Time-Related Graph Neural Network (TR-GNN) to effectively encode this global graph.  
The global graph aggregates facts across timestamps, including periodic and non-periodic occurrences. To fully utilize this temporal information, we design separate periodic and aperiodic time vector representations:  
\[\mathrm{T}^{\mathrm{P}}=\mathrm{f}(\mathrm{w}_{1}\mathrm{t}+\varphi_{1}), \tag{13}\]  
\[\mathrm{T}^{\mathrm{ap}}=\mathrm{w}_{2}\mathrm{t}+\varphi_{2}, \tag{14}\]  
where \(\mathrm{T}^{\mathrm{P}}\) is the periodic time vector; \(\mathrm{T}^{\mathrm{ap}}\) is the non-periodic time vector. \(\mathrm{w}\) and \(\varphi\) are learnable vectors, representing frequency and phase respectively. \(\mathrm{f}(\cdot)\) is a periodic activation function, which is \(\sin\) function in the paper. \(\mathrm{t}\) represents the time interval \(\left|\mathrm{T}_{\mathrm{i}}-\mathrm{T}_{\mathrm{j}}\right|\) between two connected entities in the global knowledge graph.  
To obtain the time-semantic dependencies between entities in the global knowledge graph, the paper designs TR-GNN to encode the knowledge graph:  
\[(\mathrm{h}_{\mathrm{o,t}})^{\mathrm{t+1}}=\sigma\bigg{(}\sum{}_{(\mathrm{s},\mathrm{r})\in\mathrm{N}_{\mathrm{t}}}(\alpha_{1}^{1}\mathrm{h}_{\mathrm{s,t }}^{1}+\alpha_{2}^{1}\Big{(}\mathrm{h}_{\mathrm{r,t}}^{1}\Big{)}^{\prime} \bigg{)}+\mathrm{w}_{2}(\mathrm{h}_{\mathrm{o,t}})^{1}\bigg{)}, \tag{15}\]  
\[\Big{(}\mathrm{h}_{\mathrm{r,t}}^{1}\Big{)}^{\prime}=\mathrm{h}_{\mathrm{r,t} }^{1}+\mathrm{T}^{\mathrm{P}}, \tag{16}\]  
where \((\mathrm{h}_{\mathrm{o,t}})^{\mathrm{t+1}}\) is the encoded entity embedding. \(\mathrm{w}_{2}\) is a learnable weight parameter. \(\alpha_{1}^{1}\) and \(\alpha_{2}^{1}\) are weights for entities and relations respectively, calculated as follows:  
\[\alpha_{1}^{1}=\frac{\exp\Big{(}\mathrm{h}\Big{(}\mathrm{L}\Big{(}\Big{[} \mathrm{h}_{\mathrm{s,t}}^{1}\Big{\|}\mathrm{h}_{\mathrm{o,t}}^{1}\Big{\|} \mathrm{T}^{\mathrm{ap}}\Big{]}\Big{)}\Big{)}\Big{)}}{\sum_{(\mathrm{s}, \mathrm{r})\in\mathrm{N}_{\mathrm{t}}}\exp\Big{(}\mathrm{h}\Big{(}\mathrm{L} \Big{(}\Big{[}\mathrm{h}_{\mathrm{s,t}}^{1}\Big{\|}\mathrm{h}_{\mathrm{o,t}}^ {1}\Big{\|}\mathrm{T}^{\mathrm{ap}}\Big{]}\Big{)}\Big{)}\Big{)}}, \tag{17}\]  
\[\alpha_{2}^{1}=\frac{\exp\Big{(}\mathrm{h}\Big{(}\mathrm{L}\Big{(}\Big{[} \mathrm{h}_{\mathrm{r,t}}^{1}\Big{\|}\mathrm{h}_{\mathrm{o,t}}^{0}\Big{\|} \mathrm{T}^{\mathrm{ap}}\Big{]}\Big{)}\Big{)}\Big{)}}{\sum_{(\mathrm{s}, \mathrm{r})\in\mathrm{N}_{\mathrm{t}}}\exp\Big{(}\mathrm{h}\Big{(}\mathrm{L} \Big{(}\Big{[}\mathrm{h}_{\mathrm{r,t}}^{1}\Big{\|}\mathrm{h}_{\mathrm{o,t}}^ {1}\Big{\|}\mathrm{T}^{\mathrm{ap}}\Big{]}\Big{)}\Big{)}\Big{)}}. \tag{18}\]  
Using the non-periodic time vector to compute weights for entities and relations better captures the temporal-semantic relationships between entities. Finally, the updated entity embeddings are nonlinearly transformed to obtain the embedding representations of each entity in the global knowledge graph.