# An Inference Framework of Markov Logic Network for Link Prediction in Heterogeneous Networks
## 5 Experiments
### Experiment Settings  
**Datasets.** Our experiments were carried out on five heterogeneous networks: the academic network, Aminer; the network of relatives, Kinship [30]; the medical relation network, UMLS [11]; the word net WN18 RR [29]; and the social knowledge base Freebase15k-237 [33]. The dataset statistics are presented in Table 3.  
**Formulas.** Logical formulas for multi-relational LP tasks were devised for each dataset and translated into inferences within MLN. Specific formulas for each dataset are delineated in Table 4.  
**Comparison methods.** We compared two types of methods: deep learning-based methods including SEAL [12] and Matrix Factorization (MF) [16], and MLN-based methods including ExpressGNN [30], PlogicNet [11], Pgat [26], RNNlogic [29], and MLN [10]. The latter category employs MLN to model heterogeneous networks, facilitating learning and inferences for diverse downstream tasks. They are summarized as follows:  
* **SEAL** adopts GNN for node representation by learning the structural information.
* **MF** transforms the representation matrix into multiplication of matrices to enhance node representation.
* **ExpressGNN** uses a GNN variant to conduct the variational inference in MLN structures.  
\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Dataset** & **\#Entity** & **\#Relation Type** & **\#Relation** \\ \hline FB15k-237 & 14,541 & 237 & 592,213 \\ WN18 RR & 40,943 & 11 & 93,003 \\ Aminer & 3,804,789 & 2 & 8,024,869 \\ Kinship & 104 & 25 & 10,686 \\ UMLS & 135 & 46 & 6529 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Statistics of datasets.  
* **PlogicNet** uses GNN to embed the graphical structures and incorporates the weights of formulas by VEM.
* **Pgat** incorporates graph attention network embeddings to infer the relations.
* **RNNlogic** leverages recurrent neural networks to generate high-quality formulas for inferences in MLN.
* **MLN** uses SRL-based methods to generate posterior distributions of nodes in MLN.  
**Implementation.** We utilized accuracy to evaluate the efficacy of our proposed method, defined as the ratio of correct predictions generated by the LP methods. Efficiency was assessed through execution time, encompassing the overall time for parameter updates and link predictions.  
For the learning-based methods, we treated the evidence nodes in MLN and their labels as the training and test sets, respectively. To execute multi-relational LP using MLN, we formulated the MLN structure for each dataset. In the case of the Aminer dataset, we randomly selected subsets by varying the sizes from 10,000, 5000, 2000, to 1000 individuals. SEAL and MF were applied to the datasets for each link type, with the average accuracy serving as the LP outcome. For robust evaluation, we repeated each experiment 5 times with different random seeds and reported the mean performance along with standard deviation. For each experimental configuration, the training and testing processes were executed independently, maintaining consistent hyperparameter settings across all runs to ensure fairness.  
Our experiments were conducted on a machine equipped with a 6000 Ada GPU, 128 GB of memory, and an i9-9900K CPU. All implementations were carried out using Python 3.7. We primarily used PyTorch v1.12.1 and ProbCoG libraries.