# Learning Embedding for Signed Network in Social Media with Hierarchical Graph Pooling
## 4 Proposed Signed Network Embedding with Hierarchical Graph Pooling
### Global Signed Graph Aggregation  
Hierarchical graph pooling improves network embedding through graph pooling techniques. Convolutional neural networks for Euclidean data use pooling layers. Theyminimize the feature graph size and broaden the perceptual field, improving feature generalization and extraction. Graph pooling layers, which are similar to standard convolutional neural networks, are proposed for the generation of graph-level representations. Early graph pooling layers were typically constructed to be flat. They built graph-level representations straight from node-level representations in a single operation. As an illustration, a graph neural network might apply either an average pooling or a maximum pooling to each feature channel in order to create a graph-level representation. Hierarchical graph pooling was later created with the goal of capturing the information contained in a graph by gradually coarsening the original graph, which was developed later. Inspired by the above theory, we designed a hierarchical graph pooling layer on signed networks, which is applied to learn the importance of different nodes from different node sets (balanced node set and unbalanced node set). The operation selects a subset of nodes to form a new but small graph in a signed network when aggregating and propagating information. As shown in Figure 3, given the input graph with four nodes, each of them has three features. Then we can obtain the input feature matrix \(\text{X}^{\ell}\in\mathbb{R}^{4\times 3}\). By adding the trainable projection vector \(\text{P}\), the features of the nodes can be mapped to 1D. Then, the top-k nodes with high scores are selected with the help of a sigmoid function, and the index information is recorded. Finally, the index selection process preserves the position order information in the original graph and the adjacency matrix of the new graph \(\text{A}^{\ell+1}\) and \(\text{X}^{\ell+1}\) can be obtained through the selected index. As previously stated, node embeddings from the local graph convolution function are classified into two types: positive embedding hp and negative embedding hn. These two types of embeddings have different characteristics. Similarly, we performed separate pooling operations to extract the corresponding hierarchical graph pooling from each of the two types of node sets. In the pooling layer, the importance measure of the nodes is learned from the input node features \(F^{(in)}\):  
\[y=\frac{F^{(in)}p}{\parallel p\parallel} \tag{6}\]  
where \(F^{(in)}\) refers to the input matrix of node features, and \(p\) represents the learning vector. After obtaining the important score y, we sort all of the nodes and select the top K importance node, it can be formulated as:  
\[idx,\mathcal{P}=rank\big{(}y,N_{op},R\big{)} \tag{7}\]  
\[idx,\mathcal{N}=rank\big{(}y,N_{op},R\big{)} \tag{8}\]  
As far as we achieve the idx of the selected node, the graph structure and node features for the pooled graph are constructed on the basis of this information, and it can be determined by deducing the graph structure of the input graph based on these as follows:  
\[ \begin{array}{l}\widetilde{y}=\sigma(y(idx))\\ \widetilde{F}=F^{(in)}(idx,:)\\ F_{p}=\widetilde{F}\odot\left(\widetilde{y}1^{\top}_{d_{op}}\right)\end{array}  \tag{9}\]  
where \(\sigma()\) denotes the Sigmoid function that maps importance scores to (0,1). \(1^{\top}_{d_{op}}\) is a vector with all elements being 1. In this case, it is important to note that we utilize the same kind of nodes as input for the pooling mechanism, and we employ a common matrix to build the link between the balance and unbalance embedded representations. This is due to the fact that balanced embeddings and unbalanced embeddings have distinctly different physical meanings, respectively. Since different types of node sets imply antagonistic relationships such as \"trust\" or \"distrust\" [26].