# Multi-Relational Graph Convolution Network for Service Recommendation in Mashup Development
## 3 Multi-Relational GCN Based Service Recommendation Model
### Overall Framework
#### 3.2.2 Graph Convolution  
In the previous section, we enrich the information beyond mashup-service composition record with content and tag information, and build a graph with three relations. In this section, we propose to exploit the multi-faceted relations between mashups and services with a graph convolutional network with relation fusion. Graph convolutional network (GCN) extends the convolutional neural network to graph-structured data, and it exploits the high-order interactions between the nodes [31]. The core idea behind GCN is to iteratively aggregate feature information from local neighbors for each node using neural networks. A single layer of GCN transforms and aggregates feature information from the node's direct neighbors, and by stacking multiple layers, feature information can be propagated across long ranges, and the node features can be enhanced with sufficient high-order neighbor information. The reason we use GCN is that it can leverage both node features as well as graph structure, and it can explore the relation information among nodes that are not directly connected. We first describe the GCN model for a single type of relation, then we extend it with a fusion of multiple relations. Given the mashup-service graph \(\mathcal{G}=(\mathcal{V},\mathcal{E},\mathcal{R}_{*},\mathcal{W})\) with a single relation, where \(\mathcal{R}_{*}\) could be either \(\mathcal{R}_{C}\), \(\mathcal{R}_{D}\) or \(\mathcal{R}_{T}\), in each layer of GCN, the goal is to learn a function which takes the features of every node and the graph structure represented as an adjacency matrix, and produce the transformed features of each node. Supposing that the adjacency matrix representing that relation is \(A\), the function for the graph propagation step is:  
\[H^{(l+1)}=\text{ReLU}\Big{(}D^{-\frac{1}{2}}(A+I)D^{-\frac{1}{2}}H^{(l)}W^{(l) }\Big{)}, \tag{1}\]  
where \(H^{(l)}\in\mathbb{R}^{N\times d_{l}}\) is the feature matrix at the \(l\)-th layer, \(W^{(l)}\in\mathbb{R}^{d_{l}\times d_{l-1}}\) is the weight matrix for feature transformation in the \(l\)-th layer. \(I\) is the identity matrix, and \(D\) is the diagonal degree of matrix \(A+I\), which is calculated as \(D_{ii}=1+\sum_{j}A_{ij}\). ReLU is the nonlinear activation function. To write Equation (1) in a vector form for a single node \(i\):  
\[h_{i}^{(l+1)}=\text{ReLU}\Big{(}\sum_{j}\frac{1}{\sqrt{|N_{i}||N_{j}|}}W^{(l) }h_{j}^{(l)}\Big{)}, \tag{2}\]  
where \(j\) is the neighboring node of node \(i\) including node \(i\) itself. \(N_{i}\) and \(N_{j}\) denote the neighbors of node \(i\) and \(j\). We can see that the feature propagation in each layer consists of several steps: first, the feature of each node is transformed through the matrix \(W^{(l)}\), then the transformed feature is propagated to the neighboring node, and each node receives the features from its neighboring nodes including itself and adds them together with a normalization term to maintain the scale of the feature vectors. Finally, the aggregated features are going through the ReLU activation function to encode only positive signals. By stacking multiple propagation layers defined in Equation (1), each node is capable of receiving features from nodes that are \(l\)-hop away, and the higher-order relation between mashups and services can be explored. Such high-order relation information can encode the potential relation between the mashup and service that are not connected directly but are 2-hops or 3-hops away, and this latent relation can be crucial to infer the potential composition relation between the mashup and service. Figure 1 shows an example of a 2-layer GCN that computes the feature representation \(h_{m_{2}}^{(2)}\) of mashup \(m_{3}\) in layer 2. It aggregates the features learned from the previous layer \(h_{m_{3}}^{(1)}\) and its neighbors \(h_{m_{1}}^{(1)}\), \(h_{s_{2}}^{(1)}\), and \(h_{s_{3}}^{(1)}\), and the feature representations in layer 1 are aggregated from the initial node features. \(h_{s_{3}}^{(2)}\) are learned in the same way.