# Recommendation Algorithm for Multi-Task Learning with Directed Graph Convolutional Networks
## 3 Multi-Task Learning Recommendation Model for Directed Graph Convolutional Networks
### DGCN Layer of the DGCNR Layer  
This section draws on DGCN proposed by [PERSON] et al. [46] to define the learning process of the node vector in the graph. The user micro-behavior feature matrix \(X\) obtained by the input layer and the proximity matrices \(A_{F}\), \(A_{Sim}\), and \(A_{Sout}\) of the directed graph obtained by the preprocessing layer are used as the input data of the DGCN layer. The convolution operation are performed on \(X\), \(A_{F}\), \(A_{Sim}\), and \(A_{Sout}\) is shown in the Formulas (3)-(5). \[Z_{F}=\widetilde{D}_{F}^{-\frac{1}{2}}A_{F}\widetilde{D}_{F}^{-\frac{1}{2}}X\odot \tag{3}\]  
\[Z_{Sim}=\widetilde{D}_{Sim}^{-\frac{1}{2}}A_{Sim}\widetilde{D}_{Sim}^{-\frac{1} {2}}X\odot \tag{4}\]  
\[Z_{Sout}=\widetilde{D}_{Sout}^{-\frac{1}{2}}A_{Sout}\widetilde{D}_{Sout}^{-\frac {1}{2}}X\odot \tag{5}\]  
Among them, \(\odot\) is the linear transformation operation based on the parameters \(\{W,b\}\) (there is no expression under the activation function). \(\widetilde{D}_{F}\), \(\widetilde{D}_{Sim}\), \(\widetilde{D}_{Sout}\) represent the augmented matrices of the first-order degree matrix, the second-order in-degree degree matrix, and the second-order out-degree degree matrix. \(\widetilde{A}_{F}\), \(\widetilde{A}_{Sim}\), and \(\widetilde{A}_{Sout}\) represent the augmented matrices of the first-order proximity matrix, the second-order in-degree proximity matrix, and the second-order out-degree proximity matrix. \(X\) represents the micro-behavior feature matrix. Then, the augmented matrix \(\widetilde{A}_{x}\) of the proximity matrix \(A_{x}\) and the augmented matrix \(\widetilde{D}_{x}\) of the degree matrix \(D_{x}\) are defined, as shown in Equations (6) and (7). \[\widetilde{A}_{x}=A_{x}+\mathbbm{J}I \tag{6}\]  
\[\widetilde{D}_{x}=D_{x}+\mathbbm{J}I \tag{7}\]  
where \(x\in\{F,Sin,Sout\}\), \(\mathbbm{J}\) is a parameter, \(I\) is the identity matrix. The degree matrix corresponding to the proximity matrix \(A_{x}\in R^{n\times n}\) is \(D_{x}\), its calculation rule is shown in Formula (8). \[D_{x}(i,i)=\sum_{j}^{n}A_{x}(i,j) \tag{8}\]  
It can be seen that \(Z_{F}\), \(Z_{Sim}\), and \(Z_{Sout}\) not only obtain rich first-order and second-order proximity feature information, but \(Z_{Sim}\) and \(Z_{Sout}\) also retain the directed graph structure information. Based on these facts, we further design a fusion method to integrate the three signals together, so as to retain the characteristics of the directed structure while obtaining the surrounding information. Directed graph fusion operation \(\Gamma\) is a signal fusion function of the first-order proximity convolution output \(Z_{F}\), the second-order in-degree proximity convolution output \(Z_{Sim}\), and the second-order out-degree proximity convolution output \(Z_{Sout}\). \(L\) is the sum of the nodes. \[Z_{L}=\Gamma(Z_{F},Z_{Sim},Z_{Sout}) \tag{9}\]  
For a given user micro-behavior feature matrix X and a directed adjacency matrix A, after taking all the steps above, we can get the final directed graph result \(Z_{L}=f(X,\text{A})\). A good model should consider global preference and local preference [48]. After the convolution operation, the aggregation result \(Z_{L}\) of the proximity nodes of each node is obtained as the local preference of the session, in order to represent the global preference of the session and consider that the information in the node embedding may have different priorities, this paper adopts a soft-attention mechanism [49] (soft-attention) to assign appropriate weights to each proximity node embedded in the session. Specifically, for each node, \(Z_{t}(1\leq t\leq L)\), its attention weight calculation formula is shown in (10). \[a_{t}=\beta^{\intercal}\sigma(W_{1}Z_{L}+W_{2}Z_{t}+b_{a}) \tag{10}\]  
\(b_{a}\) is the bias, \(\beta\in R^{3d}\), \(W_{1}\), \(W_{2}\in R^{3d\times 3d}\) are the weight parameters, then the global session representation is shown in Formula (11).