# Deep Cross-Network Alignment with Anchor Node Pair Diverse Local Structure
## 3 Method
### Network Embedding with the Diverse Local Structure of Anchor Node
#### 3.2.2 Meta-Learning-Based Constraint  
The typical goal of network alignment is to identify potential anchor links. When labeled anchor links are available, we can use them as supervision information to learn the node relationship between the two networks. However, the number of labeled anchor links is often small, and the learned knowledge on the labeled anchor links should generalize to potential anchor links. To address this challenge, we leverage meta-learning to distinguish between anchor nodes and non-anchor nodes. In general, the meta-learning methodology employs an episodic paradigm to train on numerous samples of related tasks in order to solve the few-shot learning problem. These related tasks are referred to as meta-training tasks, while the few-shot learning task is called the meta-testing task [42]. We treat a labeled anchor node as a meta-training class and a non-labeled node as a meta-testing class. Since we only consider aligning two networks in this paper, the NA task that finding potential anchor links is comparable to identifying nodes belonging to the same class between \(G^{s}\) and \(G^{t}\). The number of samples in each meta-training class and meta-testing class is limited to two, which correspond to whether a pair of nodes is an anchor node pair or not. Thus, the network alignment (NA) task can be viewed as a one-shot classification problem. In the meta-learning scenario, our training tasks are for different tasks, and each task is a randomly drawn dataset, which contains \(k\) samples drawn from two classes. For each task, \(2*k\) samples are its training data (i.e., the support dataset), and the prediction task of each task is to classify a new sample belonging to these two classes (i.e., the task test is performed on the query dataset). Meta-training. We denote the meta-training classes set and the meta-testing classes set are \(L\) and \(N\), respectively. The following is a description of how the meta-training tasks are generated:  
(1) \(C_{i}\leftarrow\text{RANDOMSAMPLE}(L,|C|)\),  
(2) \(S_{i}\leftarrow\text{GET}(C_{i},G^{s})\),  
(3) \(Q_{i}\leftarrow\text{GET}(C_{i},G^{t})\),  
(4) \(T_{i}=S_{i}\oplus Q_{i}\),  
(5) Repeat steps (1)-(4) for \(K\) times. To be more precise, we first randomly select \(|C|\) classes from meta-training classes \(L\), designated as \(C_{i}\), at random. The support set \(S_{i}\) is then formed by taking the nodes from \(G^{s}\) that belong to class \(C_{i}\). To obtain the query set \(Q_{i}\), the same process is used with \(G^{t}\). A meta-training task \(T_{i}=S_{i}\oplus Q_{i}\) is created using both \(S_{i}\) and \(Q_{i}\). The foregoing processes can be repeated \(K\) times to produce \(K\) meta-training tasks. Through meta-training, we constrain nodes of the same class (from \(G^{s}\) and \(G^{t}\), respectively) to be close and far away from other nodes. Specifically, for each node \(v_{i}^{t}\) in \(Q=\left\{v_{1}^{t},v_{2}^{t},\cdots,v_{j}^{t},\cdots,v_{|c|}^{t}\right\}\), we traverse all nodes in \(S=\left\{v_{1}^{s},v_{2}^{s},\cdots,v_{i}^{s},\cdots,v_{|c|}^{s}\right\}\), and calculate the loss function \(\mathcal{L}\) as follows,  
\[\mathcal{L}= \begin{cases}\mathcal{L}_{en}+d(v_{i}^{s},v_{j}^{t})&\text{if $v_{i}^{s}$ and $v_{j}^{t}$ are belonging to the same class}\\ \mathcal{L}_{en}+log\sum exp(-d(v_{i}^{s},v_{j}^{t}))&\text{otherwise}\end{cases}  \tag{8}\]  
where \(d(\cdot,\cdot)\) measures the similarity between two nodes. Since the representation of each node is a Gaussian distribution, we use the second Wasserstein distance to calculate \(d(\cdot,\cdot)\), which can be computed as  
\[d(v_{i}^{s},v_{j}^{t}) =W_{2}(\mathbf{h}_{i}^{s},\mathbf{h}_{j}^{t})^{2} \tag{9}\] \[=\left\|\mu_{i}^{s}-\mu_{j}^{t}\right\|\right\|_{2}^{2}+Tr\Big{(} \sigma_{i}^{s}+\sigma_{j}^{t}-2(\sigma_{i}^{s1/2}\sigma_{i}^{t}\sigma_{i}^{s1/ 2})^{1/2}\Big{)},\]  
where \(\sigma_{i}^{s}\sigma_{j}^{t}=\sigma_{j}^{t}\sigma_{i}^{s}\) because the covariance matrices are diagonal.