# A Construction Method for a Dynamic Weighted Protein Network Using Multi-Level Embedding
## 2 Dynamic Weighted Protein Network Construction
### Multi-Level Embedding Method Construction
#### 2.3.2 Deep Attributed Network Embedding  
DANE is a deep-learning-based network embedding method that can process node attribute and network structure information at the same time. In contrast, traditional network embedding methods can typically only process one. This allows DANE to reflect the complexity of nodes better and thus achieve superior results in various tasks. Next, a second embedding is performed, where the embedding \(Z\) obtained from VGAE is constructed as an attribute matrix, which is used as an input along with the adjacency matrix \(M\). DANE has two branches: the first one consists of a multilayered nonlinear function that captures highly nonlinear network structure by mapping the input \(M\) to a low-dimensional space, and the second one maps \(Z\) to a low-dimensional space to capture the high nonlinearities in the attributes. Each branch is an autoencoder that captures the highly nonlinear structure. To maintain semantic proximity and higher-order approximation and minimize the reconstruction loss, the loss function is as follows:  
\[L_{s}=\sum_{i=1}^{n}\bigl{\|}\hat{Z}_{i}-Z_{i}\bigr{\|}_{2}^{2}, \tag{13}\]  
\[L_{h}=\sum_{i=1}^{n}\bigl{\|}\hat{M}_{i}.-M_{i}.\bigr{\|}_{2}^{2}, \tag{14}\]  
where \(Z_{i}\). and \(\hat{Z}_{i}\). denote the original attribute matrix input by the encoder and the reconstructed attribute similarity matrix output by the decoder, respectively, and \(i\): represents all the features associated with node \(i\). Similarly, \(M_{i}\). denotes the original adjacency matrix, and \(\hat{M}_{i}\). denotes the reconstructed one. If two nodes have similar domain structures, the representations learned by minimizing the reconstruction loss will also be similar. The optimization objective adopted here recovers the protein network with high accuracy and highlights the dynamic weights among proteins in the reconstructed network. Further, first-order proximity and topology in the attributes can be maintained simultaneously by minimizing the negative log-likelihood. In other words, this loss function helps to ensure that the model captures both the protein node attributes and the interaction patterns in the network structure, thus maintaining these critical features in the embedding vector. The equation is defined as follows:  
\[L_{f}=-\sum_{E_{ij}>0}\log p_{ij}^{M}-\sum_{E_{ij}>0}\log p_{ij}^{Z}, \tag{15}\]where \(E_{ij}>0\) denotes that the \(i\) protein and the \(j\) protein are topologically connected, and the following equation can calculate \(p_{ij}^{M}\) and \(p_{ij}^{Z}\):  
\[p_{ij}^{M},p_{ij}^{Z}=\frac{1}{1+\exp{(-H_{i:}^{M,Z}(H_{j:}^{M,Z})^{T})}}, \tag{16}\]  
where \(p_{ij}^{M}\) and \(p_{ij}^{Z}\) define the predicted probabilities of a link between nodes \(i\) and \(j\) under the graph structure view \(M\) and the attribute information view \(Z\), respectively. \(p_{ij}^{M}\) is based on the topology representation \(H_{i:}^{M}\) of node \(i\) and the topology representation \(H_{j:}^{M}\) of node \(j\), while \(p_{ij}^{Z}\) is based on their attribute feature representations \(H_{i:}^{Z}\) and \(H_{j:}^{Z}\). The embedding of the nodes is reflected in the inner product of the embedding vectors of node \(j\), represented by \((H_{j:}^{M})^{T}\) and \((H_{j:}^{Z})^{T}\). The inner product of two points in an embedding reflects their similarity. When the points are similar, the inner product is close to 1. On the other hand, when the points are dissimilar or unrelated, the inner product is neutral, around 1/2. It is important to consider consistency and differentiation between nodes to ensure that representations contain both topology and attribute information. Thus, the loss function is defined below:  
\[L_{c}=-\sum_{i}\{\text{log}p_{ii}-\sum_{E_{ij}=0}\log{(1-p_{ij})}\}, \tag{17}\]  
\[p_{ij}=\frac{1}{1+\exp{(-H_{i:}^{M}(H_{j:}^{Z})^{T})}}, \tag{18}\]  
where \(p_{ii}\) denotes the joint probability between the representations of the same node in two different modalities; maximizing \(p_{ii}\) makes the representation of the same node in two modalities consistent.