A social network link prediction method, device, electronic equipment and medium
By constructing a social network link prediction network and using a transferable learner and a layer recognizer for adversarial training, the problem of ignoring the spatial correlation of different network layers in existing technologies is solved, thus improving the accuracy of link prediction.
Patent Information
- Application Number
- CN202310287646.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-03-22
AI Technical Summary
Existing social network link prediction methods only consider knowledge specific to the same layer, ignoring the spatial correlation between different network layers.
An initial link prediction network is constructed, consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer. The transferable learner obtains the common transferable representations of network links, the representation learner obtains the individual layer representations of the target layer, and the aggregated representations of network links are obtained through fusion gates. The link prediction network is optimized using adversarial training.
This method improves the accuracy of social network link prediction by extracting common transferable representations of network links and individual layer representations of the target network layer, fusing them to obtain aggregate representations, and solving the spatial correlation problem between different network layers through adversarial training, thus achieving higher prediction accuracy.
Smart Images

Figure CN116384563B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of link prediction, and more specifically to a method, apparatus, electronic device, and medium for predicting links in a social network. Background Technology
[0002] With the explosive growth of social interactions on social networks, the social data collected on these platforms typically contains multi-layered social information represented by multi-layered networks. The link prediction problem in social networks refers to using social entities as nodes (e.g., users on a social platform) and interactions between entities as links (e.g., like likes, follows, and comments between users), and using existing multi-layered network information to predict missing links or future links in the target layer.
[0003] Current methods for predicting links in social networks, typically topology calculation and deep learning, have achieved relatively good results. Topology calculation methods use the topological structure information between nodes to predict the existence of a link between two nodes, while deep learning methods use feature extraction to predict link existence. However, existing models tend to learn knowledge specific to each layer, neglecting the spatial correlation between different network layers. Specifically, the same nodes in the target and auxiliary layers often have similar interaction preferences or patterns when generating links; for example, two social network users who have recently become friends are likely to forward each other's messages. Summary of the Invention
[0004] In view of this, it is necessary to propose a social network link prediction method, device, electronic device and medium to solve the technical problem that existing social network link prediction methods only consider knowledge specific to the same layer and ignore the spatial correlation between different layers.
[0005] To address the above problems, this invention provides a social network link prediction method, comprising: Obtain the training set and target layer set of the social network links; Construct an initial link prediction network consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer; Using the network link training set as input to a transferable learner, a common transferable representation of network links in the training set is obtained; using the target layer set as input to a representation learner, an individual layer representation of network links in the target layer set is obtained; based on the fusion gate of the representation learner, the common transferable representation and the individual layer representation are aggregated to obtain an aggregated representation of the network links; the aggregated representation is used as input to a link predictor, which outputs a predicted quantization value indicating the existence or non-existence of each network link; and the common transferable representation of the network links is input to a layer recognizer to identify the network layer source of each network link. Construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Perform adversarial training with the transferable learner and the layer recognizer, and iteratively train the link prediction network with the saddle point of the overall loss as the target to obtain a fully trained link prediction network. The target layer's predicted network links are output by training a fully functional link prediction network.
[0006] Furthermore, obtain the training set of social network links, including: The network link structure is obtained from the network link data. Graph data with links between any two nodes are taken as positive samples, and the same number of graph data with no links between any two nodes are randomly selected as negative samples. Positive and negative samples are combined to construct a link dataset, and a link label set and a layer label set corresponding to the link dataset are created. The link dataset, link label set, and layer label set constitute the social network link training set.
[0007] Furthermore, using the network link training set as input to the transferable learner, common transferable representations of network links in the network link training set are obtained, including: Extract all network link representations from the network link training set, and filter out the transferable network link representations to obtain the common transferable representations of network links across all network layers.
[0008] Further, using the target layer set as input to the representation learner, individual layer representations of network links in the target layer set are obtained; based on the fusion gate of the representation learner, the common transferable representation and the individual layer representations are aggregated to obtain an aggregate representation of the network links, including: Extract the unique network link representation on the target layer set to obtain the personalized layer representation of the network links on the target network layer; The aggregate weights are calculated based on the layer label set corresponding to the link dataset and the individual layer representation of the network links on the target network layer. The common transferable representation and the individual layer representation are aggregated according to the aggregation weight to obtain the aggregated representation of the network link.
[0009] Furthermore, the aggregate representation is used as input to the link predictor, which outputs a predicted quantization value for the presence or absence of each network link, including: Using the aggregated representation of the network link as input, the probability of the network link existing and the probability of its non-existence corresponding to the aggregated representation are calculated. When the probability of a link existing is greater than the probability of it not existing, the corresponding network link is considered an existing link. The probability of existence is used as the predicted quantization value for the existence of a network link, and the predicted quantization value for each network link is output.
[0010] Furthermore, the common transferable representation of network links is input into the layer identifier to identify the network layer source of each network link, including: The probability of each network link originating from each network layer is calculated based on the layer identifier, and the network layer with the highest probability is taken as the network layer source of the corresponding network link.
[0011] Furthermore, an overall loss function is constructed, consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Adversarial training is performed using the transferable learner and the layer recognizer, and the link prediction network is iteratively trained with the saddle point of the overall loss as the target, resulting in a fully trained link prediction network, including: Construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer; The transferable learner learns transferable representations of network links between different layers to increase recognition loss; The network layer source of network links is learned based on the layer identifier to reduce identification loss; The gradient descent algorithm is used to iteratively train and optimize the social network link prediction network until the loss reaches the saddle point of the overall loss, resulting in a fully trained multi-layer social network link prediction network.
[0012] The present invention also provides a social network link prediction device, comprising: The data acquisition unit is used to acquire the training set and target layer set of the social network links; The model building unit is used to build an initial link prediction network consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer. The data processing unit is configured to: use the network link training set as input to a transferable learner to obtain a common transferable representation of network links in the network link training set; use the target layer set as input to a representation learner to obtain individual layer representations of network links in the target layer set; aggregate the common transferable representation and the individual layer representations based on the fusion gate of the representation learner to obtain an aggregated representation of network links; use the aggregated representation as input to a link predictor to output a predicted quantization value indicating the existence or non-existence of each network link; and input the common transferable representation of network links to a layer recognizer to identify the network layer source of each network link. The model training unit is used to construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. It performs adversarial training on the transferable learner and the layer recognizer, and iteratively trains the link prediction network with the saddle point of the overall loss as the target, so as to obtain a fully trained link prediction network. The prediction output unit is used to predict the target layer's network links by training a fully-trained link prediction network.
[0013] The present invention also provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the social network link prediction method described in any one of the above embodiments.
[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the social network link prediction method described in any one of the above claims.
[0015] Compared with existing technologies, the beneficial effects of this invention include: First, a training set and a target layer set of social network links are obtained. Then, an initial link prediction network is constructed, consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer. Next, the transferable learner obtains common transferable representations of network links in the training set, and the representation learner obtains individual layer representations in the target layer network. The common transferable representations and individual layer representations are aggregated through a fusion gate in the representation learner to obtain an aggregated representation of the network links. A prediction quantization value for the existence of each network link is calculated based on the aggregated representation. The common transferable representation of the network links is input to the layer recognizer to identify the network layer source of each network link. Then, an overall loss function is constructed, consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Adversarial training is performed using the transferable learner and the layer recognizer, and the link prediction network is iteratively trained with the saddle point of the overall loss as the target, resulting in a fully trained link prediction network. Finally, the predicted network links of the target layer are output through the fully trained link prediction network. In summary, this invention extracts the common transferable representations of network links in the network link training set and the individual layer representations in the target network layer, fuses them to obtain the aggregate representation of the network links, and performs adversarial training through a transferable learner and a layer recognizer. This addresses the technical problem in existing technologies that tend to learn knowledge specific to each layer while ignoring the spatial correlation between different network layers, thereby further improving prediction accuracy. Attached Figure Description
[0016] Figure 1 A flowchart illustrating an embodiment of the social network link prediction method provided by the present invention; Figure 2 This is a schematic diagram of the structure of a fusion gate in a representation learner according to an embodiment of the present invention; Figure 3 A schematic diagram of the structure of an embodiment of the social network link prediction device provided by the present invention; Figure 4A schematic diagram of the structure of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0018] It should be understood that the accompanying drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the invention. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0019] Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.
[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0021] This invention provides a method, apparatus, electronic device, and medium for predicting social network links, which will be described below.
[0022] Figure 1 This is a schematic flowchart of an embodiment of the social network link prediction method provided by the present invention, as shown below. Figure 1 As shown, social network link prediction methods include: S101. Obtain the social network link training set and target layer set; S102. Construct an initial link prediction network consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer. S103. Using the network link training set as input to a transferable learner, obtain common transferable representations of network links in the network link training set; using the target layer set as input to a representation learner, obtain individual layer representations of network links in the target layer set; based on the fusion gate of the representation learner, aggregate the common transferable representations and the individual layer representations to obtain aggregated representations of network links; use the aggregated representation as input to a link predictor, outputting a predicted quantization value of whether each network link exists; and input the common transferable representations of network links to a layer recognizer to identify the network layer source of each network link; S104. Construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Perform adversarial training on the transferable learner and the layer recognizer, and iteratively train the link prediction network with the saddle point of the overall loss as the target to obtain a fully trained link prediction network. S105. Output the target layer's prediction network links by training a fully-fledged link prediction network.
[0023] Compared with existing technologies, the social network link prediction method provided in this invention first obtains a social network link training set and a target layer set, and then constructs an initial link prediction network composed of a transferable learner, a representation learner, a link predictor, and a layer recognizer. Next, the transferable learner obtains common transferable representations of network links in the network link training set, and the representation learner obtains individual layer representations in the target layer network. The common transferable representations and individual layer representations are then aggregated through a fusion gate in the representation learner to obtain an aggregated representation of the network links. A prediction quantization value for the existence of each network link is calculated based on the aggregated representation. The common transferable representation of the network links is input to the layer recognizer to identify the network layer source of each network link. Then, an overall loss function is constructed, consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Adversarial training is performed using the transferable learner and the layer recognizer, and the link prediction network is iteratively trained with the saddle point of the overall loss as the target, resulting in a fully trained link prediction network. Finally, the predicted network links of the target layer are output through the fully trained link prediction network. In summary, this invention extracts the common transferable representations of network links in the network link training set and the individual layer representations in the target network layer, fuses them to obtain the aggregate representation of the network links, and performs adversarial training through a transferable learner and a layer recognizer. This addresses the technical problem in existing technologies that tend to learn knowledge specific to each layer while ignoring the spatial correlation between different network layers, thereby further improving prediction accuracy.
[0024] In a specific embodiment of the present invention, obtaining the network link training set includes: The network link structure is obtained from the network link data. Graph data with links between any two nodes are taken as positive samples, and the same number of graph data with no links between any two nodes are randomly selected as negative samples. Positive and negative samples are combined to construct a link dataset, and a link label set and a layer label set corresponding to the link dataset are created. The link dataset, link label set, and layer label set constitute the social network link training set.
[0025] Specifically, multi-layered social network data is represented as ,in Indicates the first Layered network, and Defined as an unweighted and undirected graph, where and They represent the first The existing set of nodes and links in the layer network.
[0026] In the process of obtaining the network link training set, the link set is obtained first. All link graph data were used as positive samples, and social network data were randomly selected. The corresponding link graph data where no link exists between any two nodes of the same number are used as negative samples. Positive and negative samples are combined to construct a link dataset, and a link label set and a layer label set are created for the corresponding dataset. The link label set is used to label the types of link samples, with links in the negative samples classified as missing links and non-existent links; the layer label set is used to label the network layer to which the link is located.
[0027] In a specific embodiment of the present invention, the network link training set is used as the input to the transferable learner to obtain a common transferable representation of network links in the network link training set, including: Extract all network link representations from the network link training set, and filter out the transferable network link representations to obtain the common transferable representations of network links across all network layers.
[0028] Specifically, the transferable learner uses node2vec as its core module and employs biased random walks to extract network link representations for each network layer. (layer representation), and then, a convolutional neural network is used to filter out the transferable representations in the network link representation. (transferable representation). From the first Each node pair starts with a continuous sequence The filtering operation for a pair of nodes can be represented as: ,in, It is the ReLU (Rectified Linear Unit) activation function. This represents the weights of the convolutional filter. Indicates the size of the filter window.
[0029] At this point, the learning device can be transferred. Denotes a transferable learner, where This represents the original training data for a multi-layered social network. This represents all parameters in the transferable learner.
[0030] It's important to note that the common transferability of network links refers to the fact that, in social networks, the same nodes across different network layers typically share similar interaction preferences or patterns when generating links. For example, two social users who have recently become friends are very likely to forward each other's messages. node2vec is a graph embedding learning method based on DeepWalk, used to process graph data from social networks. In a specific embodiment of the present invention, a common transferable representation and a target layer set are used as inputs to a representation learner to obtain individual layer representations of network links in the target layer set. The individual layer representations and the common transferable representations are then aggregated to obtain an aggregated representation of the network links, including: Extract the unique network link representation on the target layer set to obtain the personalized layer representation of the network links on the target network layer; The aggregate weights are calculated based on the layer label set corresponding to the link dataset and the individual layer representation of the network links on the target network layer. The common transferable representation and the individual layer representation are aggregated according to the aggregation weight to obtain the aggregated representation of the network link.
[0031] Specifically, the representation learner also uses node2vec as its core module, proposing a personalized layer representation for the uplink of the target network layer. Then, a fusion gate is used to aggregate the common transferable representations and the individual layer representations. The fusion gate is like... Figure 2 As shown, first, the layer label set corresponding to the link dataset is... and the personality layer representation on the target network layer Simultaneously, it serves as input and outputs an aggregate weight used to aggregate the transferable representation and the layer representation. :
[0032] in It is a feedforward neural network. These are the learning parameters in the fusion gate, used function pairs The output is normalized. The aggregated representation of the network links is obtained based on the aggregate weights. .
[0033] The entire representation learner uses It means that among them This represents the original training data for a multi-layered social network. This represents all the parameters in the learner.
[0034] It should be noted that the individual layer representation corresponds to the common transferable representation, and refers to the link representation unique to the target layer network.
[0035] In a specific embodiment of the present invention, the aggregation representation is used as the input to the link predictor, and the output is a predicted quantization value indicating the existence or non-existence of each network link, including: Using the aggregated representation of the network link as input, the probability of the network link existing and the probability of its non-existence corresponding to the aggregated representation are calculated. When the probability of a link existing is greater than the probability of it not existing, the corresponding network link is considered an existing link. The probability of existence is used as the predicted quantization value for the existence of a network link, and the predicted quantization value for each network link is output.
[0036] Specifically, the aggregated representation of each link goes through a fully connected layer with an output dimension of 2, and then through a... Layer normalization yields two values representing the probability of a link not existing and the probability of a link existing, respectively. The probability of a link not existing and the probability of a link existing are compared to determine whether a link exists.
[0037] Link predictor is represented as ,in It is an aggregate representation of network links. These are all the parameters in the link predictor.
[0038] In the process of optimizing the link predictor, for a given network link sample The input to the link predictor is the aggregate representation obtained by the representation learner. The output is the probability that the link exists. The prediction loss of the link predictor is defined using the cross-entropy function:
[0039] in, It is a label that indicates whether a link exists. Indicates a positive sample. This represents a negative sample. To better predict missing links, the model strives to reduce the prediction loss of the link predictor for missing links. The process of determining the optimal parameters can be represented as follows: .
[0040] In a specific embodiment of the present invention, the common transferable representation of network links is input into a layer identifier to identify the network layer source of each network link, including: The probability of each network link originating from each network layer is calculated based on the layer identifier, and the network layer with the highest probability is taken as the network layer source of the corresponding network link.
[0041] Specifically, layer recognition is a neural network consisting of two fully connected layers and corresponding activation functions. It is used to identify the network layer to which each transferable representation in the network link representation belongs. The layer recognizer is represented as follows: ,in The commonality transferable representation is derived from the transferable learner. This represents all parameters in the layer recognizer.
[0042] Layer-based recognizers indirectly estimate the differences in feature representations between different network layers through recognition loss. The recognition loss of layer-based recognizers is defined using the cross-entropy function:
[0043] in, The set of tags indicating the source of the tag link. It is the total number of layers in a multi-layered social network. Link prediction samples Source: [Source Name] The probability of a layer. The smaller the recognition loss of the layer identifier, the more correctly it classifies the link source. To better distinguish the features of different layers, it is necessary to find the optimal parameters to minimize the recognition loss: .
[0044] In a specific embodiment of the present invention, an overall loss function is constructed, consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Adversarial training is performed using the transferable learner and the layer recognizer, and the link prediction network is iteratively trained with the saddle point of the overall loss as the target, resulting in a fully trained link prediction network, including: Construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer; The transferable learner learns transferable representations of network links between different layers to increase recognition loss; The network layer source of network links is learned based on the layer identifier to reduce identification loss; The gradient descent algorithm is used to iteratively train and optimize the social network link prediction network until the loss reaches the saddle point of the overall loss, resulting in a fully trained multi-layer social network link prediction network.
[0045] Specifically, during model training, a smaller recognition loss for the layer recognizer indicates a higher accuracy in classifying the link source. However, a larger recognition loss implies that transferable representations can be shared across different layers. Therefore, to better distinguish features from different layers during training while learning transferable representations for those layers, it's necessary to determine optimal parameters that balance the recognition loss against both conditions. Thus, a minimax game is constructed between the transferable learner and the layer recognizer, using adversarial training to learn transferable representations between layers. On one hand, the transferable learner attempts to capture these representations to deceive the layer recognizer and maximize the recognition loss. On the other hand, the layer recognizer tries to distinguish the link source layer to reduce the recognition loss and avoid being deceived by the transferable learner.
[0046] The overall model loss consists of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. The overall loss function is defined as:
[0047] in, Let represent all the parameters in the learner, transferable learner, link predictor, and layer recognizer, respectively. This represents the prediction loss of the link prediction layer. Recognition loss of the representation layer recognizer This is a control parameter used to balance link prediction and layer identification; in the embodiment given in this invention, it is set to 1. The objective of parameter optimization during model training is the saddle point of the overall loss.
[0048]
[0049] To achieve this goal, embodiments of the present invention add a gradient inversion layer to the transferable learner and the layer recognizer. During backpropagation, the recognition loss is automatically inverted before propagation to the transferable learner. The link prediction model is then iteratively trained using the echelon descent algorithm, with the parameter update process as follows: The learning rate decays with each iteration during the training phase: .in This represents the ratio of the current iteration number to the total number of iterations. In a specific embodiment of the invention, the initial learning rate... Set to 0.01, hyperparameter and Set them to 10 and 0.75 respectively.
[0050] Furthermore, during the training process, due to the minimax game in adversarial training, the model parameters will fluctuate slightly. Therefore, in each iteration, the experiment will retain the model with the best prediction performance on the current validation set. The validation set is judged by the accuracy of the prediction performance.
[0051] It's important to note that a saddle point is a stationary point that is not a local minimum (a point where the first derivative is 0). Mathematically, it means that the gradient (first derivative) of the objective function at this point is 0, but one direction from this point leads to a maximum point of the function, and another direction leads to a minimum point. In this context, it can be understood as finding a solution that simultaneously satisfies both formulas to the greatest extent possible.
[0052] To better implement the social network link prediction method in this embodiment of the invention, based on the social network link prediction method, correspondingly, such as... Figure 3 As shown, the present invention also provides a social network link prediction device 300, comprising: Data acquisition unit 301 is used to acquire the training set and target layer set of the social network links; Model building unit 302 is used to build an initial link prediction network consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer; The data processing unit 303 is configured to: use the network link training set as input to a transferable learner to obtain a common transferable representation of network links in the network link training set; use the target layer set as input to a representation learner to obtain individual layer representations of network links in the target layer set; aggregate the common transferable representation and the individual layer representations based on the fusion gate of the representation learner to obtain an aggregated representation of network links; use the aggregated representation as input to a link predictor to output a predicted quantization value indicating the existence or non-existence of each network link; and input the common transferable representation of network links to a layer recognizer to identify the network layer source of each network link. The model training unit 304 is used to construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer, to perform adversarial training with the transferable learner and the layer recognizer, and to iteratively train the link prediction network with the saddle point of the overall loss as the target, so as to obtain a fully trained link prediction network. The prediction output unit 305 is used to output the prediction network links of the target layer through a fully trained link prediction network.
[0053] The social network link prediction device 300 provided in the above embodiments can implement the technical solutions described in the above social network link prediction method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above social network link prediction method embodiments, and will not be repeated here.
[0054] like Figure 4 As shown, the present invention also provides an electronic device 400, which includes a processor 401, a memory 402, and a computer program stored in the memory 402 and executable on the processor 401. When the processor 401 executes the program, it implements the social network link prediction method as described above.
[0055] In a preferred embodiment, the above-described electronic device further includes a display 403 for displaying the processor 401 performing the social network link prediction method as described above.
[0056] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 402 and executed by processor 401 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in electronic device 400.
[0057] Electronic device 400 can be a desktop computer, laptop, PDA, or smartphone with a camera module.
[0058] The processor 401 can be an integrated circuit chip with signal processing capabilities. The processor 401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP) or an application-specific integrated circuit (ASIC). It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can also be a microprocessor or any conventional processor.
[0059] The memory 402 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Secure Digital (SD card), Flash Card, etc. The memory 402 stores programs, and the processor 401 executes these programs upon receiving execution instructions. The process definition methods disclosed in any of the foregoing embodiments of this invention can be applied to the processor 401, or implemented by the processor 401.
[0060] The display 403 can be an LED display, an LCD display, or a touch screen display, etc. The display 403 is used to display various information from the electronic device 400.
[0061] Understandable Figure 4 The structure shown is only a schematic diagram of one possible structure of electronic device 400. Electronic device 400 may also include more than one of the following: Figure 4 Show more or fewer components. Figure 4 The components shown can be implemented using hardware, software, or a combination thereof.
[0062] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the social network link prediction method as described above.
[0063] Generally, computer instructions for implementing the methods of the present invention can be carried on any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media can include any computer-readable medium except for signals themselves that are temporarily propagating.
[0064] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0065] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. In particular, Python, suitable for neural network computation, and platform frameworks based on TensorFlow, PyTorch, etc., can be used. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0066] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting links in a social network, characterized in that, The method includes: Obtain a social network link training set and a target layer set; obtaining the social network link training set includes: obtaining the network link structure in the network link data, taking graph data with links between any two nodes as positive samples, randomly selecting the same number of graph data with no links between any two nodes as negative samples, combining the positive samples and negative samples to construct a link dataset, and creating a link label set and a layer label set corresponding to the link dataset, and the link dataset, link label set and layer label set constitute the social network link training set; Construct an initial link prediction network consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer; Using the network link training set as input to a transferable learner, a common transferable representation of network links in the training set is obtained; using the target layer set as input to a representation learner, an individual layer representation of network links in the target layer set is obtained; based on the fusion gate of the representation learner, the common transferable representation and the individual layer representation are aggregated to obtain an aggregated representation of the network links; the aggregated representation is used as input to a link predictor, which outputs a predicted quantization value indicating the existence or non-existence of each network link; and the common transferable representation of the network links is input to a layer recognizer to identify the network layer source of each network link. A comprehensive loss function is constructed, consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. Adversarial training is performed using the transferable learner and the layer recognizer, and the link prediction network is iteratively trained with the saddle point of the comprehensive loss as the target, resulting in a fully trained link prediction network. This process includes: constructing a comprehensive loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer; learning transferable representations of network links between different layers based on the transferable learner to increase the recognition loss; learning the network layer origin of network links based on the layer recognizer to reduce the recognition loss; and iteratively training and optimizing the social network link prediction network using the gradient descent algorithm until the loss reaches the saddle point of the comprehensive loss, resulting in a fully trained multi-layer social network link prediction network. The target layer's predicted network links are output by training a fully functional link prediction network. The process of using the network link training set as input to a transferable learner to obtain common transferable representations of network links in the network link training set includes: Extract all network link representations from the network link training set, and filter out the transferable network link representations to obtain the common transferable representations of network links across all network layers; The process involves using the target layer set as input to a representation learner to obtain individual layer representations of network links within the target layer set; and then aggregating the common transferable representations and the individual layer representations using the fusion gate of the representation learner to obtain an aggregated representation of the network links, including: Extract the unique network link representation on the target layer set to obtain the personalized layer representation of the network links on the target network layer; The aggregate weights are calculated based on the layer label set corresponding to the link dataset and the individual layer representation of the network links on the target network layer. The common transferable representation and the individual layer representation are aggregated according to the aggregation weight to obtain the aggregated representation of the network link.
2. The social network link prediction method according to claim 1, characterized in that, The step of using the aggregate representation as input to the link predictor and outputting a predicted quantized value for the existence or non-existence of each network link includes: Using the aggregated representation of the network link as input, the probability of the network link existing and the probability of its non-existence corresponding to the aggregated representation are calculated. When the probability of a link existing is greater than the probability of it not existing, the corresponding network link is considered an existing link. The probability of existence is used as the predicted quantization value for the existence of a network link, and the predicted quantization value for each network link is output.
3. The social network link prediction method according to claim 1, characterized in that, The step of inputting the common transferable representation of network links into the layer identifier to identify the network layer source of each network link includes: The probability of each network link originating from each network layer is calculated based on the layer identifier, and the network layer with the highest probability is taken as the network layer source of the corresponding network link.
4. A social network link prediction apparatus, used to perform the social network link prediction method as described in any one of claims 1-3, characterized in that, include: The data acquisition unit is used to acquire the training set and target layer set of the social network links; The model building unit is used to build an initial link prediction network consisting of a transferable learner, a representation learner, a link predictor, and a layer recognizer. The data processing unit is used to take the network link training set as input to the transferable learner and obtain the common transferable representation of the network links in the network link training set; Using the target layer set as input to the representation learner, individual layer representations of network links in the target layer set are obtained; based on the fusion gate of the representation learner, the common transferable representation and the individual layer representation are aggregated to obtain the aggregated representation of the network links; The aggregated representation is used as input to the link predictor, which outputs a predicted quantized value indicating the existence of each network link; and the common transferable representation of the network links is input to the layer identifier to identify the network layer source of each network link. The model training unit is used to construct an overall loss function consisting of the prediction loss of the link prediction layer and the recognition loss of the layer recognizer. It performs adversarial training on the transferable learner and the layer recognizer, and iteratively trains the link prediction network with the saddle point of the overall loss as the target, so as to obtain a fully trained link prediction network. The prediction output unit is used to predict the target layer's network links by training a fully-trained link prediction network.
5. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the social network link prediction method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the social network link prediction method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Social network link prediction method adopting knowledge graph embedding and time convolution network
CN111784081A
Social network link prediction method based on attention neural network
CN112446542A