Incremental link prediction method for space-time collaborative embedding

Through the methods of time encoding and incremental updating, the problems of inaccurate time information and high computational complexity in dynamic networks are solved, more timely and accurate link prediction and more efficient model training are achieved, and the real-time performance and generalization ability of the model are improved.

CN120705810APending Publication Date: 2025-09-26CHENGDU UNIVERSITY OF TECHNOLOGY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510826764.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing link prediction methods have insufficient temporal information accuracy and high computational complexity when processing dynamic networks, and negative sample sampling strategies cannot effectively learn the subtle differences between positive and negative samples.

Method used

Time encoding technology is used to capture the dynamic changes of nodes. By incrementally updating node embeddings and combining them with a hard negative sample sampling strategy, only the embeddings of the changed nodes and their neighboring nodes are updated, and the initial features and time features are fused to generate a negative sample set.

Benefits of technology

It improves the real-time and accuracy of link prediction, reduces computational complexity, and enhances the generalization ability and practical application value of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705810A_ABST
    Figure CN120705810A_ABST
Patent Text Reader

Abstract

The invention relates to a space-time collaborative embedded incremental link prediction method, which belongs to the technical field of complex networks and deep learning, and comprises the following steps: a time coding step: converting a change timestamp of a node into a time feature, and fusing the time feature into an embedded expression of the node; a node embedding increment updating step: only updating the embedding representations of the node and the neighbor nodes thereof undergoing the relationship change, and adopting differentiated updating weights according to the distance between different neighbor nodes, the updating weights being related to the node embedding increment updating step; and a hard negative sample sampling step of fusing features and time: for each positive sample node, calculating a negative sample node with high similarity with the positive sample node, and combining the negative sample node with randomly selected soft negative samples to jointly form a negative sample set for model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of complex networks and deep learning technologies, and specifically relates to an incremental link prediction method with spatiotemporal collaborative embedding. Background Art

[0002] Link prediction is primarily based on methods such as graph neural networks, knowledge graphs, and deep learning. Graph neural networks predict links by capturing feature information about the target node and its neighbors; knowledge graphs mine potential links using entities and their relationships; and deep learning makes predictions by extracting node behavior and network structure features.

[0003] The current mainstream method is link prediction based on graph neural networks, such as static graph neural networks and dynamic graph neural networks. The specific descriptions are as follows:

[0004] Static graph neural network link prediction does not consider temporal information and only predicts the presence of potential edges (links) between unconnected node pairs in the graph based on the graph's structural information. By learning embedded representations of nodes through graph neural networks (such as GCN and GraphSAGE), the model can capture the complex relationships and structural information between nodes. These embeddings are then input into a decoder (such as an MLP) to calculate the similarity between node pairs or the probability of a link existing.

[0005] Dynamic graph neural network link prediction takes temporal information into account, leveraging both graph structure and temporal evolution trends to predict whether unconnected node pairs in the graph will form new edges (links) at future points or time periods. In dynamic graph neural network link prediction, there are two main approaches: time-snapshot-based recurrent neural networks and timestamp-based graph neural networks. Time-snapshot-based link prediction methods typically first divide the dynamic network into multiple consecutive network snapshots. They then use a graph neural network to calculate the embedding vectors of nodes in each of these snapshots. Finally, a recurrent neural network encodes the node embeddings of these consecutive snapshots to generate a final node embedding representation. This final node embedding representation can be used to predict whether a connection will form between node pairs. However, these methods typically have high time complexity and do not consider the specific temporal information of nodes in a fine-grained manner. Timestamp-based link prediction methods typically encode the node timestamp along with the network structure into the node embedding. While these methods consider the specific temporal information of nodes, any changes to a node require relearning the embeddings of that node and its surrounding nodes.

[0006] Existing technologies have the following drawbacks: Snapshot-based link prediction methods extract temporal information by partitioning network snapshots, which is inaccurate and the results are affected by the granularity of the snapshot partitioning. Furthermore, these methods typically have high time complexity because they require embedding learning for each network snapshot and integrating node embeddings from consecutive snapshots via a recurrent neural network. Timestamp-based link prediction methods utilize specific temporal information along with network structure for embedding learning, which is more accurate than snapshot-based methods. However, these methods require recalculating embeddings for all nodes if the network changes, resulting in high computational complexity. Furthermore, when preparing negative samples for link prediction model training, existing sampling methods either randomly sample negative samples or mostly sample soft negative samples (i.e., easily distinguishable negative samples), failing to train a model that can detect subtle feature differences between positive and negative samples. This proposal addresses the temporal issue by introducing a temporal encoding technique. By dynamically updating node embeddings to reduce computational complexity, the proposed method samples a balanced number of soft and hard negative samples to enable the model to learn subtle differences between positive and negative samples. Through these improvements, the proposed method will significantly improve the real-time performance and efficiency of link prediction, better meeting the needs of practical applications.

[0007] After searching, the application publication number CN115456302A was found. It is a method for predicting social network links using an incremental strategy. The invention first processes network data, slices the network, and obtains a sequence of network snapshots. Secondly, the network is layered and randomly walks within the slice in the direction of time development to obtain a node sequence. Thirdly, the sliding window moves, and the node sequence is updated according to the incremental strategy. The node sequence is input into the incremental skip-gram model to update the node embedding vector of each layer. Finally, the projection matrix is ​​used to project the nodes of different layers into the same space. The node embedding vectors of different layers are fused using an autonomous mechanism, and R dynamically scalable networks are designed as decoders. This invention can solve the problem that the existing technology discards previous training data when faced with new data, resulting in a large amount of time spent on completely retraining model parameters.

[0008] The difference between this patent and CN115456302A patent:

[0009] 1. Fine-grained division level: This patent performs training based on edge-level fine-grainedness; the CN115456302A patent performs training based on snapshot-level fine-grainedness.

[0010] 2. Timestamp usage: This patent encodes time features through the difference of node timestamps, and embeds the time features with the nodes for subsequent calculations; the CN115456302A patent determines the order of random walks of nodes according to the timestamp order, and determines the probability of node selection by the size of the timestamp difference.

[0011] 3. Incremental update method: This patent only updates the two end nodes and neighboring nodes of the edge based on the edge that has changed at the latest moment; the CN115456302A patent uses a sliding window strategy to update the node sequence, updating 80% of the sequence each time and retaining 20% ​​of the historical information.

[0012] 4. Node embedding aggregation method: This patent uses zero-order aggregation for the embedding of nodes at both ends of the changed edge, and uses k-order aggregation for the embedding of neighbor nodes within k hops of the two end nodes; the CN115456302A patent uses a self-attention mechanism to fuse node embedding vectors of different layers. Summary of the Invention

[0013] The present invention aims to solve the above problems in the prior art. It proposes an incremental link prediction method with spatiotemporal collaborative embedding. The technical solution of the present invention is as follows:

[0014] A spatiotemporal collaborative embedding incremental link prediction method comprises the following steps:

[0015] The time encoding step converts the node change timestamp into a time feature and incorporates it into the embedding expression of the node;

[0016] A node embedding incremental update step, which updates only the embedding representations of the node and its neighboring nodes that have undergone relationship changes, and adopts differentiated update weights according to the distances of different neighboring nodes, wherein the update weights are related to the node embedding incremental update step;

[0017] In the hard negative sample sampling step that integrates features and time, for each positive sample node, a negative sample node with high similarity to the positive sample node is calculated and combined with the randomly selected soft negative samples to form a negative sample set for model training.

[0018] Furthermore, the time encoding step specifically includes:

[0019] Let the two nodes whose relationship changes be u and v, and the timestamp of the relationship change between nodes u and v be t uv , then the current timestamps of u and v are The timestamps of the last changes of u and v are You can use Calculate the time characteristics of u and v, x∈{u,v}, and the calculation formula of Φ is as follows:

[0020]

[0021] Where d is the time feature dimension, ω i are model parameters, i=1,2,…,d;

[0022] As above, the time features of u and v obtained by time encoding can be calculated

[0023] Furthermore, the integration into the embedded expression of the node specifically includes:

[0024] By fusing node embedding with time features, for two nodes u and v whose relationship changes at time t, their neighbor nodes are embedded as x∈N (u,v) , N (u,v) is the neighbor node of u and v, Z t is the node embedding matrix at time t, and the time feature is

[0025] Then, the node embedding of the neighbor node x is fused with the temporal feature to obtain the fused embedding The calculation formula is as follows:

[0026]

[0027] Where || represents the vector concatenation operator, W0 and W1 are trainable matrices, and f t represents the spatiotemporal fuser, and σ represents the activation function.

[0028] Furthermore, the node embedding and updating step specifically includes:

[0029] Let the zero-order affected nodes be u and v, and use the following formula to perform embedding update:

[0030]

[0031] Where f0 represents the zero-order fuser, W0 and W1 are trainable matrices, and σ is the activation function. After the above calculation, the embedding of the zero-order affected node at time t+1 can be updated.

[0032] Let the k-th order affected node be x, that is, the neighbor node k hops away from the zero-th order affected node, and use the following formula to perform embedding update:

[0033]

[0034] where f k represents the k-order fusion, N t+1 (x) represents the neighbor nodes of node x at time t+1, W k is a trainable matrix. After the above calculation, the embedding of the k-th order affected node at time t+1 can be updated.

[0035] Furthermore, the hard negative sample sampling step of the fusion feature and time specifically includes:

[0036] Sample definition step: define positive samples and negative samples; positive samples are all edges that have changed in the training set, and negative samples are edges that do not exist in the positive sample set;

[0037] The initial feature of the node is fused with the time feature. For the positive sample node u, the initial feature of the node is concatenated with the time feature, and the concatenated feature is nonlinearly mapped to obtain the embedding h u ;

[0038] Negative sample evaluation and selection step: for each positive sample node u, traverse its corresponding candidate negative sample node m to form a negative sample edge (u, m); calculate the cosine similarity of the embedding of the positive sample node u and the embedding of the negative sample node m: Similar(u, m) = cos(h u ,h m ), and save the top k negative sample nodes with the highest cosine similarity to the positive sample node u, and form negative sample edges with the positive sample node u respectively.

[0039] Furthermore, the initial features of the node are concatenated with the time features, and the concatenated features are nonlinearly mapped to obtain the embedded h u , specifically including:

[0040]

[0041] The initial feature of the positive sample node u is f u ∈F, F is the initial feature matrix of the node; the time encoding function Φ can capture the impact of the time difference between nodes on the node interaction. The nodes with smaller timestamp gaps usually have a greater impact on the representation of the current node; W i is a trainable matrix (i=0,1). For the candidate negative sample node m of the positive sample node u, where m∈M, the time feature calculation formula is replaced by

[0042] Furthermore, the link prediction step is also included, specifically including:

[0043] Link existence probability calculation steps:

[0044] For the edge (u, v) that needs to be predicted, first calculate the relative time feature P of u and v u 、P v :

[0045]

[0046] Where Φ is the time encoding function, Indicates the timestamp when nodes u and v last changed; here the source node u is the anchor node, and its input Φ parameter is That is 0; the destination node v is the comparison node, and its input Φ parameter is That is, the time difference between the last change moments of nodes u and v;

[0047] Then, the relative time features of the nodes are fused with the embedding to obtain F u 、F v :

[0048] F u =f t (z u ,P u )

[0049] F v =f t (z v ,P v )

[0050] where f t is the fusion device, z u 、z v Indicates the embedding of nodes u and v when they last changed;

[0051] Finally, F u 、F v Input MLP multi-sensor, output node u, v has a probability value prob of link u,v , calculated as follows:

[0052] prob u,v =σ(MLP(F u ,F v ))=σ((F u ||F v )·W0·W1)

[0053] Where W0 and W1 are trainable matrices, and the output of W1 is a scalar value;

[0054] Model training steps:

[0055] The cross entropy loss function is used to calculate the training loss of the model. The loss is calculated as follows:

[0056]

[0057] Where ε represents the positive sample set, m represents the negative sample node, and the loss of each changed edge is calculated and stored in loss. After a batch of training, the obtained loss is back-propagated, and the gradient updates the trainable parameters in the model. To prevent gradient explosion or gradient disappearance, the loss is multiplied by the adjustable learning rate lr and then back-propagated.

[0058] The advantages and beneficial effects of the present invention are as follows:

[0059] 1. The link prediction method based on time snapshots of the present invention divides the dynamic network into multiple static snapshots according to the time sequence, resulting in inaccurate time information and high time complexity. This proposal uses time coding technology to capture the dynamic changes of nodes, so that the prediction results can more timely and accurately reflect the real-time status of the relationship between nodes, thereby improving the real-time performance and accuracy of the prediction. The timestamp-based link prediction method calculates the embedded representation of all nodes each time it is updated, causing the embedding of unchanged nodes to be repeatedly calculated, resulting in a waste of computing resources. This proposal uses incremental update technology to solve the problem of repeated calculations, effectively improve the computing performance of the model, and expand the scope of application of this method in different data environments.

[0060] 2. Most mainstream link prediction models use random negative sampling to generate soft negative samples, which prevents the model from learning the subtle differences between positive and negative samples. This proposal adopts a negative sampling strategy that integrates initial features with temporal features. This strategy generates negative sample sets containing varying proportions of soft and hard negative samples, tailored to the characteristics of different downstream tasks. This improves the overall performance and generalization capabilities of the model, enabling it to function more reliably in real-world applications and create greater practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 Schematic diagram of an incremental link prediction method of spatiotemporal collaborative embedding according to a preferred embodiment of the present invention;

[0062] Figure 2 is an example of building links between nodes; DETAILED DESCRIPTION

[0063] The following will describe the technical solutions in the embodiments of the present invention in detail with reference to the accompanying drawings. The described embodiments are only a part of the embodiments of the present invention.

[0064] The technical solution of the present invention to solve the above technical problems is:

[0065] Technical solutions such as Figure 1 The specific steps are as follows:

[0066] 1. Incremental spatiotemporal collaborative embedding learning

[0067] 1.1 Time Coding

[0068] Let the two nodes whose relationship changes be u and v, and the timestamp of their relationship change be t uv , then the current timestamps of u and v are The timestamps of the last changes of u and v are You can use Calculate the time characteristics of u and v (x∈{u,v}). The calculation formula of Φ is as follows:

[0069]

[0070] Where d is the time feature dimension, ω i are model parameters (i=1,2,…,d).

[0071] As above, the time features of u and v obtained by time encoding can be calculated

[0072] 1.2 Fusion device

[0073] In order to fully learn the spatial and temporal features of nodes in the network, it is necessary to fuse node embedding with temporal features. For two nodes u and v whose relationship changes at time t, let their neighbor nodes be embedded as N (u,v) is the neighbor node of u and v, Z t is the node embedding matrix at time t), and the time feature is

[0074] Then, the node embedding of the neighbor node x is fused with the temporal feature to obtain the fused embedding The calculation formula is as follows:

[0075]

[0076] Where || represents the vector concatenation operator, W0 and W1 are trainable matrices, and f t represents the spatiotemporal fuser, and σ represents the activation function.

[0077] 1.3 Node Embedding Update

[0078] Let the zero-order affected nodes be u and v (i.e., the roles whose relationships have changed), and use the following formula to update the embedding:

[0079]

[0080] Where f0 represents the zero-order fuser, W0 and W1 are trainable matrices, and σ is the activation function. After the above calculation, the embedding of the zero-order affected node at time t+1 can be updated.

[0081] Let the k-th order affected node be x (i.e., the neighbor node that is k hops away from the zero-th order affected node), and use the following formula to perform embedding update:

[0082]

[0083] where f k represents the k-order fusion, Nt+1 (x) represents the neighbor nodes of node x at time t+1, W k is a trainable matrix. After the above calculation, the embedding of the k-th order affected node at time t+1 can be updated.

[0084] 2. Negative Sample Sampling Strategy for Fusion Features and Time

[0085] 2.1 Sample Definition

[0086] Positive sample set: Positive samples are all edges that have changed in the training set, in the format of (u,v,t uv ,sign) four-tuple, sign=1 means nodes u and v are in t uv The connection is established at time t, sign = 0 means that nodes u and v are connected at t uv Disconnect at any time. Save the latest timestamp of each node change, recorded as

[0087] Negative sample set: In order to effectively train the model to predict whether there is a connection between nodes, it is necessary to generate edges that do not exist in the positive sample set, which are called negative sample edges. uv ,sign), traverse all timestamps in the graph that are less than t uv Nodes, find candidate negative sample nodes that can form negative sample edges with u or v. The set of candidate negative sample nodes of u is called M, and the set of candidate negative sample nodes of v is called N.

[0088] 2.2 Fusion of node initial features and temporal features

[0089] In order to fully consider the initial features and time features of the node, for the positive sample node u, the initial features and time features of the node are concatenated, and the concatenated features are nonlinearly mapped to obtain the embedding h u ,Right now:

[0090]

[0091] The initial feature of the positive sample node u is f u ∈F, F is the initial feature matrix of the node; the time encoding function Φ can capture the impact of the time difference between nodes on the node interaction. The nodes with smaller timestamp gaps usually have a greater impact on the representation of the current node; W i is a trainable matrix (i=0,1). For the candidate negative sample node m (where m∈M) of the positive sample node u, the processing is similar to the above, but the time feature calculation formula is replaced by

[0092] 2.3 Negative Sample Evaluation and Selection

[0093] For each positive sample node u, traverse its corresponding candidate negative sample node m (where m∈M) to form a negative sample edge (u,m). Calculate the cosine similarity of the embedding of the positive sample node m and the embedding of the negative sample node m: Similar(u,m)=cos(h u ,h m ), and save the top k negative sample nodes with the highest cosine similarity to the positive sample node u, and form negative sample edges with the positive sample node u respectively.

[0094] Different ratios of positive and negative samples can be selected according to different downstream tasks.

[0095] 3. Link Prediction

[0096] 3.1 Link existence probability

[0097] For the edge (u, v) that needs to be predicted, first calculate the relative time feature P of u and v u 、P v :

[0098]

[0099] Where Φ is the time encoding function, Indicates the timestamp when nodes u and v last changed. Here, the source node u is the anchor node, and its input Φ parameter is (i.e. 0); the destination node v is the comparison node, and its input Φ parameter is (i.e. the time difference between the last change moments of nodes u and v).

[0100] Then, the relative time features of the nodes are fused with the embedding to obtain F u 、F v :

[0101] F u =f t (z u ,P u )

[0102] F v =f t (z v ,P v )

[0103] where f t is the fusion device, z u 、z v Represents the embedding of nodes u and v when they last changed.

[0104] Finally, F u 、F v Input MLP multi-sensor, output node u, v has a probability value prob of linku,v The calculation is as follows:

[0105] prob u,v =σ(MLP(F u ,F v ))=σ((F u ||F v )·W0·W1)

[0106] Where W0 and W1 are trainable matrices, and the output of W1 is a scalar value.

[0107] 3.2 Model Training

[0108] Since this proposal uses supervised learning, the cross entropy loss function is used to calculate the training loss of the model. The loss is calculated as follows:

[0109]

[0110] Where ε represents the set of positive samples, and m represents the number of negative nodes. The loss for each changed edge is calculated and stored in loss. After a batch of training, the resulting loss is backpropagated, and the gradient is used to update the trainable parameters in the model. To prevent gradient explosion or vanishing, the loss is multiplied by the adjustable learning rate lr before backpropagation.

[0111] The key points of this application proposal are: to address the problem of excessive time span in current mainstream link prediction methods, a time coding technology is proposed to fully utilize node timestamp information; to address the problem of excessive computational complexity, a node incremental update technology is proposed to reduce computational complexity; to address the problem of insufficient discrimination of negative samples, an innovative negative sample sampling technology is proposed to enable the model to learn more subtle feature differences and improve the model's discrimination ability.

[0112] The points to be protected mainly include:

[0113] 1) Incremental spatiotemporal collaborative embedding learning. The timestamps of node changes are converted into temporal features through time encoding and incorporated into the node embedding, resulting in a node embedding representation that contains both temporal and structural information. Only the embeddings of the changed node pair and its neighboring nodes are updated each time, and different weights are applied to neighbors of different distances when updating their embedding representations.

[0114] 2) A negative sampling strategy that integrates initial features with temporal features. The initial node features are concatenated with the temporal features and then processed to generate a node embedding. For each positive node, negative nodes in the graph that do not form an edge with the positive node are identified. An appropriate number of negative nodes are selected from the highest to lowest similarity between the positive and negative node embeddings to form a negative sample (called hard negative samples) with the positive nodes. A random negative sampling strategy is then used to generate a soft negative sample set. An appropriate number of samples are selected from each of the hard and soft negative sets to form the final negative sample set.

[0115] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.

[0116] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0117] The above embodiments should be understood as merely illustrating the present invention and not as limiting the scope of protection of the present invention. After reading the contents of the present invention, technicians may make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.

Claims

1. A spatiotemporal collaborative embedding incremental link prediction method, characterized in that: The following steps are involved: The time encoding step converts the node change timestamp into a time feature and incorporates it into the embedding expression of the node; A node embedding incremental update step, which updates only the embedding representations of the node and its neighboring nodes that have undergone relationship changes, and adopts differentiated update weights according to the distances of different neighboring nodes, wherein the update weights are related to the node embedding incremental update step; In the hard negative sample sampling step that integrates features and time, for each positive sample node, a negative sample node with high similarity to the positive sample node is calculated and combined with the randomly selected soft negative samples to form a negative sample set for model training.

2. The incremental link prediction method based on spatiotemporal collaborative embedding according to claim 1, characterized in that: The time encoding step specifically includes: Let the two nodes whose relationship changes be u and v, and the timestamp of the relationship change between nodes u and v be t uv , then the current timestamps of u and v are The timestamps of the last changes of u and v are You can use Calculate the time characteristics of u and v, x∈{u,v}, and the calculation formula of Φ is as follows: Where d is the time feature dimension, ω i are model parameters, i=1,2,…,d; As above, the time features of u and v obtained by time encoding can be calculated 3. The incremental link prediction method of spatiotemporal collaborative embedding according to claim 2, characterized in that: The embedded expression of the integration node specifically includes: By fusing node embedding with time features, for two nodes u and v whose relationship changes at time t, their neighbor nodes are embedded as x∈N (u,v) , N (u,v) is the neighbor node of u and v, Z t is the node embedding matrix at time t, and the time feature is Then, the node embedding of the neighbor node x is fused with the temporal feature to obtain the fused embedding The calculation formula is as follows: Where || represents the vector concatenation operator, W0 and W1 are trainable matrices, and f t represents the spatiotemporal fuser, and σ represents the activation function.

4. The incremental link prediction method based on spatiotemporal collaborative embedding according to claim 3, characterized in that: The node embedding and updating steps specifically include: Let the zero-order affected nodes be u and v, and use the following formula to perform embedding update: Where f0 represents the zero-order fuser, W0 and W1 are trainable matrices, and σ is the activation function. After the above calculation, the embedding of the zero-order affected node at time t+1 can be updated. Let the k-th order affected node be x, that is, the neighbor node k hops away from the zero-th order affected node, and use the following formula to perform embedding update: where f k represents the k-order fusion, N t+1 (x) represents the neighbor nodes of node x at time t+1, W k is a trainable matrix. After the above calculation, the embedding of the k-th order affected node at time t+1 can be updated.

5. The incremental link prediction method of spatiotemporal collaborative embedding according to claim 1, characterized in that: The hard negative sample sampling step of the fusion feature and time specifically includes: Sample definition step: define positive samples and negative samples; positive samples are all edges that have changed in the training set, and negative samples are edges that do not exist in the positive sample set; The initial feature of the node is fused with the time feature. For the positive sample node u, the initial feature of the node is concatenated with the time feature, and the concatenated feature is nonlinearly mapped to obtain the embedding h u ; Negative sample evaluation and selection step: for each positive sample node u, traverse its corresponding candidate negative sample node m to form a negative sample edge (u, m); calculate the cosine similarity of the embedding of the positive sample node u and the embedding of the negative sample node m: Similar(u, m) = cos(h u ,h m ), and save the top k negative sample nodes with the highest cosine similarity to the positive sample node u, and form negative sample edges with the positive sample node u respectively.

6. The incremental link prediction method of spatiotemporal collaborative embedding according to claim 5, characterized in that: The initial features of the node are connected in series with the time features, and the connected features are nonlinearly mapped to obtain the embedded h u , specifically including: The initial feature of the positive sample node u is f u ∈F, F is the initial feature matrix of the node; the time encoding function Φ can capture the impact of the time difference between nodes on the node interaction. The nodes with smaller timestamp gaps usually have a greater impact on the representation of the current node; W i is a trainable matrix (i=0,1). For the candidate negative sample node m of the positive sample node u, where m∈M, the time feature calculation formula is replaced by 7. The incremental link prediction method of spatiotemporal collaborative embedding according to claim 1, characterized in that: It also includes the link prediction step, which includes: Link existence probability calculation steps: For the edge (u, v) that needs to be predicted, first calculate the relative time feature P of u and v u 、P v : Where Φ is the time encoding function, Indicates the timestamp when nodes u and v last changed; here the source node u is the anchor node, and its input Φ parameter is That is 0; the destination node v is the comparison node, and its input Φ parameter is That is, the time difference between the last change moments of nodes u and v; Then, the relative time features of the nodes are fused with the embedding to obtain F u 、F v : F u =f t (z u ,P u ) F v =f t (z v ,P v ) where f t is the fusion device, z u 、z v Represents the embedding of nodes u and v when they last changed; Finally, F u 、F v Input MLP multi-layer perceptron, output the probability value prob that there is a link between nodes u and v u,v , calculated as follows: problem u,v =σ(MLP(F u ,F v ))=σ((F u ||F v )·W0·W1) Where W0 and W1 are trainable matrices, and the output of W1 is a scalar value; Model training steps: The cross entropy loss function is used to calculate the training loss of the model. The loss is calculated as follows: Where ε represents the positive sample set, m represents the negative sample node, and the loss of each changed edge is calculated and stored in loss. After a batch of training, the obtained loss is back-propagated, and the gradient updates the trainable parameters in the model. To prevent gradient explosion or gradient disappearance, the loss is multiplied by the adjustable learning rate lr and then back-propagated.

Citation Information

Patent Citations

  • Method for predicting social network link by adopting incremental strategy

    CN115456302A