## 4 Methodology
For a specific node \(v\), based on the discussion above, we now perform the similarity measure to a neighbor node \(u\) as follows:  
\[D^{(k)}(v,u)=\left\|\sigma(mlp^{(k)}(o_{v}^{(k-1)}))-\sigma(mlp^{(k)}(h_{u}^{(G )}))\right\|_{1} \tag{8}\]  
where \(o_{v}^{(k-1)}\) is the updated embedding of node \(v\) at previous layer (\(k-1\)), \(h_{u}^{(G)}\) is a neighbor node embedding that is directly from the dataset. Moreover, due to the existence of \(mlp\), the dimension of output embeddings may change. The new node embedding at \(k\)-th (for \(k>1\)) layer is  
\[ \begin{split} o_{v}^{(k)}&=\sigma(o_{v}^{(k-1)}+AGG ^{(k)}(\{p_{r}^{(k)}\cdot h_{v,r},r=1,2,\cdots,R\}))+o_{v}^{(k-1)}\\ &=GNN^{(k)}(o_{v}^{(k-1)},G)+o_{v}^{(k-1)}\end{split}  \tag{9}\]  
Figure 8: The residual structure for GNN. Figure 7: Layered architecture. where \(h_{v,r}\) is the node embedding after intra-aggregate under relation \(r\). In particular, we do not adopt shortcut connection at the first layer. Moreover, the way to calculate node embedding at the first layer is  
\[ \begin{split} o_{v}{}^{(1)}&=\sigma(h_{v}^{(G)}+AGG^{ (1)}(\{p_{r}^{(1)}\cdot h_{v,r},r=1,2,\cdots,R\}))\\ &=GNN^{(1)}(h_{v}^{(G)},G)\end{split}  \tag{10}\]  
Now we give the expression of output at \(k\)-th layer:  
\[\mathbf{o}^{(k)}=GNN^{(k)}(\mathbf{o}^{(k-1)},G)+\mathbf{o}^{(k-1)} \tag{11}\]  
where \(\mathbf{o}^{(k)}\) is the new node embeddings of the batch \((o_{0}^{(k)},o_{1}^{(k)},\cdots,o_{n-1}^{(k)})\). We have mentioned that the dimension of input must equal the dimension of output. If it is not the case, we perform a linear projection with a trainable weight matrix \(W_{s}\)[5]:  
\[\mathbf{o}^{(k)}=GNN^{(k)}(\mathbf{o}^{(k-1)},G)+W_{s}\mathbf{o}^{(k-1)} \tag{12}\]  
The overall structure of RLC-GNN is shown in Figure 10. At each iteration, the input of model is a batch of nodes with features and the entire graph. The input of each layer includes the output from the previous layer and the entire graph. The output of each layer is summary of the new features extracted by the current layer from the neighbors in original graph and the input from shortcut connection. In the training process, final output loss is given by  
\[ \begin{split}\mathcal{L}_{\Sigma}=\sum_{k=1}^{L}\mathcal{L}_{ Simi}^{(k)}+\mathcal{L}_{GNN}\end{split}  \tag{13}\]  
where \(\mathcal{L}_{\Sigma}\) is final output loss which is obtained by adding up two parts. \(\mathcal{L}_{Simi}^{(k)}\) is loss of scores which is used by the similarity measure module at \(k\)-th layers to do the label-aware similarity measure. Moreover, \(\mathcal{L}_{GNN}\) is loss of the classifier that predicts labels of nodes. Both losses are calculated by using cross-entropy:  
\[ \begin{split}\mathcal{L}=-\sum_{v\in\mathcal{V}_{batch}}y_{v} \cdot\log(\sigma(mpl(h_{v})))\end{split}  \tag{14}\]  
where \(y_{v}\) is actual node label of node \(v\). Figure 9: Details of a layer of RLC-GNN. \(W_{s}\) is a trainable weight matrix to match the embedding’s dimensions between the input nodes and output nodes of the current layer. \(S_{i}\) denotes the similarity measure module for the \(i\)-th relation. We show the pseudocode of the proposed RLC-GNN in Algorithm 1. Given a heterogeneous graph, at each iteration, we initialize thresholds of neighbor selector with manually specified values and randomly select a batch of nodes with features as input for the first layer. For all subsequent layers, the input of each layer is the updated embeddings generated by previous layer, which is the result of layered structure. We first do the similarity measure, top-p sampling, and intra-relation aggregate under each relation as is shown in Equations (5) and (6). This step determines the output dimension of current layer. Then, we apply interrelation aggregate (Equation (7)) and add up the result and input (Equation (11) or Equation (12), depending on whether input and output dimensions match). Here, we get updated node embeddings.