Method, apparatus and electronic device for determining node representation
By dividing a signed network into positive and negative link subnetworks and generating graph signal filters using low-frequency and high-frequency information, the problem of inaccurate modeling of signed networks in existing technologies is solved, and accurate description and prediction of node relationships are achieved.
Patent Information
- Application Number
- CN202310073214.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-19
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-01-19
AI Technical Summary
In existing technologies, the structural equilibrium theory of signed networks makes overly idealistic assumptions and cannot effectively model complex signed networks in the real world.
The signed network is divided into positive link subnetworks and negative link subnetworks. Low-frequency information and high-frequency information are used to describe the similarity and difference between nodes, respectively. Information in the network is extracted by generating high-frequency graph signal filters and low-frequency graph signal filters, and then the node representation is determined.
Better modeling of signed networks enables accurate prediction of the links between nodes, including the degree of similarity and difference.
Smart Images

Figure CN116050513B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of neural networks, and more particularly, to a method, apparatus and electronic device for determining node representation in the field of neural networks. BACKGROUND
[0002] A signed network is a network in which individuals in the real world are abstracted as nodes in the signed network, and relationships between individuals in the real world are abstracted as edges in the signed network. The edges in the signed network include two types of relationships, i.e., positive relationships and negative relationships. The positive relationships are friendly relationships, trust relationships, like relationships, or support relationships between individuals, and the negative relationships are hostile relationships, distrust relationships, dislike relationships, or opposition relationships between individuals.
[0003] In the related art, a signed network is modeled by using a structural balance theory. The structural balance theory assumes that the structure of the signed network satisfies a balanced triangle structure. However, the signed network in the real world is complex, and the assumption that the structure of the signed network satisfies the balanced triangle structure is too idealized and cannot well model the signed network. SUMMARY
[0004] The present application provides a method, apparatus and electronic device for determining node representation, which uses low-frequency information and high-frequency information to describe the node representation (similarity and difference) in the signed network, and can better model the signed network.
[0005] In a first aspect, a method for determining node representation is provided. The method comprises: generating a first high-frequency graph signal filter and a first low-frequency graph signal filter of a positive link subnetwork and a second high-frequency graph signal filter and a second low-frequency graph signal filter of a negative link subnetwork based on a first degree matrix and a first Laplacian matrix of the positive link subnetwork and a second degree matrix and a second Laplacian matrix of the negative link subnetwork, the positive link subnetwork and the negative link subnetwork being obtained by partitioning a signed network, the signed network comprising a plurality of nodes; extracting high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork using the first high-frequency graph signal filter and the first low-frequency graph signal filter, and extracting high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork using the second high-frequency graph signal filter and the second low-frequency graph signal filter, the high-frequency information being used to describe the dissimilarity between nodes in the positive link subnetwork or the negative link subnetwork, and the low-frequency information being used to describe the similarity between nodes in the positive link subnetwork or the negative link subnetwork; and determining node representation in the signed network based on the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork, and the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork, the node representation being used to predict the link relationship between any two nodes.
[0006] In the above technical solution, the signed network is studied, and the purpose is to learn the node representation in the signed network to represent the similarity and dissimilarity between nodes in the signed network. Since in the signed network, the nodes in the positive link subnetwork emphasize the similarity, and the nodes in the negative link subnetwork emphasize the dissimilarity. Therefore, the signed network is divided into the positive link subnetwork and the negative link subnetwork. Since the low-frequency information and the high-frequency information of the positive link subnetwork and the negative link subnetwork can maintain the similarity and dissimilarity between nodes in the signed network, the low-frequency graph signal filter and the high-frequency graph signal filter can be designed for the positive link subnetwork and the negative link subnetwork respectively to extract the low-frequency information and the high-frequency information of the positive link subnetwork, and the low-frequency information and the high-frequency information of the negative link subnetwork. Thus, the node representation is determined based on the low-frequency information and the high-frequency information of the positive link subnetwork, and the low-frequency information and the high-frequency information of the negative link subnetwork, so as to predict the link relationship between any two nodes by using the node representation of the two nodes. In this solution, the low-frequency information and the high-frequency information are used to model the signed network, that is, the low-frequency information and the high-frequency information are used to describe the node representation (similarity and dissimilarity) in the signed network, which can more fully model the signed network.
[0007] With reference to the first aspect, in some possible implementation, the method further includes: determining a first adjacency matrix of the positive subnetwork; determining the first degree matrix based on the first adjacency matrix; and determining the first Laplacian matrix based on the first degree matrix and the first adjacency matrix.
[0008] In the technical solution, the determination process of the degree matrix (the first degree matrix) and the Laplacian matrix (the first Laplacian matrix) of the positive subnetwork is described. Specifically, the first degree matrix is determined based on the adjacency matrix (the first adjacency matrix) of the positive subnetwork; and the first Laplacian matrix is determined based on the first degree matrix and the first adjacency matrix.
[0009] With reference to the first aspect and the implementation, in some possible implementation, the method further includes: determining a third degree matrix of the signed network based on the first degree matrix and the second degree matrix; normalizing the first adjacency matrix based on the third degree matrix to obtain a first normalized adjacency matrix; normalizing the first degree matrix based on the third degree matrix to obtain a first normalized degree matrix; and determining a first normalized Laplacian matrix based on the first normalized adjacency matrix and the first normalized degree matrix.
[0010] In the technical solution, the determination process of the normalized adjacency matrix (the first normalized adjacency matrix), the normalized degree matrix (the first normalized degree matrix) and the normalized Laplacian matrix (the first normalized Laplacian matrix) of the positive subnetwork is described. Specifically, the degree matrix (the third degree matrix) of the signed network is determined based on the first degree matrix and the degree matrix (the second degree matrix) of the negative subnetwork; the first normalized adjacency matrix is obtained by normalizing the first adjacency matrix based on the third degree matrix; the first normalized degree matrix is obtained by normalizing the first degree matrix based on the third degree matrix; and the first normalized Laplacian matrix is determined based on the first normalized adjacency matrix and the first normalized degree matrix.
[0011] In some possible implementation manners, the method further includes: performing eigen decomposition on the first normalized Laplacian matrix to obtain a first eigenvalue matrix, and performing eigen decomposition on the second normalized Laplacian matrix of the negative link subnetwork to obtain a second eigenvalue matrix; and generating the first high-frequency graph signal filter and the first low-frequency graph signal filter of the positive link subnetwork based on the first degree matrix and the first Laplacian matrix of the positive link subnetwork, including: generating the first high-frequency graph signal filter and the first low-frequency graph signal filter based on the first matrix, the first normalized degree matrix, and the first eigenvalue matrix, wherein an element in the first matrix is used to control a degree of contribution of similarity between any node in the signed network and the node; and generating the second high-frequency graph signal filter and the second low-frequency graph signal filter of the negative link subnetwork based on the second degree matrix and the second Laplacian matrix of the negative link subnetwork, including: generating the second high-frequency graph signal filter and the second low-frequency graph signal filter based on the second normalized degree matrix and the second eigenvalue matrix.
[0012] It should be understood that the determination process of the second normalized Laplacian matrix is similar to that of the first normalized Laplacian matrix. Specifically, the adjacency matrix (second adjacency matrix) of the negative link subnetwork is normalized based on the third degree matrix to obtain a normalized adjacency matrix (second normalized adjacency matrix) of the negative link subnetwork; the second degree matrix is normalized based on the third degree matrix to obtain a second normalized degree matrix; and the normalized Laplacian matrix (second normalized Laplacian matrix) of the negative link subnetwork is determined based on the second normalized adjacency matrix and the second normalized degree matrix.
[0013] It should also be understood that, since similarity between two nodes in the positive link subnetwork is emphasized more, there is similarity between any node and the node itself in the positive link subnetwork. For example, in a signed network describing support degrees between user nodes (users), a certain user can support himself / herself and also support other users. Therefore, in the process of generating the high-frequency graph signal filter (first high-frequency graph signal filter) and the low-frequency graph signal filter (first low-frequency graph signal filter) of the positive link subnetwork, the similarity between any node and the node itself in the positive link subnetwork needs to be considered.
[0014] In the technical solution, based on the explanation or understanding of the positive link sub-network, the first high-frequency graph signal filter and the first low-frequency graph signal filter can be generated based on the first matrix, the first normalized degree matrix and the first eigenvalue matrix. That is, when determining the first high-frequency graph signal filter and the first low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself needs to be involved (the first matrix); and in the negative link sub-network, there is no difference between any node and the node itself. For example, in a signed network describing the friendship or hostile relationship between user nodes (users), a certain user will not be in a hostile relationship with himself. Therefore, the high-frequency graph signal filter (the second high-frequency graph signal filter) and the low-frequency graph signal filter (the second low-frequency graph signal filter) of the negative link sub-network are generated based on the first normalized degree matrix and the first eigenvalue matrix, that is, when determining the second high-frequency graph signal filter and the second low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself does not need to be involved.
[0015] In combination with the first aspect and the above implementation manner, in some possible implementation manners, the high-frequency information of the positive link sub-network and the low-frequency information of the positive link sub-network are extracted by using the first high-frequency graph signal filter and the first low-frequency graph signal filter, including: the high-frequency information of the positive link sub-network and the low-frequency information of the positive link sub-network are respectively determined based on the first matrix and the first normalized adjacency matrix; and the high-frequency information of the negative link sub-network and the low-frequency information of the negative link sub-network are extracted by using the second high-frequency graph signal filter and the second low-frequency graph signal filter, including: the high-frequency information of the negative link sub-network and the low-frequency information of the negative link sub-network are respectively determined based on the second normalized adjacency matrix of the negative link sub-network.
[0016] In combination with the first aspect and the above implementation manner, in some possible implementation manners, based on the high-frequency information of the positive link sub-network and the low-frequency information of the positive link sub-network, and the high-frequency information of the negative link sub-network and the low-frequency information of the negative link sub-network, the node representation in the signed network is determined, including: the node representation is determined based on the high-frequency information of the positive link sub-network, the high-frequency coefficient matrix of the positive link sub-network, the low-frequency information of the positive link sub-network, the low-frequency coefficient matrix of the positive link sub-network, the high-frequency information of the negative link sub-network, the high-frequency coefficient matrix of the negative link sub-network, the low-frequency information of the negative link sub-network and the low-frequency coefficient matrix of the negative link sub-network, the elements in the high-frequency coefficient matrix are used to control the contribution strength of the difference between any two nodes, and the elements in the low-frequency coefficient matrix are used to control the contribution strength of the similarity between any two nodes.
[0017] In the technical solution, the low-frequency information and the high-frequency information can keep the similarity and difference between nodes in the signed network, and the elements in the low-frequency coefficient matrix are used to control the contribution strength of the similarity between any two nodes, and the elements in the high-frequency coefficient matrix are used to control the contribution strength of the difference between any two nodes. Therefore, the node representation in the signed network is determined based on the low-frequency information of the positive sub-network, the low-frequency coefficient matrix of the positive sub-network, the high-frequency information of the negative sub-network, the high-frequency coefficient matrix of the negative sub-network, the low-frequency information of the negative sub-network, and the low-frequency coefficient matrix of the negative sub-network, so as to model the signed network.
[0018] With reference to the first aspect and the above implementation manners, in some possible implementation manners, the method further includes: determining the contribution strength of the similarity between the two nodes based on the preset activation algorithm, the positive sign attribute of the link between the two nodes, and the node representations of the two nodes, the positive sign attribute being used to indicate that the link relationship between the two nodes is a positive relationship.
[0019] In the technical solution, after the link relationship between any two nodes in the signed network is determined, the specific link degree can also be determined. For example, in a signed network describing the friend relationship or the hostile relationship between user nodes (users), if the link relationship between two users is a friend relationship, the degree of the friend relationship can also be determined, i.e., whether the friend relationship is a good friend relationship or a general friend relationship. Specifically, the contribution strength of the similarity between the two nodes is determined based on the preset activation algorithm, the positive sign attribute of the link between the two nodes, and the node representations of the two nodes.
[0020] With reference to the first aspect and the above implementation manners, in some possible implementation manners, after the node representation in the signed network is determined, the method further includes: determining the link information between any two nodes in the signed network based on the node representations of the two nodes; determining the probability of the link between the two nodes based on the link information between the two nodes, the probability of the link including a positive probability of the link and a negative probability of the link; and comparing the positive probability of the link and the negative probability of the link to obtain the sign attribute of the link.
[0021] In the technical solution, the link relationship between two nodes is inferred based on the node representations of the two nodes, i.e., the sign attribute of the link between the two nodes is determined. Specifically, the link information between the two nodes is determined; the probability of the link (the positive probability and the negative probability) is determined based on the link information; and the sign attribute of the link is determined by comparing the positive probability and the negative probability.
[0022] In summary, the present application proposes a method for determining node representation, which studies signed networks and aims to learn node representation in signed networks to represent similarities and differences between nodes in the signed networks. Since in signed networks, similarities between nodes in positive link subnetworks are emphasized more, while differences between nodes in negative link subnetworks are emphasized more. Therefore, the signed networks are divided into positive link subnetworks and negative link subnetworks. Since the low-frequency information and high-frequency information of the positive link subnetworks and the negative link subnetworks can maintain the similarities and differences between nodes in the signed networks, low-frequency graph signal filters and high-frequency graph signal filters can be designed for the positive link subnetworks and the negative link subnetworks respectively to extract the low-frequency information of the positive link subnetworks and the high-frequency information of the positive link subnetworks, as well as the low-frequency information of the negative link subnetworks and the high-frequency information of the negative link subnetworks. Thus, the node representation is determined based on the low-frequency information of the positive link subnetworks and the high-frequency information of the positive link subnetworks, as well as the low-frequency information of the negative link subnetworks and the high-frequency information of the negative link subnetworks; and the link relationship between any two nodes is predicted by using the node representation of the two nodes. In this scheme, the signed networks are modeled by using low-frequency information and high-frequency information, that is, the node representation (similarities and differences) in the signed networks is described by using low-frequency information and high-frequency information, which can more fully model the signed networks.
[0023] It should be understood that since similarities between two nodes in the positive link subnetworks are emphasized more, there is a similarity between any node and itself in the positive link subnetworks. For example, in a signed network describing support between user nodes (users), a user can support himself / herself and also support other users. Therefore, in the process of generating the high-frequency graph signal filter (first high-frequency graph signal filter) and the low-frequency graph signal filter (first low-frequency graph signal filter) of the positive link subnetworks, the similarity between any node and itself in the positive link subnetworks needs to be considered.
[0024] Further, based on the interpretation or understanding of the positive subnetwork, the first high-frequency graph signal filter and the first low-frequency graph signal filter are generated based on the first matrix, the first normalized degree matrix and the first eigenvector matrix respectively. That is, when determining the first high-frequency graph signal filter and the first low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself (the first matrix) needs to be involved; while in the negative subnetwork, there is no difference between any node and the node itself. For example, in a signed network describing the friendship or hostility between user nodes (users), a certain user will not be hostile to himself. Therefore, the high-frequency graph signal filter (the second high-frequency graph signal filter) and the low-frequency graph signal filter (the second low-frequency graph signal filter) of the negative subnetwork are generated based on the first normalized degree matrix and the first eigenvector matrix respectively, that is, when determining the second high-frequency graph signal filter and the second low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself does not need to be involved.
[0025] Further, based on the interpretation or understanding of the positive subnetwork, the first high-frequency graph signal filter and the first low-frequency graph signal filter are generated based on the first matrix, the first normalized degree matrix and the first eigenvector matrix respectively. That is, when determining the first high-frequency graph signal filter and the first low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself (the first matrix) needs to be involved; while in the negative subnetwork, there is no difference between any node and the node itself. For example, in a signed network describing the friendship or hostility between user nodes (users), a certain user will not be hostile to himself. Therefore, the high-frequency graph signal filter (the second high-frequency graph signal filter) and the low-frequency graph signal filter (the second low-frequency graph signal filter) of the negative subnetwork are generated based on the first normalized degree matrix and the first eigenvector matrix respectively, that is, when determining the second high-frequency graph signal filter and the second low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself does not need to be involved.
[0026] Finally, after determining the link relationship (the signed attribute) between any two nodes in the signed network, the specific link degree can also be determined. For example, in a signed network describing the friendship or hostility between user nodes (users), if the friendship between two users is determined, the degree of the friendship can also be determined, that is, whether it is a good friendship or a general friendship. Specifically, based on the preset activation algorithm, the positive signed attribute of the link between the two nodes and the node representation of the two nodes, the contribution strength of the similarity between the two nodes is determined.
[0027] In a second aspect, an apparatus for determining node representation is provided. The apparatus includes a generating module configured to generate a first high-frequency graph signal filter and a first low-frequency graph signal filter of a positive link subnetwork based on a first degree matrix and a first Laplacian matrix of the positive link subnetwork, and generate a second high-frequency graph signal filter and a second low-frequency graph signal filter of a negative link subnetwork based on a second degree matrix and a second Laplacian matrix of the negative link subnetwork, the positive link subnetwork and the negative link subnetwork being obtained by partitioning a signed network, the signed network including a plurality of nodes; an extracting module configured to extract high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork using the first high-frequency graph signal filter and the first low-frequency graph signal filter, and extract high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork using the second high-frequency graph signal filter and the second low-frequency graph signal filter, the high-frequency information being used to describe dissimilarity between nodes in the positive link subnetwork or the negative link subnetwork, and the low-frequency information being used to describe similarity between nodes in the positive link subnetwork or the negative link subnetwork; and a determining module configured to determine node representation in the signed network based on the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork, and the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork, the node representation being used to predict a link relationship between any two nodes.
[0028] With reference to the second aspect, in some possible implementation manners, the determining module is further configured to determine a first adjacency matrix of the positive link subnetwork; determine the first degree matrix based on the first adjacency matrix; and determine the first Laplacian matrix based on the first degree matrix and the first adjacency matrix.
[0029] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the determining module is further configured to determine a third degree matrix of the signed network based on the first degree matrix and the second degree matrix; and the apparatus further includes a normalization module configured to normalize the first adjacency matrix based on the third degree matrix to obtain a first normalized adjacency matrix, and normalize the first degree matrix based on the third degree matrix to obtain a first normalized degree matrix; and the determining module is further configured to determine a first normalized Laplacian matrix based on the first normalized adjacency matrix and the first normalized degree matrix.
[0030] In a possible implementation manner of the second aspect, the apparatus further includes: a feature decomposition module, configured to perform feature decomposition on the first normalized Laplacian matrix to obtain a first eigenvalue matrix, and perform feature decomposition on the second normalized Laplacian matrix of the negative link subnetwork to obtain a second eigenvalue matrix; and the generation module is specifically configured to: generate the first high-frequency graph signal filter and the first low-frequency graph signal filter based on the first matrix, the first normalized degree matrix and the first eigenvalue matrix, wherein an element in the first matrix is used to control a contribution degree of similarity between any node in the signed network and the node; and generate the second high-frequency graph signal filter and the second low-frequency graph signal filter based on the second normalized degree matrix and the second eigenvalue matrix.
[0031] In a possible implementation manner of the second aspect, the extraction module is specifically configured to: determine high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork based on the first matrix and the first normalized adjacency matrix; and determine high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork based on the second normalized adjacency matrix of the negative link subnetwork.
[0032] In a possible implementation manner of the second aspect, the determination module is specifically configured to determine the node representation based on the high-frequency information of the positive link subnetwork, the high-frequency coefficient matrix of the positive link subnetwork, the low-frequency information of the positive link subnetwork, the low-frequency coefficient matrix of the positive link subnetwork, the high-frequency information of the negative link subnetwork, the high-frequency coefficient matrix of the negative link subnetwork, the low-frequency information of the negative link subnetwork and the low-frequency coefficient matrix of the negative link subnetwork, wherein an element in the high-frequency coefficient matrix is used to control a contribution strength of difference between any two nodes, and an element in the low-frequency coefficient matrix is used to control a contribution strength of similarity between the any two nodes.
[0033] In a possible implementation manner of the second aspect, the determination module is further configured to determine the contribution strength of similarity between the two nodes based on a preset activation algorithm, a positive sign attribute of a link between the two nodes and the node representations of the two nodes, wherein the positive sign attribute is used to indicate that the link relationship between the two nodes is a positive relationship.
[0034] In some possible implementation manners, after determining the node representation in the signed network, the determining module is further configured to: determine, based on the node representation of any two nodes in the signed network, link information between the two nodes; determine, based on the link information between the two nodes, a probability of a link between the two nodes, the probability of the link including a positive probability of the link and a negative probability of the link; and the apparatus further includes a comparing module configured to compare the positive probability of the link and the negative probability of the link to obtain a signed attribute of the link.
[0035] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the electronic device performs the method in the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 is a schematic diagram of a signed network provided by an embodiment of the present application.
[0037] Figure 2 is a schematic flow diagram of a method for determining a node representation provided by an embodiment of the present application.
[0038] Figure 3 is a schematic diagram of a positive link sub-network and a negative link sub-network provided by an embodiment of the present application.
[0039] Figure 4 is a structural schematic diagram of an apparatus for determining a node representation provided by an embodiment of the present application.
[0040] Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0041] The technical solutions in the present application will be described clearly and exhaustively below with reference to the drawings. In the description of the embodiments of the present application, "multiple" refers to two or more than two. The terms "first" and "second" are only for the purpose of description, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features limited by "first" and "second" can explicitly or implicitly include one or more of the features.
[0042] Figure 1 is a schematic diagram of a signed network provided by an embodiment of the present application.
[0043] It should be understood that the signed network includes a plurality of nodes, and the sign attribute of the link between any two nodes is a positive sign attribute or a negative sign attribute, that is, the link relationship between any two nodes is a positive relationship or a negative relationship. Specifically, in the case that the plurality of nodes in the signed network represent user nodes (users), the positive relationship in the signed network can represent a positive relationship such as friendship, trust, like, support, and the like, and is represented by the symbol “+”; the negative relationship can represent a negative relationship such as enemy, distrust, dislike, opposition, and the like, and is represented by the symbol “-”.
[0044] For example, in the biological field, the relationship between any two nodes in the signed network formed by a plurality of nodes (a plurality of synapses) in the nervous system is a facilitation relationship or an inhibition relationship. In the social field, there is a cooperative relationship or a competitive relationship between any two countries in the signed network formed by a plurality of country nodes (a plurality of countries).
[0045] For example, Figure 1 For the signed network shown for describing the relationship between users, the signed network includes a plurality of user nodes, specifically user A, user B, and user C. The sign attribute of the link between user A and user B is “+”, which can represent that user B likes user A; the sign attribute of the link between user C and user A is “+”, which can represent that user C likes user A; and the sign attribute of the link between user B and user C is “-”, which can represent that the relationship between user B and user C is a dislike relationship.
[0046] In the related art, the signed network is modeled using the balance theory, which believes that the user nodes in the signed network describing the relationship between users tend to form a balanced network structure. In other words, “a friend of a friend is my friend”, “a friend of an enemy is my enemy”, “an enemy of a friend is my enemy”, and “an enemy of an enemy is my friend”, which is simply expressed as a balanced triangle structure: “+ / + / +”, “+ / - / -”, “- / + / -”, and “- / - / +”.
[0047] However, the rich diversity of the real world makes the constructed signed network diverse. Therefore, the structure of the signed network does not necessarily follow the balance theory. For example, Figure 1 The structure of the signed network shown does not follow the balance theory.
[0048] Figure 2 is a schematic flowchart of a method for determining a node representation provided by an embodiment of the present application.
[0049] It should be understood that the method for determining node representation provided in this application embodiment can be applied to electronic devices. The electronic device is an intelligent device with computing, display, and control functions, such as a server or computer terminal.
[0050] For example, such as Figure 2 As shown, the method 200 includes:
[0051] 201. The electronic device generates a first high-frequency graph signal filter and a first low-frequency graph signal filter for the positively linked subnetwork based on the first degree matrix and the first Laplacian matrix of the positively linked subnetwork, and generates a second high-frequency graph signal filter and a second low-frequency graph signal filter for the negatively linked subnetwork based on the second degree matrix and the second Laplacian matrix of the negatively linked subnetwork. The positively linked subnetwork and the negatively linked subnetwork are obtained by partitioning a signed network, and the signed network includes multiple nodes.
[0052] It should be understood that both the "positive link subnetwork" and the "negative link subnetwork" in the above scheme share multiple nodes in the signed network, and the links in the positive link subnetwork and the negative link subnetwork do not overlap. That is, in the positive link subnetwork divided by the signed network, if the link between node 1 and node 2 is positive, then in the negative link subnetwork divided by the signed network, the link between node 1 and node 2 is empty. Conversely, in the negative link subnetwork, if the link between node 2 and node 3 is negative, then in the positive link subnetwork, the link between node 2 and node 3 is empty.
[0053] The signed network is represented as G = {G} + G -}. Among them, G + ={V,E +} and G - ={V,E -} represent positively linked subnetworks and negatively linked subnetworks, respectively. Positively linked subnetworks and negatively linked subnetworks share the same multiple nodes {v1,...,v...}. n Furthermore, the links between nodes in the positively linked subnetwork and the negatively linked subnetwork do not overlap.
[0054] Figure 3 This is a schematic diagram of a positive link subnetwork and a negative link subnetwork provided in an embodiment of this application.
[0055] For example, with Figure 1 Taking the symbolic network shown as an example to describe the relationships between users, the symbolic network is divided into positive link subnetworks and negative link subnetworks as follows: Figure 3 As shown.
[0056] As shown in (a) of FIG. 1, it is a positive link sub-network obtained by partitioning the signed network in (a), which includes all user nodes in the signed network as shown in (a), i.e., user A, user B and user C. Figure 3 As shown in (b) of FIG. 1, it is a negative link sub-network obtained by partitioning the signed network in (b), which includes all user nodes in the signed network as shown in (b), i.e., user A, user B and user C. Figure 1 As shown in (a) of FIG. 1, it is a positive link sub-network obtained by partitioning the signed network in (a), which includes all user nodes in the signed network as shown in (a), i.e., user A, user B and user C. Figure 1 As shown in (b) of FIG. 1, it is a negative link sub-network obtained by partitioning the signed network in (b), which includes all user nodes in the signed network as shown in (b), i.e., user A, user B and user C. Figure 3 As shown in (a) of FIG. 1, it is a positive link sub-network obtained by partitioning the signed network in (a), which includes all user nodes in the signed network as shown in (a), i.e., user A, user B and user C. Figure 1 As shown in (b) of FIG. 1, it is a negative link sub-network obtained by partitioning the signed network in (b), which includes all user nodes in the signed network as shown in (b), i.e., user A, user B and user C. Figure 1 As shown in (a) of FIG. 1, it is a positive link sub-network obtained by partitioning the signed network in (a), which includes all user nodes in the signed network as shown in (a), i.e., user A, user B and user C.
[0057] It should also be understood that the first degree matrix of the positive link sub-network and the second degree matrix of the negative link sub-network are both obtained from the adjacency matrix of the positive link sub-network (hereinafter referred to as the first adjacency matrix) and the adjacency matrix of the negative link sub-network (hereinafter referred to as the second adjacency matrix), which is a matrix used to describe the adjacent relationship between nodes in the signed network. The degree matrix (the first degree matrix or the second degree matrix) is a diagonal matrix, and in the scheme of the present application, each diagonal element in the degree matrix is the sum of each row element in the corresponding adjacency matrix. The Laplacian matrix (the first Laplacian matrix or the second Laplacian matrix) can be obtained from the adjacency matrix and the degree matrix.
[0058] The first degree matrix and the first Laplacian matrix of the positive link sub-network, and the second degree matrix and the second Laplacian matrix of the negative link sub-network are determined as follows.
[0059] In one possible implementation, the method 200 further includes: determining, by the electronic device, the first adjacency matrix of the positive link sub-network; determining, by the electronic device, the first degree matrix based on the first adjacency matrix; and determining, by the electronic device, the first Laplacian matrix based on the first degree matrix and the first adjacency matrix.
[0060] In the above technical solution, the determination process of the degree matrix (the first degree matrix) and the Laplacian matrix (the first Laplacian matrix) of the positive link sub-network is described. Specifically, the first degree matrix is determined based on the adjacency matrix (the first adjacency matrix) of the positive link sub-network; and the first Laplacian matrix is determined based on the first degree matrix and the first adjacency matrix.
[0061] Optionally, the electronic device determines the first adjacency matrix of the positive link subnetwork, including: the electronic device determines the first adjacency matrix of the positive link subnetwork based on the adjacent relationship between nodes in the plurality of nodes included in the positive link subnetwork; and the electronic device determines the first degree matrix based on the first adjacency matrix, including: the electronic device determines each diagonal element in the first degree matrix based on the sum of elements of each row in the first adjacency matrix; and the electronic device determines the first Laplacian matrix based on the first degree matrix and the first adjacency matrix, including: the electronic device determines the first Laplacian matrix based on the difference between the first degree matrix and the first adjacency matrix.
[0062] wherein the first adjacency matrix is A + ; the first degree matrix is D + , each diagonal element in D + is and i is from 1 to the number of rows of the adjacency matrix, and n is the number of columns of the adjacency matrix; and the first Laplacian matrix is and
[0063] In one possible implementation, the method 200 further includes: the electronic device determines a second adjacency matrix of the negative link subnetwork; the electronic device determines a second degree matrix based on the second adjacency matrix; and the electronic device determines a second Laplacian matrix based on the second degree matrix and the second adjacency matrix.
[0064] It should be understood that the negative link subnetwork is similar to the positive link subnetwork, and the process of determining the adjacency matrix, the degree matrix, and the Laplacian matrix of the negative link subnetwork is the same as that of the positive link subnetwork, and is as follows.
[0065] Optionally, the electronic device determines the second adjacency matrix of the negative link subnetwork, including: the electronic device determines the second adjacency matrix of the negative link subnetwork based on the adjacent relationship between nodes in the plurality of nodes included in the negative link subnetwork; and the electronic device determines the second degree matrix based on the second adjacency matrix, including: the electronic device determines each diagonal element in the second degree matrix based on the sum of elements of each row in the second adjacency matrix; and the electronic device determines the second Laplacian matrix based on the second degree matrix and the second adjacency matrix, including: the electronic device determines the second Laplacian matrix based on the difference between the second degree matrix and the second adjacency matrix.
[0066] wherein the second adjacency matrix is A - ; the second degree matrix is D - , each diagonal element in D - is and and i is from 1 to the number of rows of the adjacency matrix, n is the number of columns of the adjacency matrix; the second Laplacian matrix is and
[0067] The normalization of the above first adjacency matrix, first degree matrix, second adjacency matrix and second degree matrix, and the normalization process of the first Laplacian matrix and the second Laplacian matrix based on the obtained normalization results are as follows.
[0068] In one possible implementation, the method 200 further includes: determining, by the electronic device, a third degree matrix of the signed network based on the first degree matrix and the second degree matrix; normalizing, by the electronic device, the first adjacency matrix based on the third degree matrix to obtain a first normalized adjacency matrix; normalizing, by the electronic device, the first degree matrix based on the third degree matrix to obtain a first normalized degree matrix; and determining, by the electronic device, a first normalized Laplacian matrix based on the first normalized adjacency matrix and the first normalized degree matrix.
[0069] In the above technical solution, the determination process of the normalized adjacency matrix (the first normalized adjacency matrix), the normalized degree matrix (the first normalized degree matrix) and the normalized Laplacian matrix (the first normalized Laplacian matrix) of the positive link sub-network is described. Specifically, the degree matrix (the third degree matrix) of the signed network is determined based on the first degree matrix and the degree matrix (the second degree matrix) of the negative link sub-network; the first normalized adjacency matrix is obtained by normalizing the first adjacency matrix based on the third degree matrix; the first normalized degree matrix is obtained by normalizing the first degree matrix based on the third degree matrix; and the first normalized Laplacian matrix is determined based on the first normalized adjacency matrix and the first normalized degree matrix.
[0070] Optionally, the electronic device determines a third degree matrix of the signed network based on the first degree matrix and the second degree matrix, including: the electronic device determines the third degree matrix of the signed network based on a sum of the first degree matrix, the second degree matrix and a unit matrix, a number of rows and a number of columns of the unit matrix being same as a number of rows and a number of columns of the first degree matrix and a number of rows and a number of columns of the second degree matrix; and the electronic device normalizes the first adjacency matrix based on the third degree matrix to obtain a first normalized adjacency matrix, including: the electronic device determines the first normalized adjacency matrix based on a result of left multiplication of the first adjacency matrix by a preset power of the third degree matrix and right multiplication of the third degree matrix by the preset power; and the electronic device normalizes the first degree matrix based on the third degree matrix to obtain a first normalized degree matrix, including: the electronic device determines the first normalized degree matrix based on a result of left multiplication of the first degree matrix by the preset power of the third degree matrix and right multiplication of the third degree matrix by the preset power; and the electronic device determines a first normalized Laplacian matrix based on the first normalized adjacency matrix and the first normalized degree matrix, including: the electronic device determines the first normalized Laplacian matrix based on a difference between the first normalized degree matrix and the first normalized adjacency matrix.
[0071] Optionally, the preset power is -1 / 2.
[0072] Optionally, the third degree matrix is D = D + + D - + I, I being a unit matrix; the first normalized adjacency matrix is the first normalized degree matrix is the first normalized Laplacian matrix is
[0073] In one possible implementation, the method 200 further includes: the electronic device normalizes the second adjacency matrix based on the third degree matrix to obtain a second normalized adjacency matrix; the electronic device normalizes the second degree matrix based on the third degree matrix to obtain a second normalized degree matrix; and the electronic device determines a second normalized Laplacian matrix based on the second normalized adjacency matrix and the second normalized degree matrix.
[0074] It should be understood that the negative link subnetwork is similar to the positive link subnetwork, and the negative link subnetwork and the positive link subnetwork determine the normalized adjacency matrix, the normalized degree matrix and the normalized Laplacian matrix in the same way, as follows.
[0075] Optionally, the electronic device normalizes the second adjacency matrix based on the third degree matrix to obtain a second normalized adjacency matrix, including: the electronic device left multiplies the second adjacency matrix by a preset power of the third degree matrix, right multiplies a result of the preset power of the third degree matrix, and determines the result as the second normalized adjacency matrix; and the electronic device normalizes the second degree matrix based on the third degree matrix to obtain a second normalized degree matrix, including: the electronic device left multiplies the second degree matrix by the preset power of the third degree matrix, right multiplies the result of the preset power of the third degree matrix, and determines the result as the second normalized degree matrix; and the electronic device determines a second normalized Laplacian matrix based on the second normalized adjacency matrix and the second normalized degree matrix, including: the electronic device determines the second normalized Laplacian matrix based on a difference between the second normalized degree matrix and the second normalized adjacency matrix.
[0076] The second normalized adjacency matrix is The second normalized degree matrix is The second normalized Laplacian matrix is
[0077] The following discusses the process of generating the first high-frequency graph signal filter and the first low-frequency graph signal filter of the positive link network, and the second high-frequency graph signal filter and the second low-frequency graph signal filter of the negative link network.
[0078] In one possible implementation, the method 200 further includes: the electronic device performing eigenvalue decomposition on the first normalized Laplacian matrix to obtain a first eigenvalue matrix, and performing eigenvalue decomposition on the second normalized Laplacian matrix of the negative link subnetwork to obtain a second eigenvalue matrix; and step 201 includes: the electronic device generating the first high-frequency graph signal filter and the first low-frequency graph signal filter based on a first matrix, a first normalized degree matrix, and the first eigenvalue matrix, wherein an element in the first matrix is used to control a degree of contribution of similarity between any node in the signed network and the node itself; and the electronic device generating the second high-frequency graph signal filter and the second low-frequency graph signal filter based on a second normalized degree matrix and the second eigenvalue matrix.
[0079] It should be understood that, since similarity between two nodes in the positive link subnetwork is emphasized more, there is similarity between any node in the positive link subnetwork and the node itself. For example, in a signed network describing support degrees between user nodes (users), a certain user can support himself / herself and also support other users. Therefore, in the process of generating the high-frequency graph signal filter (the first high-frequency graph signal filter) and the low-frequency graph signal filter (the first low-frequency graph signal filter) of the positive link subnetwork, the similarity between any node in the positive link subnetwork and the node itself needs to be considered.
[0080] In the technical solution, the first high-frequency graph signal filter and the first low-frequency graph signal filter are generated based on the interpretation or understanding of the positive link subnetwork. That is, when determining the first high-frequency graph signal filter and the first low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself (the first matrix) needs to be involved. However, in the negative link subnetwork, there is no difference between any node and the node itself. For example, in a signed network describing the friendship or hostility between user nodes (users), a user cannot be hostile to himself. Therefore, the high-frequency graph signal filter (the second high-frequency graph signal filter) and the low-frequency graph signal filter (the second low-frequency graph signal filter) of the negative link subnetwork are generated based on the first normalized degree matrix and the first eigenvalue matrix, that is, when determining the second high-frequency graph signal filter and the second low-frequency graph signal filter, the contribution degree of the similarity between any node and the node itself does not need to be involved. In addition, in the technical solution, the eigenvalue matrix and the normalized degree matrix obtained based on the normalized Laplacian matrix are used to generate the graph signal filter (including the high-frequency graph signal filter and the low-frequency graph signal filter), and the graph signal filter generated in this way can quickly extract the features (information) that can represent the similarity and difference between the nodes of the signed network.
[0081] Optionally, the electronic device performs eigenvalue decomposition on the first normalized Laplacian matrix to obtain the first eigenvalue matrix, and performs eigenvalue decomposition on the second normalized Laplacian matrix of the negative link subnetwork to obtain the second eigenvalue matrix, including: the electronic device performs eigenvalue decomposition on the first normalized Laplacian matrix to obtain the first eigenvalue matrix, the eigenvector matrix, and the transpose of the eigenvector matrix, and performs eigenvalue decomposition on the second normalized Laplacian matrix to obtain the second eigenvalue matrix, the eigenvector matrix, and the transpose of the eigenvector matrix; and the electronic device generates the first high-frequency graph signal filter and the first low-frequency graph signal filter based on the first matrix, the first normalized degree matrix, and the first eigenvalue matrix, including: the electronic device generates the first low-frequency graph signal filter based on the sum of the first matrix and the first normalized degree matrix, and the difference between the sum and the first eigenvalue matrix, and generates the first high-frequency graph signal filter based on the difference between the first matrix and the first normalized degree matrix, and the sum of the difference and the first eigenvalue matrix; and the electronic device generates the second high-frequency graph signal filter and the second low-frequency graph signal filter based on the second normalized degree matrix and the second eigenvalue matrix, including: the electronic device generates the second low-frequency graph signal filter based on the difference between the second normalized degree matrix and the second eigenvalue matrix, and generates the second high-frequency graph signal filter based on the difference between the second eigenvalue matrix and the second normalized degree matrix.
[0082] wherein the first eigenvalue matrix is wherein the U represents an eigenvector matrix, U T represents the transpose of the eigenvector matrix, the formula is used to describe the process of eigenvalue decomposition of the first normalized Laplacian matrix, and the second eigenvalue matrix is wherein the The formula is used to describe the process of eigenvalue decomposition of the second normalized Laplacian matrix. Wherein the eigenvector matrix is an orthogonal matrix, then UU T = I; the first matrix is ζ, and the function of the first low-frequency graph signal filter can be represented as The function of the first high-frequency graph signal filter can be represented as The function of the second low-frequency graph signal filter can be represented as The function of the second high-frequency graph signal filter can be represented as
[0083] Exemplarily, the first low-frequency graph signal filter, the first high-frequency graph signal filter, the second low-frequency graph signal filter and the second high-frequency graph signal filter of the signed network are determined, which describes the support degree between the user nodes (users). In the positive link subnetwork of the signed network, there is a user who uses part of the votes he owns to support himself and another part of the votes to support other users, that is, the contribution degree of the user to the similarity of the user is the degree of the user supporting himself (the number of votes supporting himself divided by the total number of votes). Therefore, the first matrix of the positive link subnetwork can be determined based on the contribution degree of the user to the similarity of the user, and the first low-frequency graph signal filter and the first high-frequency graph signal filter are generated based on the first matrix, the first normalized degree matrix and the first eigenvalue matrix respectively; Since there is no dissimilarity between any user and the user in the negative link subnetwork, that is, the user will not not support himself. Therefore, the second low-frequency graph signal filter and the second high-frequency graph signal filter can be generated based on the second normalized degree matrix and the second eigenvalue matrix of the negative link subnetwork.
[0084] 202, the electronic device extracts high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork by using the first high-frequency graph signal filter and the first low-frequency graph signal filter, and extracts high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork by using the second high-frequency graph signal filter and the second low-frequency graph signal filter, the high-frequency information is used to describe the difference between the nodes in the positive link subnetwork or the negative link subnetwork, and the low-frequency information is used to describe the similarity between the nodes in the positive link subnetwork or the negative link subnetwork.
[0085] The process of determining the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork, and the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork is discussed as follows.
[0086] In a possible implementation, in step 202, the electronic device determines the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork based on the first matrix and the first normalized adjacency matrix, respectively, and determines the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork based on the second normalized adjacency matrix of the negative link subnetwork.
[0087] Optionally, the electronic device determines the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork based on the first matrix and the first normalized adjacency matrix, respectively, includes that the electronic device determines a low-frequency convolution kernel of the positive link subnetwork based on a sum of the first matrix and the first normalized adjacency matrix, and determines the low-frequency information of the positive link subnetwork based on a product of the low-frequency convolution kernel of the positive link subnetwork, a historical node representation when the plurality of nodes in the signed network are modeled, and a parameter on the positive link subnetwork; the electronic device determines a high-frequency convolution kernel of the positive link subnetwork based on a difference between the first matrix and the first normalized adjacency matrix, and determines the high-frequency information of the positive link subnetwork based on a product of the high-frequency convolution kernel of the positive link subnetwork, the historical node representation when the plurality of nodes in the signed network are modeled, and the parameter on the positive link subnetwork; and the electronic device determines the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork based on the second normalized adjacency matrix of the negative link subnetwork, respectively, includes that the electronic device determines a low-frequency convolution kernel of the negative link subnetwork based on the second normalized adjacency matrix, and determines the low-frequency information of the negative link subnetwork based on a product of the low-frequency convolution kernel of the negative link subnetwork, the historical node representation when the plurality of nodes in the signed network are modeled, and a parameter on the negative link subnetwork; the electronic device determines a high-frequency convolution kernel of the negative link subnetwork based on a difference between a zero matrix and the second normalized adjacency matrix, and determines the high-frequency information of the negative link subnetwork based on a product of the high-frequency convolution kernel of the negative link subnetwork, the historical node representation when the plurality of nodes in the signed network are modeled, and the parameter on the negative link subnetwork.
[0088] It should be understood that the modeling of the signed network is a multiple learning process, and the node representation in the signed network can be determined in the process of modeling the signed network. The determination of the node representation in the technical solution of the present application can be understood as the node representation determined at the current time, which is related to the historical node representation when the plurality of nodes in the signed network are modeled.
[0089] The low-frequency convolution kernel of the positive link subnetwork is The high-frequency convolution kernel of the positive link subnetwork is The low-frequency convolution kernel of the negative link sub-network is The high-frequency convolution kernel of the negative link sub-network is The node representation at the first time in the signed network is H (l) The parameter on the positive link sub-network is The parameter on the negative link sub-network is The low-frequency information of the positive link sub-network is The high-frequency information of the positive link sub-network is The low-frequency information of the negative link sub-network is The high-frequency information of the negative link sub-network is
[0090] It should also be understood that, since the modeling of the signed network is a multiple learning process, it involves the theory of extracting features (information) in the signed network by using graph convolution kernels in the graph neural network (this is because the signed network belongs to a network topology graph). To this end, the low-frequency information and the high-frequency information in the signed network are expressed based on the low-frequency convolution kernel of the positive link sub-network, the high-frequency convolution kernel of the positive link sub-network, the low-frequency convolution kernel of the negative link sub-network, and the high-frequency convolution kernel of the negative link sub-network, so that the similarities and differences between multiple nodes in the signed network can be understood.
[0091] 203, the electronic device determines the node representation in the signed network based on the high-frequency information of the positive link sub-network and the low-frequency information of the positive link sub-network, and the high-frequency information of the negative link sub-network and the low-frequency information of the negative link sub-network, the node representation being used to predict the link relationship between any two nodes.
[0092] It should be understood that the "node representation" in the above technical solution is the node representation learned at the current time in the process of modeling the signed network.
[0093] In the above technical solution, "the node representation is used to predict the link relationship between any two nodes" can be understood as, after determining the node representation in the signed network, the electronic device can infer the link relationship between the two nodes by using the node representation of any two nodes, i.e., predicting the link relationship between the two nodes as a positive relationship or a negative relationship. The specific process is as follows.
[0094] In a possible implementation, after the electronic device determines the node representation of the nodes in the signed network, the method 200 further includes: determining, by the electronic device, link information between any two nodes in the signed network based on the node representations of the two nodes; determining, by the electronic device, a probability of a link between the two nodes based on the link information between the two nodes, the probability of the link including a positive probability of the link and a negative probability of the link; and comparing, by the electronic device, the positive probability and the negative probability to obtain a signed attribute of the link.
[0095] It should be understood that determining the node representation means determining the node representation by using a low-dimensional dense vector. Thus, after the node representation of the nodes in the signed network is determined, the link information between any two nodes can be determined based on the node representations of the two nodes.
[0096] It should also be understood that the signed attribute label of the link between the nodes in the signed network can be used to verify whether the modeling of the signed network is successful, the signed attribute label being used to indicate the signed attribute of the link between any two nodes. Specifically, the electronic device predicts the signed attribute of the link between any two nodes based on the node representations of the two nodes; and the electronic device determines that the signed network is successfully modeled in a case where a loss value between the signed attribute label of the link between the two nodes and the predicted signed attribute is less than a preset loss value. That is, the determined node representations of the two nodes are relatively correct.
[0097] In a possible implementation, the method 200 includes any one of the following: determining, by the electronic device, a result of concatenation of the node representations of the two nodes as the link information between the two nodes; determining, by the electronic device, a first result of concatenation by subtracting and multiplying the node representations of the two nodes respectively and concatenating a result of the subtraction and a result of the multiplication; determining, by the electronic device, the first result of concatenation as the link information between the two nodes; and determining, by the electronic device, a second result of concatenation by concatenating the result of the subtraction, the node representation of one of the two nodes, the result of the multiplication, and the node representation of the other of the two nodes, as the link information between the two nodes.
[0098] It should be understood that, after the link information between the two nodes is obtained, the link information can be input into a multi-layer perceptron (MLP) to obtain a positive probability p and a negative probability 1-p of the link between the two nodes; and the signed attribute of the link is obtained by comparing the positive probability and the negative probability.
[0099] Optionally, the electronic device compares the positive probability and the negative probability to obtain a sign attribute of the link, including: if the positive probability is greater than the negative probability, the electronic device determines a positive relationship as the link relationship between the two nodes; if the positive probability is less than the negative probability, the electronic device determines a negative relationship as the link relationship between the two nodes.
[0100] Specifically, taking nodes i and t in the signed network as an example, the link relationship between nodes i and t is inferred. The node representation of the two nodes (nodes i and t) is H i and H t ; the link information between nodes i and t determined based on the node representation (H i and H t ) is [H i , H i -H t , H i x H t , H t ]; the link information is input into the MLP to obtain the probability of the link between the two nodes, the positive probability is 0.48, and the negative probability is 0.52; the sign attribute of the link is obtained by comparing the positive probability and the negative probability, which is “-”.
[0101] It should be understood that the link information between nodes i and t is [H i , H i -H t , H i x H t , H t ] is only one embodiment, and the link information between nodes i and t can also be [H i , H t ], [H i -H t , H i x H t , H t ] and [H i -H t , H i x H t ], or some more complex embodiments, etc.
[0102] For example, in a signed network describing trust relationships between user nodes (users), after determining the node representation of any two user nodes (user node 1 and user node 2), based on the node representations H1 and H2 corresponding to the user node 1 and the user node 2, the link information between the user node 1 and the user node 2 is determined as [H1, H1-H2, H1xH2, H2]; the link information is input into the MLP to obtain the probability of the link between the user node 1 and the user node 2, the positive probability is 0.26, and the negative probability is 0.74; by comparing 0.26 and 0.74, it can be concluded that the relationship between the user 1 and the user 2 is a non-trust relationship.
[0103] For another example, in a signed network describing relationships between country nodes (countries), after determining the node representation of any two country nodes (country node 1 and country node 2), based on the node representations H1 and H2 corresponding to the country node 1 and the country node 2, the link information between the country node 1 and the country node 2 is determined as [H1-H2, H1xH2]; the link information is input into the MLP to obtain the probability of the link between the country node 1 and the country node 2, the positive probability is 0.67, and the negative probability is 0.33; by comparing 0.67 and 0.33, it can be concluded that the relationship between the country 1 and the country 2 is a cooperative relationship.
[0104] In a possible implementation, step 203 comprises: determining, by the electronic device, the node representation based on the high-frequency information of the positive link sub-network, the high-frequency coefficient matrix of the positive link sub-network, the low-frequency information of the positive link sub-network, the low-frequency coefficient matrix of the positive link sub-network, the high-frequency information of the negative link sub-network, the high-frequency coefficient matrix of the negative link sub-network, the low-frequency information of the negative link sub-network, and the low-frequency coefficient matrix of the negative link sub-network, wherein an element in the high-frequency coefficient matrix is used to control the contribution strength of the difference between any two nodes, and an element in the low-frequency coefficient matrix is used to control the contribution strength of the similarity between any two nodes.
[0105] Optionally, the electronic device determines the node representation based on the high-frequency information of the positive link subnetwork, the high-frequency coefficient matrix of the positive link subnetwork, the low-frequency information of the positive link subnetwork, the low-frequency coefficient matrix of the positive link subnetwork, the high-frequency information of the negative link subnetwork, the high-frequency coefficient matrix of the negative link subnetwork, the low-frequency information of the negative link subnetwork, and the low-frequency coefficient matrix of the negative link subnetwork, including: the electronic device determines a first product result of the high-frequency information of the positive link subnetwork and the high-frequency coefficient matrix of the positive link subnetwork, and determines a second product result of the low-frequency information of the positive link subnetwork and the low-frequency coefficient matrix of the positive link subnetwork; the electronic device determines a third product result of the high-frequency information of the negative link subnetwork and the high-frequency coefficient matrix of the negative link subnetwork, and determines a fourth product result of the low-frequency information of the negative link subnetwork and the low-frequency coefficient matrix of the negative link subnetwork; and the electronic device nonlinearizes a result after the first product result, the second product result, the third product result, and the fourth product result are added to obtain the node representation.
[0106] Preferably, the nonlinearization of the result after the addition can use a nonlinear activation function. For example, a rectified linear unit (ReLU).
[0107] wherein the first product result is the low-frequency coefficient matrix of the positive link subnetwork is L+(l) ; the second product result is the high-frequency coefficient matrix of the positive link subnetwork is H+(l) ; the third product result is the low-frequency coefficient matrix of the negative link subnetwork is L-(l) ; and the fourth product result is the high-frequency coefficient matrix of the negative link subnetwork is H-(l) .
[0108] Based on the above theory, the node representation of any node i in the signed network is as follows.
[0109]
[0110] wherein and respectively represent the node set of the neighbor nodes connected to node i in the signed network by the positive link subnetwork and the negative link subnetwork. and respectively control the contribution degree of the similarity and the difference between the nodes connected by the positive link subnetwork, and and respectively control the contribution degree of the similarity and the difference between the nodes connected by the negative link subnetwork, and iiis the degree matrix of the signed network obtained for the nodes having a neighboring relationship with node i; D jj is the degree matrix of the signed network obtained for the nodes having a neighboring relationship with node j; D kk is the degree matrix of the signed network obtained for the nodes having a neighboring relationship with node k.
[0111] It should be understood that in the signed network formed by the real world, the contribution strength of similarity or difference between two nodes is not the same, and there is no prior knowledge about the contribution strength, so that it is not feasible to manually set the values of and Therefore, a self-gating mechanism is designed to discuss the determination process of and in a data-driven manner.
[0112] In one possible implementation, the method 200 further includes: determining, by the electronic device, the contribution strength of similarity between the two nodes based on a preset activation algorithm, a positive sign attribute of a link between the two nodes, and node representations of the two nodes, the positive sign attribute being used to indicate that the link relationship between the two nodes is a positive relationship.
[0113] Optionally, determining, by the electronic device, the contribution strength of similarity between the two nodes based on the preset activation algorithm, the positive sign attribute of the link between the two nodes, and the node representations of the two nodes includes: multiplying, by the electronic device, the node representations of the two nodes respectively with parameters on the signed network, splicing the multiplication results to obtain a third splicing result; mapping, by the electronic device, based on the third splicing result, to obtain a mapping result; and determining, by the electronic device, the contribution strength of similarity between the two nodes based on a product of the mapping result and a value corresponding to the positive sign attribute.
[0114] Specifically, the contribution strength of similarity between the two nodes can be obtained by using the following formula (2).
[0115]
[0116] wherein the preset activation algorithm is sigmoid(·), τ∈{+}, W + represents parameters on the positive link subnetwork in the signed network; f(·) represents a single-layer fully connected neural network; is the result of multiplying the node representation of node i with the parameters on the positive link subnetwork; is the result of multiplying the node representation of node t with the parameters on the positive link subnetwork; is the spliced information; a value corresponding to the positive signed attribute of the link between the two nodes; where t is j or k. It should be understood that f(·), sigmoid(·) and the value corresponding to the positive signed attribute of the link between the two nodes are used in equation (2) to realize the control of the contribution strength of the similarity between the two nodes.
[0117] In a possible implementation, the method 200 further includes: determining, by the electronic device, the contribution strength of the difference between the two nodes based on the preset activation algorithm, the negative signed attribute of the link between the two nodes, and the node representations of the two nodes, where the negative signed attribute is used to indicate that the link relationship between the two nodes is a negative relationship.
[0118] Optionally, determining, by the electronic device, the contribution strength of the difference between the two nodes based on the preset activation algorithm, the negative signed attribute of the link between the two nodes, and the node representations of the two nodes includes: multiplying, by the electronic device, the node representations of the two nodes respectively with the parameters on the signed network, concatenating the multiplication results to obtain a fourth concatenation result; mapping, by the electronic device, based on the fourth concatenation result, to obtain a mapping result; and determining, by the electronic device, the contribution strength of the difference between the two nodes based on the product of the mapping result and a value corresponding to the negative signed attribute.
[0119] Specifically, the contribution strength of the difference between the two nodes can be obtained by using equation (3) as follows.
[0120]
[0121] where τ ∈ {-1, 1}, W - represents the parameters on the negative link subnetwork in the signed network; f(·) represents a single-layer fully connected neural network; represents the multiplication result of the node representation of node i and the parameters on the negative link subnetwork; represents the multiplication result of the node representation of node t and the parameters on the negative link subnetwork; represents the concatenated information; a value corresponding to the negative signed attribute of the link between the two nodes; where t is j or k. It should be understood that f(·), sigmoid(·) and the value corresponding to the negative signed attribute of the link between the two nodes are used in equation (3) to realize the control of the contribution strength of the difference between the two nodes.
[0122] It should be understood that the purpose of studying the signed network is to describe the similarity and difference between the nodes in the signed network by using the node representations in the signed network. Since in the signed network, the similarity between the two nodes in the positive link subnetwork is emphasized more, while the difference between the two nodes in the negative link subnetwork is emphasized more. Therefore, it can be inferred that In equation (1) ζ ii Considered right To standardize And let In the case of , equation (1) can be transformed into equation (4).
[0123]
[0124] in, and
[0125] Figure 4 This is a schematic diagram of the structure of a device for determining node representation provided in an embodiment of this application.
[0126] For example, such as Figure 4 As shown, the device 400 includes:
[0127] The generation module 401 is used to generate a first high-frequency graph signal filter and a first low-frequency graph signal filter of the positively linked subnetwork based on the first degree matrix and the first Laplacian matrix of the positively linked subnetwork, and to generate a second high-frequency graph signal filter and a second low-frequency graph signal filter of the negatively linked subnetwork based on the second degree matrix and the second Laplacian matrix of the negatively linked subnetwork. The positively linked subnetwork and the negatively linked subnetwork are obtained by partitioning a signed network, and the signed network includes multiple nodes.
[0128] Extraction module 402 is used to extract high-frequency information and low-frequency information of the positive link subnetwork using the first high-frequency graph signal filter and the first low-frequency graph signal filter, and to extract high-frequency information and low-frequency information of the negative link subnetwork using the second high-frequency graph signal filter and the second low-frequency graph signal filter. The high-frequency information is used to describe the differences between nodes in the positive link subnetwork or the negative link subnetwork, and the low-frequency information is used to describe the similarity between nodes in the positive link subnetwork or the negative link subnetwork.
[0129] The determination module 403 is used to determine the node representation in the signed network based on the high-frequency information and low-frequency information of the positive link subnetwork, as well as the high-frequency information and low-frequency information of the negative link subnetwork. The node representation is used to predict the link relationship between any two nodes.
[0130] Optionally, the determining module 403 is further configured to: determine a first adjacency matrix of the positively linked subnetwork; determine a first degree matrix based on the first adjacency matrix; and determine a first Laplace matrix based on the first degree matrix and the first adjacency matrix.
[0131] Optionally, the determining module 403 is further configured to determine a third degree matrix of the signed network based on the first degree matrix and the second degree matrix; the apparatus 400 further includes a normalization module configured to normalize the first adjacency matrix based on the third degree matrix to obtain a first normalized adjacency matrix, and normalize the first degree matrix based on the third degree matrix to obtain a first normalized degree matrix; the determining module 403 is further configured to determine a first normalized Laplacian matrix based on the first normalized adjacency matrix and the first normalized degree matrix.
[0132] Optionally, the apparatus 400 further includes a feature decomposition module configured to perform feature decomposition on the first normalized Laplacian matrix to obtain a first eigenvalue matrix, and perform feature decomposition on a second normalized Laplacian matrix of the negative link subnetwork to obtain a second eigenvalue matrix; the generating module 401 is specifically configured to generate the first high-frequency graph signal filter and the first low-frequency graph signal filter based on the first matrix, the first normalized degree matrix and the first eigenvalue matrix, respectively, wherein elements in the first matrix are used to control the contribution degree of similarity between any node in the signed network and the node; and generate the second high-frequency graph signal filter and the second low-frequency graph signal filter based on the second normalized degree matrix and the second eigenvalue matrix, respectively.
[0133] Optionally, the extracting module 402 is specifically configured to determine high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork based on the first matrix and the first normalized adjacency matrix, respectively; and determine high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork based on the second normalized adjacency matrix of the negative link subnetwork.
[0134] Optionally, the determining module 403 is specifically configured to determine node representation based on the high-frequency information of the positive link subnetwork, the high-frequency coefficient matrix of the positive link subnetwork, the low-frequency information of the positive link subnetwork, the low-frequency coefficient matrix of the positive link subnetwork, the high-frequency information of the negative link subnetwork, the high-frequency coefficient matrix of the negative link subnetwork, the low-frequency information of the negative link subnetwork and the low-frequency coefficient matrix of the negative link subnetwork, wherein elements in the high-frequency coefficient matrix are used to control the contribution intensity of difference between any two nodes, and elements in the low-frequency coefficient matrix are used to control the contribution intensity of similarity between any two nodes.
[0135] Optionally, the determining module 403 is further configured to determine the contribution intensity of similarity between two nodes based on a preset activation algorithm, a positive sign attribute of a link between the two nodes and node representation of the two nodes, wherein the positive sign attribute is used to indicate that the link relationship between the two nodes is a positive relationship.
[0136] Optionally, after determining the node representation in the signed network, the determining module 403 is further configured to: determine the link information between any two nodes in the signed network based on the node representation of the two nodes; determine the probability of the link between the two nodes based on the link information between the two nodes, the probability of the link including a positive probability of the link and a negative probability of the link; and the apparatus 400 further includes a comparing module configured to compare the positive probability of the link and the negative probability of the link to obtain the signed attribute of the link.
[0137] Figure 5 FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application.
[0138] For example, as shown in FIG. 5, the electronic device 500 includes a memory 501, a processor 502, and a computer program 503 stored in the memory 501 and running on the processor 502, wherein the processor 502 executes the computer program 503, so that the electronic device can execute any one of the above-described methods for determining a node representation. Figure 5
[0139] The embodiment can divide the functions of the electronic device according to the above method examples, for example, can correspond to each function module, or can integrate two or more functions in one processing module, and the integrated module can be implemented in the form of hardware. It should be noted that the division of the modules in the embodiment is illustrative, and is only a logical function division. In actual implementation, another division manner can be used.
[0140] In the case of dividing each function module corresponding to each function, the electronic device can include a generating module, an extracting module, a determining module, a normalization module, a feature decomposition module, and a comparing module, etc. It should be noted that all related contents of each step involved in the above method embodiments can be referred to the function description of the corresponding function module, which will not be repeated here.
[0141] The electronic device provided by the embodiment is used to execute the above method for determining a node representation, and thus can achieve the same effect as the above implementation method.
[0142] In the case of using an integrated unit, the electronic device can include a processing module and a storage module. The processing module can be used to control and manage the actions of the electronic device. The storage module can be used to store program codes and data of the electronic device.
[0143] The processing module can be a processor or a controller, which can realize or execute various exemplary logical blocks, modules and circuits in combination with the disclosure of the present application. The processor can also be a combination of computing functions, such as including one or more microprocessor combinations, digital signal processing (DSP) and microprocessor combinations, etc. The storage module can be a memory.
[0144] The embodiment provides a computer readable storage medium, which stores instructions, when the instructions are executed on a computer or a processor, the computer or the processor executes any one of the methods for determining node representation introduced in the foregoing.
[0145] The embodiment also provides a computer program product containing instructions, when the computer program product is executed on a computer or a processor, the computer or the processor executes the related steps to realize any one of the methods for determining node representation introduced in the foregoing.
[0146] The electronic device, the computer readable storage medium, the computer program product containing instructions or the chip provided by the embodiment are used to execute the corresponding method provided in the foregoing, so the beneficial effects achieved by the electronic device, the computer readable storage medium, the computer program product containing instructions or the chip can refer to the beneficial effects in the corresponding method provided in the foregoing, and will not be described here.
[0147] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the above division of functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0148] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual elements can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0149] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of determining a node representation, characterized by, The method comprises: generating a first high-frequency graph signal filter and a first low-frequency graph signal filter of the positive link subnetwork based on a first degree matrix and a first Laplacian matrix of the positive link subnetwork, and generating a second high-frequency graph signal filter and a second low-frequency graph signal filter of the negative link subnetwork based on a second degree matrix and a second Laplacian matrix of the negative link subnetwork, the positive link subnetwork and the negative link subnetwork being obtained by dividing a signed network, the signed network comprising a plurality of nodes, a sign attribute of a link between any two nodes being a positive sign attribute or a negative sign attribute, the plurality of nodes representing user nodes or country nodes, a positive relationship in the signed network representing a positive relationship of friendship, trust, like, and support, and a negative relationship representing a negative relationship of enemy, distrust, dislike, and opposition; extracting high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork by using the first high-frequency graph signal filter and the first low-frequency graph signal filter, and extracting high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork by using the second high-frequency graph signal filter and the second low-frequency graph signal filter, the high-frequency information being used to describe a difference between nodes in the positive link subnetwork or the negative link subnetwork, and the low-frequency information being used to describe a similarity between nodes in the positive link subnetwork or the negative link subnetwork; determining a node representation in the signed network based on the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork, and the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork, the node representation being used to predict a link relationship between any two nodes; wherein the determining the node representation in the signed network based on the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork, and the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork comprises: determining the node representation based on the high-frequency information of the positive link subnetwork, a high-frequency coefficient matrix of the positive link subnetwork, the low-frequency information of the positive link subnetwork, a low-frequency coefficient matrix of the positive link subnetwork, the high-frequency information of the negative link subnetwork, a high-frequency coefficient matrix of the negative link subnetwork, the low-frequency information of the negative link subnetwork, and a low-frequency coefficient matrix of the negative link subnetwork, an element in the high-frequency coefficient matrix being used to control a contribution intensity of a difference between any two nodes, and an element in the low-frequency coefficient matrix being used to control a contribution intensity of a similarity between any two nodes; The method further comprises: determining a contribution intensity of a similarity between two nodes based on a preset activation algorithm, the positive sign attribute of a link between the two nodes, and node representations of the two nodes, the positive sign attribute being used to indicate that the link relationship between the two nodes is a positive relationship.
2. The method of claim 1, wherein, The method further comprises: determining a first adjacency matrix of the positive link subnetwork; determining the first degree matrix based on the first adjacency matrix; determine the first Laplacian matrix based on the first degree matrix and the first adjacency matrix.
3. The method of claim 2, wherein, The method further comprises: determine a third degree matrix of the signed network based on the first degree matrix and the second degree matrix; normalize the first adjacency matrix based on the third degree matrix to obtain a first normalized adjacency matrix; normalize the first degree matrix based on the third degree matrix to obtain a first normalized degree matrix; determine a first normalized Laplacian matrix based on the first normalized adjacency matrix and the first normalized degree matrix.
4. The method of claim 1, wherein, The method further comprises: perform eigen decomposition on the first normalized Laplacian matrix to obtain a first eigenvalue matrix, and perform eigen decomposition on the second normalized Laplacian matrix of the negative link subnetwork to obtain a second eigenvalue matrix; and the generating the first high-frequency graph signal filter and the first low-frequency graph signal filter of the positive link subnetwork based on the first degree matrix and the first Laplacian matrix of the positive link subnetwork comprises: generate the first high-frequency graph signal filter and the first low-frequency graph signal filter based on the first matrix, the first normalized degree matrix and the first eigenvalue matrix, respectively, wherein elements in the first matrix are used to control the degree of contribution of similarity between any node in the signed network and the node; and the generating the second high-frequency graph signal filter and the second low-frequency graph signal filter of the negative link subnetwork based on the second degree matrix and the second Laplacian matrix of the negative link subnetwork comprises: generate the second high-frequency graph signal filter and the second low-frequency graph signal filter based on the second normalized degree matrix and the second eigenvalue matrix, respectively.
5. The method of claim 4, wherein, The extracting high-frequency information of the positive link subnetwork and low-frequency information of the positive link subnetwork by using the first high-frequency graph signal filter and the first low-frequency graph signal filter comprises: determine the high-frequency information of the positive link subnetwork and the low-frequency information of the positive link subnetwork based on the first matrix and the first normalized adjacency matrix, respectively; and the extracting high-frequency information of the negative link subnetwork and low-frequency information of the negative link subnetwork by using the second high-frequency graph signal filter and the second low-frequency graph signal filter comprises: determine the high-frequency information of the negative link subnetwork and the low-frequency information of the negative link subnetwork based on the second normalized adjacency matrix of the negative link subnetwork, respectively.
6. The method of claim 1, wherein, After the determining the node representation in the signed network, the method further comprises: determine link information between any two nodes in the signed network based on the node representation of the two nodes; determine a probability of the link between the two nodes based on the link information between the two nodes, wherein the probability of the link comprises a positive probability of the link and a negative probability of the link; compare the positive probability of the link and the negative probability of the link to obtain a signed attribute of the link.
7. An apparatus for determining a node representation, the apparatus comprising: The apparatus comprises: The generating module is configured to generate a first high-frequency graph signal filter and a first low-frequency graph signal filter of the positive link sub-network based on a first degree matrix and a first Laplacian matrix of the positive link sub-network, and generate a second high-frequency graph signal filter and a second low-frequency graph signal filter of the negative link sub-network based on a second degree matrix and a second Laplacian matrix of the negative link sub-network, the positive link sub-network and the negative link sub-network being obtained by dividing a signed network, the signed network including a plurality of nodes, a sign attribute of a link between any two nodes being a positive sign attribute or a negative sign attribute, the plurality of nodes representing user nodes or country nodes, a positive relationship in the signed network representing a positive relationship of friendship, trust, like, and support, and a negative relationship representing a negative relationship of enemy, distrust, dislike, and opposition; The extracting module is configured to extract high-frequency information of the positive link sub-network and low-frequency information of the positive link sub-network by using the first high-frequency graph signal filter and the first low-frequency graph signal filter, and extract high-frequency information of the negative link sub-network and low-frequency information of the negative link sub-network by using the second high-frequency graph signal filter and the second low-frequency graph signal filter, the high-frequency information being used to describe a difference between nodes in the positive link sub-network or the negative link sub-network, and the low-frequency information being used to describe a similarity between nodes in the positive link sub-network or the negative link sub-network; The determining module is configured to determine node representation in the signed network based on the high-frequency information of the positive link sub-network, the low-frequency information of the positive link sub-network, the high-frequency information of the negative link sub-network, and the low-frequency information of the negative link sub-network, the node representation being used to predict a link relationship between any two nodes; The determining module is further configured to determine the node representation based on the high-frequency information of the positive link sub-network, a high-frequency coefficient matrix of the positive link sub-network, the low-frequency information of the positive link sub-network, a low-frequency coefficient matrix of the positive link sub-network, the high-frequency information of the negative link sub-network, a high-frequency coefficient matrix of the negative link sub-network, the low-frequency information of the negative link sub-network, and a low-frequency coefficient matrix of the negative link sub-network, an element in the high-frequency coefficient matrix being used to control a contribution strength of a difference between any two nodes, and an element in the low-frequency coefficient matrix being used to control a contribution strength of a similarity between any two nodes; The determining module is further configured to determine the contribution strength of the similarity between the two nodes based on a preset activation algorithm, the positive sign attribute of the link between the two nodes, and node representations of the two nodes, the positive sign attribute being used to indicate that the link relationship between the two nodes is a positive relationship.
8. An electronic device, comprising: An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to cause the electronic device to perform the method for determining node representation according to any one of claims 1 to 6.