To train model parameters \({\bf W}\)  of the Siamese neural network, we establish a contrastive loss built upon the argument by Armandpour et al. [1]}. Specifically, for each mini-batch used in stochastic gradient descent, we sample a pair of two nodes \(u, v \in G\)  whose connection is certain. Here, we apply negative sampling [2]} to balance between sampled positive and negative node pairs since real-world networks tend to be sparse. Then, we aim to find the parameters \({\bf W}\)  in the sense of minimizing the loss function:
\(\mathcal {L}({\bf W},{\bf x}_u,{\bf x}_v) = & (1-a_{uv})\frac{1}{2}d^2_{\bf W}(u,v) \nonumber \\&+ a_{uv}\frac{1}{2}\lbrace \max (0,r-D_{\bf W}(u,v))\rbrace ^2,\) 
