A network representation learning method and apparatus based on temporal triangulation phantoms
By constructing a temporal network and sampling neighboring nodes, calculating influence factors and weights, selecting the optimal temporal triangular motif, and generating node vector representations, the problem of existing methods failing to utilize the features of the temporal triangular motif is solved, thereby improving the accuracy of network representation and link prediction performance.
Patent Information
- Application Number
- CN202111671596.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing network representation learning methods fail to effectively utilize the structural and temporal features of temporal triangular motifs, and cannot accurately reflect the network evolution process.
By constructing a temporal network, sampling neighbor nodes, calculating the influence factor of neighbor nodes on temporal edges and the weight of temporal triangular phantom structure, determining the probability factor and loss function value of candidate temporal triangular phantoms, selecting the optimal temporal triangular phantom, and generating the vector representation of nodes.
It improves the accuracy of network representation, enhances the effectiveness of node classification and link prediction, and captures the temporal characteristics of network evolution.
Smart Images

Figure CN114386571B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network representation learning technology, and in particular to a network representation learning method and apparatus based on temporal triangulation. Background Technology
[0002] With the widespread adoption of the internet and social networks, much of the data in the real world is now presented in a network-like manner, from social networks to real physical networks. Network data, in addition to the information of a single node, incorporates information about the relationships between nodes. Network representation learning aims to generate low-dimensional vector representations for nodes in a network while preserving the similarity relationships between all nodes.
[0003] Existing network representation learning methods primarily represent network data using graph models, generating vector representations for nodes based on the graph model's topology and attribute information. Each edge in a temporal network carries a timestamp, adding a temporal dimension compared to traditional network data. While triangular motifs represent local structural features, temporal triangular motifs incorporate temporal characteristics. The continuous changes in the structural features of temporal triangular motifs can represent the network's evolution. Local triangular motif features with the same structure but different temporal sequences can influence the network's evolution. Therefore, considering the temporal relationships within the formation process of temporal triangular motifs is crucial.
[0004] It is evident that how to perform network representation learning based on temporal triangular phantoms is a technical problem that needs to be solved. Summary of the Invention
[0005] This application provides a network representation learning method and apparatus based on temporal triangular phantoms, which simultaneously considers the structural and temporal features of temporal triangular phantoms to achieve network representation learning.
[0006] Firstly, a network representation learning method based on temporal triangular phantoms is provided, including:
[0007] A time-series network is constructed based on historical data. The time-series network includes a set of nodes and a set of time-series edges. The nodes in the set of nodes represent objects, and the time-series edges in the set of time-series edges represent events between objects. The events include time features.
[0008] For each temporal edge in the set of temporal edges, neighboring nodes are selected from the set of nodes to obtain the set of neighboring nodes corresponding to each temporal edge.
[0009] For a first temporal edge in the set of temporal edges, the influence factor of each neighboring node on the first temporal edge is determined based on the events generated by each neighboring node of the first temporal edge; wherein, the first temporal edge is any one of the temporal edges in the set of temporal edges;
[0010] For the candidate temporal triangular module structure formed by the first temporal edge and each corresponding neighbor node, the probability factor corresponding to each candidate temporal triangular module is determined according to the influence factor of the neighbor node on the temporal edge and the weight of the temporal triangular module structure.
[0011] Based on the probability factor of each candidate temporal triangulation, determine the probability corresponding to each candidate temporal triangulation.
[0012] Based on the probability corresponding to each candidate temporal triangular module, the loss function value corresponding to each candidate temporal triangular module is determined based on the loss function, and based on the loss function value corresponding to each candidate temporal triangular module, the optimal temporal triangular module is selected from the candidate temporal triangular modules composed of the first temporal edge and each corresponding neighbor node.
[0013] Based on the optimal temporal triangulation model, the vector representation of the corresponding node is determined.
[0014] Optionally, for each temporal edge in the temporal edge set, neighboring nodes are selected from the node set to obtain the neighboring node set corresponding to each temporal edge, including:
[0015] Select the current temporal edge from the set of temporal edges;
[0016] Select nodes from the set of nodes that may form a temporal module with the current temporal edge, and save the selected nodes to the set of neighboring nodes corresponding to the current temporal edge;
[0017] Select a neighbor node from the set of neighbor nodes corresponding to the current temporal edge, and determine whether the selected neighbor node can form a temporal triangle with the current temporal edge;
[0018] If the selected neighbor node can form a temporal triangle with the current temporal edge, then from the temporal triangle formed by the currently selected neighbor node and the current temporal edge, select the earlier temporal edge from the two temporal edges other than the current temporal edge, and start selecting the corresponding neighbor node for the earlier temporal edge.
[0019] If the selected neighbor node cannot form a temporal triangle with the current temporal edge, then continue to select neighbor nodes for the current temporal edge until the number of neighbor nodes corresponding to the current temporal edge is greater than or equal to a set threshold.
[0020] Optionally, after selecting nodes from the node set that may form a temporal module with the current temporal edge, and saving the selected nodes to the neighbor node set corresponding to the current temporal edge, the method further includes:
[0021] Select a first-order node from the set of nodes and save the selected first-order node to the set of neighbor nodes corresponding to the current temporal edge.
[0022] Optionally, the influence factor satisfies the following formula:
[0023]
[0024] Where, α Δh The influence factor of the neighbor node h of the first time-order edge on the first time-order edge; This represents the influence of the first edge of the temporal triangle module formed by the first temporal edge and its neighboring node h; This represents the effect of the second edge of the triangular module formed by the first temporal edge and its neighboring node h; if the neighboring node h can form a temporal triangular module with this temporal edge, then mask(h) is 1; otherwise, mask(h) is 0. s and t h This indicates the time when the first edge and the second edge were established; where the starting point of the first temporal edge is node x and the ending point is node y.
[0025] Optionally, the probability factor satisfies the following formula:
[0026]
[0027] Where, λ x,y (t) represents a structure of type s consisting of the first temporal edge and its neighbor node h. n The probability factor corresponding to the temporal triangular phantom, where the starting point of the first temporal edge is node x and the ending point is node y; μ x,y α represents the basic strength between node x and node y. Δh The t represents the influence factor of the neighbor node h of the first temporal edge on the first temporal edge; s and t h This indicates that the structure consisting of the first temporal edge and the neighbor node h is of type s. n The time when the first and second edges in the temporal triangular model are established; s n The weights of the identified temporal triangular phantom structure.
[0028] Optionally, the weights of the temporal triangular phantom structure satisfy the following formula:
[0029]
[0030] Among them, s n This indicates a type number for a temporal triangular phantom structure. s nThe weights of the identified temporal triangular phantom structure, s′ n Indicates that it does not belong to the s n The number of other phantom structure types of the identified temporal triangular phantom structure.
[0031] Secondly, a network representation learning device based on temporal triangulation is provided, comprising:
[0032] The temporal network construction module is used to construct a temporal network based on historical data. The temporal network includes a set of nodes and a set of temporal edges. The nodes in the node set represent objects, and the temporal edges in the temporal edge set represent events between objects. The events include time features.
[0033] The neighbor node sampling module is used to select neighbor nodes from the node set for each time-series edge in the time-series edge set, so as to obtain the neighbor node set corresponding to each time-series edge.
[0034] The node representation module is used to determine the influence factor of each neighbor node on the first temporal edge based on the events generated by each neighbor node of the first temporal edge in the temporal edge set; wherein, the first temporal edge is any one of the temporal edges in the temporal edge set;
[0035] For the candidate temporal triangular module structure formed by the first temporal edge and each corresponding neighbor node, the probability factor corresponding to each candidate temporal triangular module is determined according to the influence factor of the neighbor node on the temporal edge and the weight of the temporal triangular module structure.
[0036] Based on the probability factor of each candidate temporal triangulation, determine the probability corresponding to each candidate temporal triangulation.
[0037] Based on the probability corresponding to each candidate temporal triangular module, the loss function value corresponding to each candidate temporal triangular module is determined based on the loss function, and based on the loss function value corresponding to each candidate temporal triangular module, the optimal temporal triangular module is selected from the candidate temporal triangular modules composed of the first temporal edge and each corresponding neighbor node.
[0038] Based on the optimal temporal triangulation model, the vector representation of the corresponding node is determined.
[0039] Thirdly, a communication device is provided, comprising: a processor and a memory; the memory storing computer instructions; the processor being configured to read the computer instructions and execute the method as described in any one of the first aspects above.
[0040] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method as described in any one of the first aspects above.
[0041] Fifthly, a computer program product is provided, which, when invoked by a computer, causes the computer to perform the method as described in any one of the first aspects above. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic diagram of the timing triangulation phantom in the embodiments of this application;
[0044] Figure 2 A flowchart illustrating a network representation learning method based on temporal triangulation motifs provided in this application embodiment;
[0045] Figure 3 This is a schematic diagram of a neighbor node acquisition process provided in an embodiment of this application;
[0046] Figure 4 This is a schematic diagram of the node comparison results in the embodiments of this application;
[0047] Figure 5 This is a schematic diagram of the link prediction comparison results in the embodiments of this application;
[0048] Figure 6 A schematic diagram of the network representation learning device based on temporal triangulation provided in this application embodiment. Detailed Implementation
[0049] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0050] The terms "first" and "second" used herein are for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0051] This application proposes a network representation learning method based on temporal triangulation, considering both the structural and temporal features of temporal triangulation. Using this method, the temporal and structural features of a temporal network can be learned, generating vector representations for nodes in the network. These representations can then be used for downstream tasks such as node classification, link prediction, and node recommendation.
[0052] This application embodiment can measure the impact of temporal triangulation during the formation process, perform maximum likelihood estimation on the impact of temporal triangulation, and thereby generate ideal node representations for each node in the network. Specifically, in this application embodiment, temporal triangulation can be sampled, the impact of temporal triangulation can be modeled using a Hawkes process, and then stochastic gradient descent (SGD) optimization technique can be used to learn the ideal representation of the nodes.
[0053] Among them, the Hawkes process is a point process with historical self-excitation, which can simulate the continuous influence of historical events on current events.
[0054] A temporal module refers to a local feature with a fixed structure during the evolution of a network. The temporal module in this embodiment is a temporal triangular module. The definition of a temporal triangular module is as follows: Given a set of three nodes Ψ = (v... s ,v h ,v t A local structural feature consisting of three nodes is called a temporal triangular motif. Temporal triangular motifs can be divided into closed temporal triangular motifs and open temporal triangular motifs. A closed temporal triangular motif has three edges (i.e., there are edges between each node), while an open temporal triangular motif has only two edges. Figure 1 Some timing triangulation phantoms from embodiments of this application are illustrated by way of example. For example... Figure 1 As shown in the figure, the timing triangulation shown in the gray background is an open timing triangulation, while the others are closed timing triangulations.
[0055] For ease of description, in this embodiment, the three sides of the closed temporal triangular phantom are referred to as the first side, the second side, and the third side in ascending order of timestamps (i.e., from front to back). For example, based on the order in which the sides were generated, the sides in the temporal triangular phantom can be defined as the earliest established first side, the second established second side, and the latest established third side.
[0056] The embodiments of this application can be applied to time-series network modeling of data such as web logs, traffic, and user behavior on social platforms.
[0057] In the following embodiments of this application, for ease of description, objects (such as users) are abstracted as nodes, and events between objects (such as user behavior) are abstracted as temporal edges, which include time features. Taking the publicly available data resources of DBLP (Database systems and Logic Programming, an integrated database system for English computer science literature centered on authors) as an example, DBLP is a database that records articles published by authors. Each author is a user (i.e., a node), and the user's historical behavior records the collaborative relationships between authors. The user's historical behavior can be regarded as an event (i.e., a temporal edge).
[0058] Figure 2 An exemplary flowchart of a network representation learning method based on temporal triangulation phantoms provided in an embodiment of this application is illustrated. This process can be implemented by a network representation learning device based on temporal triangulation phantoms, which can be implemented in software, hardware, or a combination of both. As shown in the figure, the process may include the following steps:
[0059] S201: Construct a temporal network based on temporal network data, wherein the temporal network includes a set of nodes and a set of temporal edges.
[0060] The structure of a temporal network is described as follows: Given a dynamic temporal network G = (V, E, T), where V represents the set of nodes, E represents the set of edges, and T represents the set of timestamps. Every edge in the network is directed, and a directed edge is called a temporal edge. A temporal edge (i.e., an event) Represents node v i and node v j An edge is established at time t.
[0061] Traditional temporal networks are represented using commutation matrices, but this is unsuitable because temporal edges can repeat. To facilitate the subsequent search for temporal modules, this embodiment uses a dictionary to represent the temporal network:
[0062] G[x]=[(y1,t1),(y2,t2),...,(y n ,t n )]………………(1)
[0063] Where G[x] represents the set of all temporal edges originating from node x, and an edge consists of (y... i ,t i (where 1≤i≤n), for example, (y1,t1) means that a temporal edge is established between node x and node y1 at time t1.
[0064] For each node in the node set of a temporal network, the temporal edges originating from that node can be represented in the manner described above.
[0065] S202: For each temporal edge in the set of temporal edges, select neighboring nodes from the set of nodes to obtain the set of neighboring nodes corresponding to each temporal edge.
[0066] This step can be based on temporal triangulation to sample neighbor nodes. Specifically, for a given temporal edge, neighbor nodes corresponding to that edge are selected from the node set, resulting in a set of neighbor nodes for that edge. For each temporal edge, its corresponding neighbor nodes include nodes that can form a temporal triangulation with that edge. Furthermore, first-order nodes can also be included. First-order nodes are nodes that cannot form a temporal triangulation with any temporal edge.
[0067] Optionally, in order to reduce computational complexity and overhead, in this embodiment of the application, the size of the neighbor node set can be limited so that the number of nodes in the neighbor node set corresponding to a temporal edge does not exceed a set threshold.
[0068] Traditional temporal network representation learning methods, such as DeepWalk and LINE, optimize neighbor node sampling strategies based on random walks. These methods do not consider the structural features and temporal relationships between neighbor nodes. This application presents a neighbor node sampling method based on temporal triangulation, which takes into account the structural features and temporal relationships between nodes.
[0069] Figure 3 An exemplary flowchart of a neighbor node sampling method is shown. This flowchart describes the process of collecting neighbor nodes corresponding to time-series edges. As shown in the figure, the flowchart may include the following steps:
[0070] S301: Select the temporal edge of the neighbor node to be sampled from the temporal edge set, and use the currently selected temporal edge as the current temporal edge.
[0071] S302: Determine whether the number of nodes in the neighbor node set corresponding to the current time sequence edge is less than the set threshold. If yes, proceed to S303; otherwise, end this process.
[0072] Because the number of nodes or temporal edges in a temporal network is large, the neighbor node sampling process may be highly complex and computationally expensive. This application embodiment controls the complexity and computational cost of the neighbor node collection process by limiting the size of the neighbor node set. Specifically, this application embodiment pre-sets a threshold. When the number of neighbor nodes sampled for a temporal edge is greater than or equal to this threshold, neighbor node sampling for the current temporal edge is stopped. This threshold can be understood as the size win of a historical window, where win refers to the number of nodes whose occurrence time is closest to the current edge.
[0073] In this step, if the number of nodes in the neighbor node set corresponding to the current time-series edge is greater than or equal to a set threshold (i.e., the size of the neighbor node set window), it indicates that the number of nodes in the neighbor node set corresponding to the current time-series edge has reached the limit of the window, and the collection process for the neighbor nodes of the current time-series edge can be terminated. For example, the set threshold value is N (N is an integer greater than or equal to 1, and N is a predefined number of neighbor nodes). When the number of nodes in the neighbor node set corresponding to the current time-series edge reaches N, the neighbor node collection ends.
[0074] S303: Select nodes from the node set that can form a temporal module with the current temporal edge, and save the selected nodes to the neighbor node set corresponding to the current temporal edge.
[0075] S304: Select a first-order node from the node set and save the selected first-order node to the neighbor node set corresponding to the current temporal edge.
[0076] In real-world datasets, some nodes cannot form a temporal triangulation with any temporal edge; these nodes are called first-order nodes. This application's embodiments can find first-order nodes and add them to the set of neighboring nodes corresponding to the current temporal edge.
[0077] It is understandable that step S304 is optional. If there are no first-order nodes in the node set of the temporal network, step S304 can be skipped.
[0078] S305: Select a neighbor node from the set of neighbor nodes corresponding to the current temporal edge.
[0079] Optionally, a neighbor node can be randomly selected from the set of neighbor nodes corresponding to the current temporal edge.
[0080] S306: Determine whether the selected neighbor node can form a temporal triangle with the current temporal edge. If yes, proceed to S307; otherwise, proceed to S308.
[0081] In this step, the currently selected neighbor node may be a first-order node. If it is a first-order node, it cannot form a temporal triangle with the current temporal edge. In this case, proceed to S308, keep the current temporal edge unchanged, and continue to select the neighbor node of the current temporal edge.
[0082] S307: From the temporal triangle formed by the currently selected neighboring nodes and the current temporal edge, select the earlier temporal edge from the two temporal edges other than the current temporal edge, and go to S302, so that the earlier temporal edge is used as the current temporal edge, and start sampling the neighboring nodes corresponding to the temporal edge.
[0083] S308: Keep the current time-series edge unchanged and go to S302, so as to continue to select neighbor nodes for the current time-series edge until the number of neighbor nodes corresponding to the current time-series edge is greater than or equal to the set threshold.
[0084] By using the neighbor node sampling process described above, the set of neighbor nodes corresponding to each temporal edge can be obtained.
[0085] S203: For each temporal edge, determine the influence factor of each neighbor node on the temporal edge based on the temporal edges generated by each corresponding neighbor node; wherein, the influence factor of a neighbor node on the temporal edge represents the degree of influence of the neighbor on the temporal edge.
[0086] For clarity, let's take the first time-series edge as an example (the first time-series edge is any one of all time-series edges). In this step, for the first time-series edge, we can determine the influence factor of each neighbor node on the first time-series edge based on the events generated by each neighbor node. Following the above method, we can calculate the influence factor of each neighbor node on each time-series edge for that time-series edge.
[0087] Taking a time-series edge with node x as the starting point and node y as the ending point as an example, select a neighbor node h from the set of neighbor nodes corresponding to this time-series edge, and calculate the influence of neighbor node h on this time-series edge according to the following formula:
[0088]
[0089] Where, α Δh Let α be the influence factor of the neighboring node h on the temporal edge, representing the overall influence of the temporal triangulation, i.e., α. Δh It is a parameter used to measure the total influence of a time-series triangulation phantom. This represents the impact of the first edge (i.e., the first edge established) of the temporal triangle formed by this temporal edge and its neighboring node h. This represents the effect of the second edge of the temporal triangle phantom formed by the temporal edge and its neighboring node h. `mask(h)` indicates whether the neighboring node h can form a temporal triangle phantom with the temporal edge; if it can, `mask(h)` is 1; otherwise, it is 0. s and t h This indicates the time when the first and second edges were established.
[0090] S204: For each candidate temporal triangular module consisting of each temporal edge and its corresponding neighbor node, determine the probability factor corresponding to each candidate temporal triangular module based on the influence factor of the neighbor node on the temporal edge and the weight of the temporal triangular module structure (i.e., the module structure to which the candidate temporal triangular module belongs).
[0091] For clarity, let's take the first temporal edge and its corresponding neighbor node as an example. The structure of the temporal triangle module formed by this temporal edge and its neighbor node may exist in various ways, such as... Figure 1 As shown, the same three nodes can form 20 different temporal triangular modules. For each candidate temporal triangular module formed by the first temporal edge and its neighboring node, the probability factor corresponding to each candidate temporal triangular module structure can be determined based on the influence factor of the neighboring node on the temporal edge and the weight of the module structure to which the candidate temporal triangular module belongs.
[0092] It should be noted that the number of time-series triangular phantom structures may be large, and the embodiments of this application may select some of the time-series triangular phantom structures for calculation.
[0093] This application's embodiments design attention mechanisms for triangular phantoms with different structures and timings. The attention mechanism assigns coefficients, a type of weighting parameter, to different scenarios. For example... Figure 1 As shown, the 20 temporal triangulations contain the same nodes but have different structures. The probability of forming these 20 different temporal triangulations varies. To differentiate the impact of different open temporal triangulations, this application introduces an attention mechanism to measure the magnitude of the impact of different phasings; for example, the weights corresponding to these 20 temporal triangulation structures can be predefined.
[0094] The attention weights corresponding to the temporal triangular phantom structure are set based on the attention mechanism, and the formula is as follows:
[0095]
[0096] Among them, s nThis indicates the type of a temporal triangular motif structure, such as a type number. For example, for... Figure 1 The structure of the 20 time-series triangular phantoms can be pre-set with a number for each structure to identify a structure type. This indicates the structure (i.e., s) n The weights of the temporal triangular phantom structure (the identified structure) are in s n The input is then normalized using the SoftMax function (i.e., the weights of the current temporal triangular phantom structure are divided by the sum of all other weights, normalizing all data to between 0 and 1), resulting in weights with values between 0 and 1. n Indicates not belonging to s n The corresponding numbers for other phantom structure types.
[0097] Based on the above formula, the weights of each time-series triangular phantom structure can be calculated.
[0098] In this embodiment of the application, the probability factor corresponding to each candidate temporal triangular phantom can be calculated based on the weight influence factor of the temporal triangular phantom structure.
[0099] Taking a time-series edge with node x as the starting point and node y as the ending point, and its corresponding neighbor node h as an example, the event... The magnitude of the influence of (i.e., the timing edge) can be expressed as:
[0100]
[0101] Where, λ x,y (t) represents e x,y The magnitude of the influence at time t, where μ x,y Representing the basic strength, it is generally believed that the closer two nodes are, the more similar they are, and the higher the probability of generating an edge, so μ x,y It is usually represented as a negative Euclidean distance vector: μ x,y =-||xy|| 2 Δh represents the neighboring nodes of node x (i.e., neighboring node h), including neighboring nodes that can form a temporal triangulation and first-order nodes. The resulting impact is denoted as α. Δh , t s and t h This indicates the time when the first and second edges were established.
[0102] It is understandable that λ is calculated according to the above formula. x,y (t) indicates that the structure type formed by the temporal edge and its neighboring node h is s. n The probability factor corresponding to the time-series triangular motif.
[0103] S205: Determine the probability corresponding to each candidate time-series triangular motif based on the probability factor of each candidate time-series triangular motif.
[0104] Taking a time-series edge with node x as the starting point and node y as the ending point as an example, due to the event (Instantaneous edge) has already occurred, so the event The probability of it occurring should be maximized. (Event) The probability formula for its occurrence is as follows:
[0105]
[0106] Among them, H Δ (t) represents the candidate neighbor node sequence selected according to the neighbor node sampling algorithm, and y′ represents H. Δ All nodes in (t) except node x. Calculate the influence between nodes x and y by dividing by H. Δ The influence of all nodes except node x in (t) is used to calculate p(x,y|H). Δ Let (t) be the event. The probability of occurrence.
[0107] Furthermore, after calculating the probabilities, the maximum likelihood estimation algorithm can be used to maximize p(x,y|H). Δ (t)). Optionally, the maximum likelihood estimation formula is as follows:
[0108]
[0109] Where logL represents the event. The likelihood function generates the probability. The likelihood function is the logarithm of the probability p, which simplifies the calculation without affecting the monotonicity of the probability.
[0110] S206: Based on the probability corresponding to each candidate temporal triangular module, determine the loss function value corresponding to each candidate temporal triangular module based on the loss function, and select the optimal temporal triangular module from the candidate temporal triangular modules composed of each temporal edge and each corresponding neighbor node based on the loss function value corresponding to each candidate temporal triangular module.
[0111] For clarity, taking the first temporal edge and its corresponding neighbor node h as an example, according to this step, the loss function value of each candidate triangular motif can be calculated based on the probability of each candidate triangular motif, based on the candidate triangular motifs corresponding to all motif structures formed by the first temporal edge and its neighbor node h. Then, based on the loss function value of each candidate triangular motif, the optimal candidate temporal triangular motif can be selected from the candidate triangular motifs corresponding to all motif structures formed by the first temporal edge and its neighbor node h.
[0112] In this embodiment, stochastic gradient descent (SDG) can be used to seek the optimal solution, calculate the gradient of the embedding vector, and update it. However, as shown in formula (7), the gradients of all remaining nodes in the network need to be calculated when updating, which leads to a huge computational load. Therefore, this embodiment can use negative sampling techniques to reduce the computational load, based on the degree distribution of the nodes: To sample negative samples, in order to ensure λ x,y The non-negativity of (t) will Recorded as The optimized loss function formula is as follows:
[0113]
[0114] Where K represents according to P n (v) The number of negative samples sampled according to the distribution pattern, where σ represents the Sigmoid function:
[0115]
[0116] S207: Determine the vector representation of the corresponding node based on the optimal temporal triangulation model.
[0117] In this embodiment, the influence of triangulation during network development is considered. Based on sampled neighbor nodes, the Hawkes process is used to quantify the impact of historical events (i.e., historical temporal edges) generated by neighbor nodes on the temporal edges corresponding to those neighbor nodes. This influence is introduced during the process of finding the optimal solution based on the loss function, thereby improving the reliability of the temporal network representation. The influence considered in this embodiment is the impact generated during the construction of the temporal triangulation, capturing the process of forming a closed triangulation from an open temporal triangulation. This process from an open to a closed triangulation can represent the network's evolution.
[0118] According to embodiments of this application, by learning the temporal and structural features of a temporal network, a vector representation is generated for each node in the network, which can be further used for downstream tasks such as node classification, link prediction, and node recommendation.
[0119] Node classification involves using learned node vector representations as feature inputs to train a logistic regression classifier. Link prediction aims to determine the existence of a temporal edge between two future nodes based on historical data over a period of time. To achieve this, the dataset can be divided into two parts using a parameter k. Temporal edges with timestamps less than k form the training set, while those with timestamps greater than k form the test set. Unconnected temporal edges (those not actually established) are added to the test set. For events... You can use |xy| as input to train a logistic regression classifier.
[0120] The following presents the comparative results of the embodiments of this application outperforming several target comparison algorithms in two downstream tasks: node classification and link prediction.
[0121] like Figure 4 As shown, the method of this application embodiment (labeled as "method" in the figure) outperforms existing methods in both Macro-f1 and Micro-f1 metrics. Among many algorithms that consider temporal features, the performance of this application embodiment is the best because it considers the effects of triangular phantoms at different temporal times. Nodes that can form temporal triangular phantoms are more likely to belong to the same class, and their similarity should be higher. Triangular phantoms at different temporal times have different effects, and compared to the MTNE method that only considers the structural features of triangular phantoms, the method of this application embodiment performs better.
[0122] like Figure 5 As shown, similar to the effect of node classification, the method of this application embodiment (labeled as "method" in the figure) outperforms other algorithms in terms of precision, recall, and F1 score. Algorithms considering time sequence are significantly superior to DeepWalk and Node2vec. Furthermore, HTNE, MTNE, MMDNE, and the method of this application embodiment outperform DynamicTriad and HNIP. This is because the method of this application embodiment utilizes Hawkes processes for modeling. Since Hawkes processes use maximum likelihood estimation to solve for the probability of edge generation, they can achieve better results for link prediction tasks. Among HTNE, MTNE, MMDNE, and the method of this application embodiment, the method of this application embodiment performs best. It can be seen that considering the influence of different time sequence triangulation modalities improves the link prediction effect, allowing for a more accurate estimation of the probability of edge generation, thereby improving the link prediction effect.
[0123] Based on the same technical concept, embodiments of this application also provide a network representation learning method and apparatus based on temporal triangulation phantoms.
[0124] like Figure 6 As shown, the device may include: a time-series network construction module 601, a neighbor node sampling module 602, and a node representation module 603.
[0125] The temporal network construction module 601 is used to construct a temporal network based on historical data. The temporal network includes a set of nodes and a set of temporal edges. The nodes in the set of nodes represent objects, and the temporal edges in the set of temporal edges represent events between objects. The events include time features.
[0126] The neighbor node sampling module 602 is used to select neighbor nodes from the node set for each time-series edge in the time-series edge set, so as to obtain the neighbor node set corresponding to each time-series edge.
[0127] Node representation module 603 is used to perform the following operations:
[0128] For a first temporal edge in the set of temporal edges, the influence factor of each neighboring node on the first temporal edge is determined based on the events generated by each neighboring node of the first temporal edge; wherein, the first temporal edge is any one of the temporal edges in the set of temporal edges;
[0129] For the candidate temporal triangular module structure formed by the first temporal edge and each corresponding neighbor node, the probability factor corresponding to each candidate temporal triangular module is determined according to the influence factor of the neighbor node on the temporal edge and the weight of the temporal triangular module structure.
[0130] Based on the probability factor of each candidate temporal triangulation, determine the probability corresponding to each candidate temporal triangulation.
[0131] Based on the probability corresponding to each candidate temporal triangular module, the loss function value corresponding to each candidate temporal triangular module is determined based on the loss function, and based on the loss function value corresponding to each candidate temporal triangular module, the optimal temporal triangular module is selected from the candidate temporal triangular modules composed of the first temporal edge and each corresponding neighbor node.
[0132] Based on the optimal temporal triangulation model, the vector representation of the corresponding node is determined.
[0133] Optionally, the neighbor node sampling module 602 may be specifically used to: select a current time-series edge from the set of time-series edges; select nodes from the set of nodes that may form a time-series module with the current time-series edge, and save the selected nodes to the set of neighbor nodes corresponding to the current time-series edge; select a neighbor node from the set of neighbor nodes corresponding to the current time-series edge, and determine whether the selected neighbor node can form a time-series triangular module with the current time-series edge; if the selected neighbor node can form a time-series triangular module with the current time-series edge, then from the time-series triangular module formed by the currently selected neighbor node and the current time-series edge, select the earlier time-series edge from the two time-series edges other than the current time-series edge, and start selecting the corresponding neighbor node for the earlier time-series edge; if the selected neighbor node cannot form a time-series triangular module with the current time-series edge, then continue to select a neighbor node for the current time-series edge until the number of neighbor nodes corresponding to the current time-series edge is greater than or equal to a set threshold.
[0134] Optionally, the neighbor node sampling module 602 is further configured to: select a first-order node from the node set and save the selected first-order node to the neighbor node set corresponding to the current time-series edge.
[0135] Optionally, the formula for calculating the influence factor can be as shown in formula (2) above.
[0136] Optionally, the probability factor can be calculated using the formula shown in formula (4) above.
[0137] Optionally, the formula for calculating the weight of the time-series triangular phantom structure can be as shown in formula (3) above.
[0138] This application also provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the methods described in the above embodiments.
[0139] This application also provides a computer program product, which, when invoked by a computer, causes the computer to execute the methods described in the above embodiments.
[0140] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0142] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0144] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A network representation learning method based on temporal triangular phantoms, characterized in that, include: The communication device receives historical data from the database system and constructs a time-series network based on the received historical data. The time-series network includes a set of nodes and a set of time-series edges. The nodes in the set of nodes represent users, and the time-series edges in the set of time-series edges represent user behaviors between users. The user behaviors include time features. Each edge in the network is directed, and a directed edge consists of the user behaviors of the two users on the edge. For each time-series edge in the time-series edge set, the communication device selects neighboring nodes from the node set to obtain the neighboring node set corresponding to each time-series edge. The communication device determines the influence factor of each neighbor node on the first time-series edge based on the events generated by each neighbor node of the first time-series edge in the time-series edge set; wherein, the first time-series edge is any one of the time-series edges in the time-series edge set; The communication device determines the probability factor corresponding to each candidate temporal triangular module based on the influence factor of the neighboring nodes on the temporal edge and the weight of the temporal triangular module structure for the candidate temporal triangular module structure formed by the first temporal edge and each corresponding neighboring node. The communication device determines the probability corresponding to each candidate temporal triangulation based on the probability factor of each candidate temporal triangulation. The communication device determines the loss function value corresponding to each candidate temporal triangular module based on the probability corresponding to each candidate temporal triangular module, and selects the optimal temporal triangular module from the candidate temporal triangular modules composed of the first temporal edge and each corresponding neighbor node based on the loss function value corresponding to each candidate temporal triangular module. The communication device determines the vector representation of the corresponding node based on the optimal temporal triangulation model, and uses the vector representation of the corresponding node to perform the link prediction task.
2. The method as described in claim 1, characterized in that, The communication device selects neighboring nodes from the node set for each time-series edge in the time-series edge set, obtaining a neighboring node set corresponding to each time-series edge, including: The communication device selects the current time-series edge from the set of time-series edges; The communication device selects nodes from the node set that may form a temporal module with the current temporal edge, and saves the selected nodes to the neighbor node set corresponding to the current temporal edge; The communication device selects a neighbor node from the set of neighbor nodes corresponding to the current temporal edge and determines whether the selected neighbor node can form a temporal triangle with the current temporal edge. If the selected neighbor node can form a time triangular model with the current time edge, the communication device selects the earlier time edge from the two time edges other than the current time edge in the time triangular model formed by the currently selected neighbor node and the current time edge, and starts to select the corresponding neighbor node for the earlier time edge. If the selected neighbor node cannot form a temporal triangle with the current temporal edge, the communication device continues to select neighbor nodes for the current temporal edge until the number of neighbor nodes corresponding to the current temporal edge is greater than or equal to a set threshold.
3. The method as described in claim 2, characterized in that, After selecting nodes from the node set that may form a temporal module with the current temporal edge, and saving the selected nodes to the neighbor node set corresponding to the current temporal edge, the communication device further includes: The communication device selects a first-order node from the node set and saves the selected first-order node to the neighbor node set corresponding to the current temporal edge.
4. The method as described in claim 1, characterized in that, The impact factor satisfies the following formula: Where, α Δh The influence factor of the neighbor node h of the first time-order edge on the first time-order edge; This represents the influence of the first edge of the temporal triangle module formed by the first temporal edge and its neighboring node h; This represents the effect of the second edge of the triangular module formed by the first temporal edge and its neighboring node h; if the neighboring node h can form a temporal triangular module with this temporal edge, then mask(h) is 1; otherwise, mask(h) is 0. s and t h This indicates the time when the first edge and the second edge were established; where the starting point of the first temporal edge is node x and the ending point is node y.
5. The method as described in claim 1, characterized in that, The probability factor satisfies the following formula: Where, λ x,y (t) represents a structure of type s consisting of the first temporal edge and its neighbor node h. n The probability factor corresponding to the temporal triangular phantom, where the starting point of the first temporal edge is node x and the ending point is node y; μ x,y α represents the basic strength between node x and node y. Δh The t represents the influence factor of the neighbor node h of the first temporal edge on the first temporal edge; s and t h This indicates that the structure consisting of the first temporal edge and the neighbor node h is of type s. n The time when the first and second edges in the temporal triangular model are established; s n The weights of the identified temporal triangular phantom structure.
6. The method as described in claim 1, characterized in that, The weights of the time-series triangular phantom structure satisfy the following formula: Among them, s n This indicates a type number for a temporal triangular phantom structure. s n The weights of the identified temporal triangular phantom structure, s ′ n Indicates that it does not belong to the s n The number of other phantom structure types of the identified temporal triangular phantom structure.
7. A network representation learning device based on temporal triangulation, characterized in that, include: The temporal network construction module is used to construct a temporal network based on historical data. The temporal network includes a set of nodes and a set of temporal edges. The nodes in the set of nodes represent users, and the temporal edges in the set of temporal edges represent user behaviors between users. The user behaviors include time features. Every edge in the network is directed, and a directed edge consists of the user behaviors of the two users on the edge. The neighbor node sampling module is used to select neighbor nodes from the node set for each time-series edge in the time-series edge set, so as to obtain the neighbor node set corresponding to each time-series edge. The node representation module is used to determine the influence factor of each neighbor node on the first temporal edge based on the events generated by each neighbor node of the first temporal edge in the temporal edge set; wherein, the first temporal edge is any one of the temporal edges in the temporal edge set; For the candidate temporal triangular module structure formed by the first temporal edge and each corresponding neighbor node, the probability factor corresponding to each candidate temporal triangular module is determined according to the influence factor of the neighbor node on the temporal edge and the weight of the temporal triangular module structure. Based on the probability factor of each candidate temporal triangulation, determine the probability corresponding to each candidate temporal triangulation. Based on the probability corresponding to each candidate temporal triangular module, the loss function value corresponding to each candidate temporal triangular module is determined based on the loss function, and based on the loss function value corresponding to each candidate temporal triangular module, the optimal temporal triangular module is selected from the candidate temporal triangular modules composed of the first temporal edge and each corresponding neighbor node. Based on the optimal temporal triangulation model, the vector representation of the corresponding node is determined.
8. The apparatus as claimed in claim 7, characterized in that, The neighbor node sampling module is specifically used for: Select the current temporal edge from the set of temporal edges; Select nodes from the set of nodes that may form a temporal module with the current temporal edge, and save the selected nodes to the set of neighboring nodes corresponding to the current temporal edge; Select a neighbor node from the set of neighbor nodes corresponding to the current temporal edge, and determine whether the selected neighbor node can form a temporal triangle with the current temporal edge; If the selected neighbor node can form a temporal triangle with the current temporal edge, then from the temporal triangle formed by the currently selected neighbor node and the current temporal edge, select the earlier temporal edge from the two temporal edges other than the current temporal edge, and start selecting the corresponding neighbor node for the earlier temporal edge. If the selected neighbor node cannot form a temporal triangle with the current temporal edge, then continue to select neighbor nodes for the current temporal edge until the number of neighbor nodes corresponding to the current temporal edge is greater than or equal to a set threshold.
9. The apparatus as claimed in claim 8, characterized in that, The neighbor node sampling module is also used for: Select a first-order node from the set of nodes and save the selected first-order node to the set of neighbor nodes corresponding to the current temporal edge.
10. The apparatus as claimed in claim 7, characterized in that, The impact factor satisfies the following formula: Where, α Δh The influence factor of the neighbor node h of the first time-order edge on the first time-order edge; This represents the influence of the first edge of the temporal triangle module formed by the first temporal edge and its neighboring node h; This represents the effect of the second edge of the triangular module formed by the first temporal edge and its neighboring node h; if the neighboring node h can form a temporal triangular module with this temporal edge, then mask(h) is 1; otherwise, mask(h) is 0. s and t h This indicates the time when the first edge and the second edge were established; where the starting point of the first temporal edge is node x and the ending point is node y.
11. The apparatus as claimed in claim 7, characterized in that, The probability factor satisfies the following formula: Where, λ x,y (t) represents a structure of type s consisting of the first temporal edge and its neighbor node h. n The probability factor corresponding to the temporal triangular phantom, where the starting point of the first temporal edge is node x and the ending point is node y; μ x,y α represents the basic strength between node x and node y. Δh The t represents the influence factor of the neighbor node h of the first temporal edge on the first temporal edge; s and t h This indicates that the structure consisting of the first temporal edge and the neighbor node h is of type s. n The time when the first and second edges in the temporal triangular model are established; s n The weights of the identified temporal triangular phantom structure.
12. The apparatus as claimed in claim 7, characterized in that, The weights of the time-series triangular phantom structure satisfy the following formula: Among them, s n This indicates a type number for a temporal triangular phantom structure. s n The weights of the identified temporal triangular phantom structure, s ′ n Indicates that it does not belong to the s n The number of other phantom structure types of the identified temporal triangular phantom structure.
13. A communication device, characterized in that, include: Processor, memory; The memory stores computer instructions; The processor is configured to read the computer instructions and execute the method as described in any one of claims 1-6.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method as described in any one of claims 1-6.
15. A computer program product, characterized in that, When the computer program product is invoked by a computer, it causes the computer to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Symbol network link prediction method based on graph attention mechanism
CN113050931A
Influence maximization method and system for sequential network
CN113378470A