## 4 Materials and Methods
### DHIN Embedding Based on Meta-Path and Improved Rotate Model
#### 4.3.2 Temporal Processing Component Based on Time Decay Function  
In this work, an improved Rotate model is designed, which adds a temporal information processing component based on a time decay function to learn the effects of different meta-path instances over time. Given a meta-path instance \(\rho(v,u),u\in\mathcal{N}_{v}^{\rho}\) represents the neighbors based on the meta-path, and the set of intermediate nodes in the meta-path is \(m^{\rho(v,u)}=\rho(v,u)\{v,u\}\). Encode all nodes in this instance into a vector \(h_{\rho(v,u)}=f(\rho(v,u))=f\Big{(}h_{v}^{\prime},\ h_{u}^{\prime},\Big{\{}h_{ i}^{\prime},\forall i\in m^{\rho(v,u)}\Big{\}}\Big{)}\), where \(f(\cdot)\) represents the encoding function of \(\rho(v,u)\). There are many types of relationships in the Knowledge Graph, such as symmetric relationships, asymmetric relationships, semantically opposite relationships, compound relationships, etc. Traditional translation models can model semantically opposite relationships and compound relationships, while Bilinear models can model symmetric relationships, but no one model can model and infer all types of relationships. Inspired by  
Figure 2: The Framework of the MRDE model. [PERSON]'s formula (\(e^{i\theta}=cos\theta+isin\theta\)), [PERSON] et al. modeled the relationship as a rotation from the head entity to the tail entity and proposed the Rotate model [35]. Rotate is able to model all relation types and has achieved breakthroughs in problems such as link prediction. This work introduces Rotate model and proposes an improved Rotate model to make full use of complex structural and semantic information in DHIN. Let \(\rho(v,u)=(x_{0},x_{1},\cdots,x_{n})\), where \(x_{0}=v\), \(x_{n}=u\), \(r_{i}\) is the relation vector between relation nodes \(x_{i}\) and \(x_{i-1}\). The improved Rotate process is as follows:  
\[o_{0}=h^{\prime}_{x_{0}}=h^{\prime}_{v}, \tag{4}\]  
\[o_{i}=h^{\prime}_{x_{i}}+o_{i}\odot r_{i}^{\prime}, \tag{5}\]  
\[h_{\rho(v,u)}=\frac{o_{n}}{n+1}, \tag{6}\]  
where \(\odot\) is the Hadamard product. Given a node \(v\), a series of meta-path instances in meta-path \(\rho\), and their corresponding timestamps, i.e., \(v\rightarrow\{(\rho(v,u)_{1},t_{1}),(\rho(v,u)_{2},t_{2}),\cdots(\rho(v,u)_{n },t_{n})\}\), the influence of each instance on the target node can be calculated as follows:  
\[\lambda_{m}=softmax\Big{(}\widetilde{\lambda_{m}}\Big{)}=\frac{\exp( \widetilde{\lambda_{m}})}{\sum_{l=1}^{n}\exp(\widetilde{\lambda_{l}})}, \tag{7}\]  
\[\widetilde{\lambda_{m}}=\alpha_{i}u_{v,\rho(v,u)_{i}}k(t-t_{i}), \tag{8}\]  
\[k(t-t_{i})=\exp(\delta_{s}(t-t_{i})), \tag{9}\]  
\[u_{v,\rho(v,u)_{i}}=f_{\theta}(v,\rho(v,u)_{i})=-\|h^{\prime}_{v}-h_{\rho(v,u )_{i}}\|^{2} \tag{10}\]  
It should be pointed out that, in order to evaluate the impact of different timestamps, this work builds a meta-path change model based on the time decay function with the following assumptions: when an instance just acts on the target node, it can be considered that it has the greatest impact on the target node at this moment, but if there is no continuous stimulus for a certain period time, the influence of the instance on the target node will continue to decay. Influenced by [46], we designed a time decay function \(k(\cdot)=\exp(\delta_{s}(t-t_{i}))\), that is, according to the time sequence, the time factor and influence degree are connected by defining the attenuation function and attenuation strategy. Here \(t\) is the current time, when \(t_{i}\) is close to \(t\), \(\rho(v,u)_{i}\) has a greater impact on \(v\); \(\delta_{s}\) represents the learnable decay rate; \(u_{v,\rho(v,u)_{i}}\) measure the similarity between \(v\) and \(\rho(v,u)_{i}\), where the Euclidean distance is used to measure the similarity.