## 3 Methodology
### Ensemble Model
```
Input: The weights of previous training step Initial_a, Initial_b, Initial_a The weight growth directions Direct_a, Direct_b, Direct_a The big fixed constant \(T\) The small fixed constant \(\eta\), \(0\leq\eta\leq 1\) The loss of previous training step \(loss_{t-1}\) The loss of current training steps \(loss_{t}\) Output: The optimized weight \(\alpha,\beta,\lambda\)
1 if\(loss_{t-1}<loss_{t}\)then
2\(\sigma=1-e^{\frac{-|loss_{t-1}-|\alpha|}{t}}\)
3\(\theta_{\alpha}\leftarrow\) Generate a random number from 0 to 1
4 if\(\theta_{\alpha}>\sigma\)then
5 ifDirect_a == \" + \"then
6\(Direct\_a=\"-\"\)
7\(\alpha\)=Initial_a - \(\eta\cdot Initial\_a\)
8 else
9\(Direct\_a=\"+\"\)
10\(\alpha\)=Initial_a + \(\eta\cdot Initial\_a\)
11 end if
12 else
13\(\alpha\)=Initial_a
14 end if
15\(\beta\) and \(\lambda\) are obtained by performing operations similar to \(\alpha\)
16 else
17\(\alpha\)=Initial_a, \(\beta\)=Initial_b, \(\lambda\)=Initial_b. 18 end if
19 return\(\alpha,\beta,\lambda\)
```  
**Algorithm 1**Weight optimization algorithm  
Inspired by the simulated annealing algorithm, we use information from the training process to continuously optimize the weight. In the training process, the goal is to minimize loss; thus, we use the change in loss as the judgment condition of weight changes. At the beginning of the training process, we initialize the weights; in addition, we randomly set the value growth direction (\(+\) or \(-\)) for each weight. If the loss of the previous step is greater than the loss of the current step, this means that the weight's settings and the value's growth direction are appropriate, and the current weights do not need to be changed. If the loss of the previous step is less than the loss of the current step, the value's growth direction should be changed, then the weight's value in the new value growth direction should be changed. To prevent falling into the local optimal solution, there is a small probability that the weight and direction may remain unchanged when the loss of the current training step is greater than that of the previous training step; this probability is controlled by the loss change in two steps. The basic process of CSEA is shown in Algorithm 2. The final evaluation function of the triple is described as follows:  
\[score=\gamma-(\alpha.dist_{1}+\beta.dist_{2}+\lambda.dist_{3}), \tag{11}\]  
where \(\gamma\) is a fixed constant and \(\alpha\), \(\beta\), and \(\lambda\) are weights. ```
Input: The triple \((head,relation,tail)\)  The fixed constant \(\gamma\)  The weights: \(\alpha\), \(\beta\), \(\lambda\)  Parameters of size: \(k\), \(c\), \(m\), \(n\)  The score of triple \((head,relation,tail)\)  Initialize \(h_{1}\), \(r_{1}\), \(t_{1}\), \(P_{1}\), \(W_{1}\), \(h_{2}\), \(t_{2}\), \(\theta\), \(x\), \(y\), \(\phi\), \(t_{2}\), \(h_{3}\), \(r_{3}\), \(t_{3}\) for triple \((head,relation,tail)\) for\(i=1\) to \(k\)do \(h_{project}[i]=Project(h_{1}[i],P_{1}[i],W_{1}[i])=\prod_{j=1}^{c}PMatrix(P_{1}[ i][j],W_{1}[i][j])h_{1}[i]\) \(t_{project}[i]=Project(t_{1}[i],P_{2}[i],W_{2}[i])=\prod_{j=1}^{c}PMatrix(P_{2}[ i][j],W_{2}[i])t_{1}[i]\) \(h_{rotate}[i]=Rotate(h_{project}[i],r_{1}[i])=\prod_{j=1}^{2n}RMatrix(r_{1}[ i][j])h_{project}[i]\)  end for \(dist_{1}=\sum_{i=1}^{k}\|h_{rotate}[i]-t_{project}[i]\|_{2}\) for\(i=1\) to \(k\)do \(\left[ \begin{array}{c}Re(h_{c\_proj}[i])\\ Im(h_{c\_proj}[i])\end{array} \right]=Pro\_Matrix(i)\left[ \begin{array}{c}Re(h_{2 }[i])\\ Im(h_{2}[i])\end{array} \right]\) \(\left[ \begin{array}{c}Re(t_{c\_proj}[i])\\ Im(t_{c\_proj}[i])\end{array} \right]=Pro\_Matrix(i)\left[ \begin{array}{c}Re(t_{2 }[i])\\ Im(t_{2}[i])\end{array} \right]\) \(\left[ \begin{array}{c}Re(h_{c\_proj}[i])\\ Im(h_{c\_proj}[i])\end{array} \right]=\left[ \begin{array}{cc}cos\phi_{i}&-sin \phi_{i}\\ sin\phi_{i}&cos\phi_{i}\end{array} \right]\left[ \begin{array}{c}Re(h_{c\_proj }[i])\\ Im(h_{c\_proj}[i])\end{array}