# MBHAN: Motif-Based Heterogeneous Graph Attention Network
## 4 The Proposed Method
### Node Feature Mapping Mechanism  
Having presented the details of the model for deep learning of the node-level and motif subgraph-level attention mechanisms, we now need to consider the incompatibility of feature spaces due to the heterogeneity of the nodes. By seeking to preserve the rich semantics contained in different types of nodes and their links during the graph representation learning process, we are obliged to deal with there being different feature spaces for different types of nodes. Many meta-path-based heterogeneous graph representation learning methods transform heterogeneous graphs into homogeneous graphs for analysis [19; 20]. This results in a loss of semantic information for the non-end nodes in the meta-paths. MBHAN aims to learn the embedding of global nodes. In the motif subgraphs subdivided by node types, the node-level attention learning process usually aggregates neighborhood information that is different from the current type of node. In real-world graph datasets, it is also quite possible that only features of specific types of nodes can be accurately extracted. In the DBLP heterogeneous graph dataset shown in Figure 1a, for instance, only features of Paper-type nodes (bag-of-words vectors) can be observed, while features relating to the Author, Term, and Conference-type nodes cannot be easily obtained. To address the above problem, one can create a matrix, \(M_{\sqcup i}\), that is specific to the type transformation to project the features of different types of nodes into the same feature space. The feature conversion process for node \(v_{i}\) can be formulated as follows:  
\[h_{i}^{\prime}=M_{t_{i}}\cdot h_{i}, \tag{12}\]  
where \(h_{i}\) and \(h_{i}^{\prime}\) are the original and transformed features of node \(v_{i}\). In MBHAN, this type of transformation is implemented by employing a shallow perceptron whose output dimensionality is consistent with that of the node features that already exist. The specific feature transformation matrix parameters of the model can be guided and learned according to particular downstream tasks throughout the training process. Note that, when undertaking a feature transformation process for multiple types of nodes, the perceptron models should be segregated from each other, i.e., \(M_{t}\
eq M_{t^{\prime}}\). We expect this type of transformation process to only serve for specific node types, where it is important to avoid any possible interference between different types of nodes. Although Equation (12) provides the process for feature transformation, it does not address the problem of missing node features in heterogeneous graphs. Looking at graph representation learning methods based on a random walk strategy [24; 43; 44], there is an essential assumption being made: that the rich semantic interactions between node pairs will be reflected in the structure of the heterogeneous graphs. So, if an author has numerous important paper nodes connected to him (her) in the field of data mining, it means that the author has contributed significantly to the field of data mining, and vice versa. If this assumption is correct, the node features obtained by graph analysis from the node connectivity patterns can describe the knowledge contained in the nodes from another perspective (i.e., a graph structure perspective). A classic \"random walk + Skip-Gram\" strategy is therefore typically included in the heterogeneous graph feature preprocessing process. In this paper, MBHAN adopts the approach of [PERSON] et al. [45], where parametrically controlled node sequence selection is applied during the random walk process:  
\[\alpha_{pq}(s,c)= \begin{cases}\frac{1}{p^{\prime}},&if\ d_{sx}=0\\ 1,&if\ d_{sx}=1\\ \frac{1}{q},&if\ d_{sx}=2\end{cases}