# Knowledge Reasoning via Jointly Modeling Knowledge Graphs and Soft Rules
## 4 Experiments and Results
### Link Prediction
#### 4.2.3 Implementation Details  
On FB15K and DB100K, we compared Iterlogic-E against all of the baselines. We immediately obtained the results of a set of baselines on FB15K and DB100K from SoLR, SLRE, and CAKE. We implemented the ComplEx model using the PyTorch framework, utilizing the code provided by [24] ([[https://github.com/DeepGraphLearning/KnowledgeGraphEmbedding](https://github.com/DeepGraphLearning/KnowledgeGraphEmbedding)]([https://github.com/DeepGraphLearning/KnowledgeGraphEmbedding](https://github.com/DeepGraphLearning/KnowledgeGraphEmbedding)), accessed on 21 September 2023) as a basis for our implementation. Then, depending on our implementation, we provided the ComplEx result. Furthermore, we evaluated the IterE model on the FB15K-sparse dataset created by [16]. This dataset consisted of sparse entities with validation and test sets containing 18,544 and 22,013 triples, respectively. Therefore, we implemented IterE on FB15K and DB100K based on the code and hyperparameters ([[https://github.com/wencolani/IterE](https://github.com/wencolani/IterE)]([https://github.com/wencolani/IterE](https://github.com/wencolani/IterE)), accessed on 21 September 2023) released by the author. As a result, we compared our approach to IterE  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **\# Train/Valid/Test** & **\# Rel** & **\# Ent** & **\# Rule** \\ \hline FB15K & 483,142/50,000/59,071 & 1345 & 14,951 & 441 \\ DB100K & 597,572/50,000/50,000 & 470 & 99,604 & 25 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The datasets’ statistics are presented, with each column representing the quantities of training/validation/test triples, relations, entities, and soft rules. “#” indicates number.  
\begin{table}
\begin{tabular}{c} \hline \hline /location/contains(\(y,x\))\(\overset{0.84}{\Rightarrow}\)/location/containedby(x,y) \\ /production_company/films(\(y,x\))\(\overset{0.89}{\Rightarrow}\)/location/containedby(x,y) \\ /hud_county_place/place(\(x,y\))/hud_county_place/county(\(y,z\)) \\ \(\overset{1.0}{\Rightarrow}\)/hud_county_place/county(\(x,z\)) \\ \(\overset{1.0}{\Rightarrow}\)/hud_county_place/county(\(x,z\)) \\ \(\overset{1.0}{\text{sisterNewspaper}(x,y)\)/\(\overset{0.82}{\Rightarrow}\) sisterNewspaper(\(x,y\))\(\overset{0.91}{\Rightarrow}\) distributing\(\text{Company}(x,y)\)\(\overset{0.99}{\Rightarrow}\)stateOforigin(\(x,y\)) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Examples of rules that have been extracted. The upper part is three rules mined from the FB15K dataset, and the lower part is three rules mined from the DB100K dataset.  
and SoLE on the FB15K-sparse dataset. Both approaches use a logistic loss and optimize in the same way (SGD with AdaGrad). The remaining baseline results were taken directly from previous literature. We conducted hyperparameter tuning during our experiments. Specifically, we varied the embedding dimensionality \(d\) within the set [100, 150, 200, 250, 300], the number of negatives per positive triple \(\eta\) within the set [2, 4, 6, 8, 10], the initial learning rate \(\gamma\) within the set \(\{10^{-4},10^{-3},10^{-2},5\times 10^{-2},10^{-1}\}\), and the L2 regularization coefficient \(\mu\) within the set \(\{10^{-5},3\times 10^{-5},10^{-4},10^{-3},3\times 10^{-3},10^{-2}\}\). For margin-based ranking loss approaches, we also tuned the margin within the set {0.1, 0.2, 0.5, 1, 2, 5, 12, 18, 24}. We selected the best hyperparameters based on maximizing the mean reciprocal rank (MRR) on the validation set. For Iterlogic-E, the best settings were \(d=300\), \(\gamma=10^{-3}\), \(\eta=10\), and \(\mu=3\times 10^{-5}\) on the FB15K dataset and \(d=300\), \(\gamma=10^{-4}\), \(\eta=10\), and \(\mu=10^{-4}\) on the DB100K dataset.