Graph sampling method, graph prediction method and storage medium
By using out-degree values and attribute information to determine the probability density function in the graph neural network, combined with importance sampling and Monte Carlo integration, the problem of graph sampling time consumption and performance impact is solved, and the training of the graph neural network is improved. efficiency and predictive effectiveness.
Patent Information
- Application Number
- CN202410552789.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-06
AI Technical Summary
Traditional deep learning methods are difficult to effectively process non-Euclidean spatial data. During the training process of graph neural networks, graph sampling takes a long time and the sampling strategy affects performance, resulting in poor training results.
The probability density function is determined through the out-degree value and attribute information of the node, and the importance sampling method is used combined with Monte Carlo integration to obtain representative sampling points. Topological relationships and attribute information are considered to improve the representativeness of the sampling points.
It improves the training efficiency of the graph neural network and the speed of prediction results, reduces the need for the number of sampling points, and improves the training effect.
Smart Images

Figure CN118133883B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a graph sampling method, a graph prediction method and a storage medium. Background Art
[0002] Due to its powerful feature extraction and fitting capabilities, deep learning has achieved good results in many fields, replacing traditional machine learning and manual feature extraction methods. However, traditional deep learning methods are usually applicable to data represented in Euclidean space and cannot solve non-Euclidean space problems well. Non-Euclidean space data usually use graphs to represent the relationship between objects. In order to better apply deep learning on graphs, graph neural networks came into being. Graph neural networks can be regarded as neural network models that process graph data. They are widely used in scenarios such as paper type prediction, product recommendation, social network prediction, protein and molecular interaction, etc.
[0003] When training graph neural networks, it is necessary to sample the graph data used as training data. Graph sampling takes a relatively long time in graph neural network training. Traditional graph sampling methods will bring a heavy burden to the calculation process of graph neural networks. Different graph sampling strategies also have different effects on the performance of graph neural networks.
[0004] Therefore, how to select a suitable graph sampling method to obtain representative sampling points so as to obtain better training results when training graph neural networks based on the sampling points is a problem that needs to be solved. Summary of the invention
[0005] The present application provides a graph sampling method, a graph spectrum prediction method and a storage medium, which are used to collect representative sampling points from a graph spectrum, so as to obtain better training results when training a graph neural network based on the sampling points.
[0006] In order to achieve the above technical objectives, this application adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a graph sampling method, the method comprising:
[0008] For each node in the graph, determine the node's out-degree value and the node's attribute information. The out-degree value is used to represent the number of edges in the graph that start from the node.
[0009] Determine the probability density function based on the out-degree value of the node and the attribute information of the node;
[0010] Based on the probability density function, the graph is sampled to obtain subgraphs, which are used to train the graph neural network.
[0011] The technical solution provided by the present application brings at least the following beneficial effects: the probability density function is determined by the out-degree value of the node and the attribute information of the node, and then based on the probability density function, the importance sampling method is adopted, combined with the Monte Carlo integration method, to determine the sampling points. Since the out-degree value of the node is determined based on the topological relationship of the nodes in the graph, the probability density function determined by the present application takes into account both the topological relationship of the nodes in the graph and the attribute information of each node, and then the sampling points determined based on the probability density function are more representative, and better graph neural network training effects can be obtained. Since the sampling points are more representative, there is no need to select a large number of sampling points to obtain prediction results, that is, the processing process of the graph neural network on these sampling points is faster, and the method provided by the present application can increase the speed of obtaining prediction results through the graph neural network.
[0012] In a possible implementation, the attribute information of the node is represented by the norm of the node's feature vector; the method also includes: determining the attribute variables of the node and determining the information gain of each attribute variable; based on the information gain of each attribute variable, determining the norm of the node's feature vector.
[0013] In a possible implementation, each attribute variable includes multiple categories; determining the information gain of each attribute variable includes: for any attribute variable of a node, determining the information entropy of the category of the attribute variable to which the node belongs as the information gain of the attribute variable.
[0014] In a possible implementation, if for the i-th attribute variable, the node belongs to the j-th category in the i-th attribute variable, then the information gain of the i-th attribute variable of the node and the information entropy of the j-th category of the i-th attribute variable to which the node belongs satisfy the following relationship: ;in, The information gain used to represent the i-th attribute variable of the node, The information entropy of the jth category of the i-th attribute variable used to represent the node’s belonging, It is used to represent the probability of the jth category in the graph in the i-th attribute variable to which the node belongs; the information gain of the attribute variable and the norm of the node's feature vector satisfy the following relationship: ;in, The norm of the eigenvector used to represent the node.
[0015] In one possible implementation, a probability density function is determined based on the out-degree value of the node and the attribute information of the node, including: determining the variance of a preset function, the preset function is based on the integral solution function of the graph neural network and the probability density function, and the preset function is used to determine the sampling value; when the variance of the preset function is minimum, the probability density function is determined based on the out-degree value of the node and the attribute information of the node.
[0016] In a possible implementation, the probability density function, the out-degree value of the node, and the attribute information of the node satisfy the following relationship: ; Among them, x is used to represent the independent variable node of the probability density function, It is used to represent the probability density function, Used to represent the out-degree value of the independent variable node, Used to represent the attribute information of the node. Used to represent a collection of nodes in a graph. Used to represent any node in the graph. Used to represent the out-degree value of any node. Used to represent the attribute information of any node.
[0017] In one possible implementation, the method further includes: setting a training task; inputting multiple subgraphs into the graph neural network to obtain prediction results corresponding to the training task; and displaying the prediction results corresponding to the training task when the training end conditions are met.
[0018] In a second aspect, an embodiment of the present application provides a graph prediction method, including: obtaining a graph to be detected; inputting the graph to be detected into a graph neural network to obtain a prediction result corresponding to the graph to be detected, wherein the graph neural network is trained by a subgraph obtained based on the first aspect; and displaying the prediction result corresponding to the graph to be detected.
[0019] In a possible implementation, the graph to be detected is any one of a product recommendation graph, a paper field prediction graph, a social prediction graph, and a molecular structure graph; when the graph to be detected is a product recommendation graph, the nodes in the graph to be detected are products, and the prediction result is the recommendation degree of the product; when the graph to be detected is a paper field prediction graph, the nodes in the graph to be detected are papers, and the prediction result is the field to which the papers belong; when the graph to be detected is a social prediction graph, the nodes in the graph to be detected are people, and the prediction result is the familiarity between people; when the graph to be detected is a molecular structure graph, the nodes in the graph to be detected are atoms or residues, and the prediction result is a molecular structure; when the graph to be detected is a traffic flow prediction graph, the nodes in the graph to be detected are intersections, and the prediction result is the traffic flow at the intersections.
[0020] In a third aspect, an embodiment of the present application provides a graph sampling device, including:
[0021] A processing module is used to determine the out-degree value of each node in the graph and the attribute information of the node, where the out-degree value is used to represent the number of edges in the graph starting from the node;
[0022] The processing module is also used to determine the probability density function based on the out-degree value of the node and the attribute information of the node;
[0023] The processing module is also used to sample the graph based on the probability density function to obtain subgraphs, and the subgraphs are used to train the graph neural network.
[0024] In a possible implementation, the attribute information of the node is represented by the norm of the node's feature vector; the processing module is also used to: determine the attribute variables of the node and determine the information gain of each attribute variable; based on the information gain of each attribute variable, determine the norm of the node's feature vector.
[0025] In a possible implementation, each attribute variable includes multiple categories; the processing module is specifically configured to, for any attribute variable of a node, determine the information entropy of the category of the attribute variable to which the node belongs as the information gain of the attribute variable.
[0026] In a possible implementation, if for the i-th attribute variable, the node belongs to the j-th category in the i-th attribute variable, then the information gain of the i-th attribute variable of the node and the information entropy of the j-th category of the i-th attribute variable to which the node belongs satisfy the following relationship: ;in, The information gain used to represent the i-th attribute variable of the node, The information entropy of the jth category of the i-th attribute variable used to represent the node’s belonging, It is used to represent the probability of the jth category in the graph in the i-th attribute variable to which the node belongs; the information gain of the attribute variable and the norm of the node's feature vector satisfy the following relationship: ;in, The norm of the eigenvector used to represent the node.
[0027] In one possible implementation, the processing module is specifically used to: determine the variance of a preset function, the preset function is based on the integral solution function of the graph neural network and the probability density function, and the preset function is used to determine the sampling value; when the variance of the preset function is minimum, determine the probability density function based on the out-degree value of the node and the attribute information of the node.
[0028] In a possible implementation, the probability density function, the out-degree value of the node, and the attribute information of the node satisfy the following relationship: ; Among them, x is used to represent the independent variable node of the probability density function, It is used to represent the probability density function, Used to represent the out-degree value of the independent variable node, Used to represent the attribute information of the node. Used to represent a collection of nodes in a graph. Used to represent any node in the graph. Used to represent the out-degree value of any node. Used to represent the attribute information of any node.
[0029] In one possible implementation, the processing module is also used to set a training task; the processing module is also used to input multiple subgraphs into the graph neural network to obtain prediction results corresponding to the training task; the graph sampling device also includes an interaction module, and the interaction module is used to display the prediction results corresponding to the training task when the training end conditions are met.
[0030] In a fourth aspect, an embodiment of the present application provides a graph prediction device, comprising:
[0031] An acquisition module, used to acquire the graph to be detected;
[0032] A processing module, used for inputting the graph to be detected into a graph neural network to obtain a prediction result corresponding to the graph to be detected, where the graph neural network is trained by the subgraph obtained based on the first aspect;
[0033] The interactive module is used to display the prediction results corresponding to the graph to be tested.
[0034] In a possible implementation, the graph to be detected is any one of a product recommendation graph, a paper field prediction graph, a social prediction graph, and a molecular structure graph; when the graph to be detected is a product recommendation graph, the nodes in the graph to be detected are products, and the prediction result is the recommendation degree of the product; when the graph to be detected is a paper field prediction graph, the nodes in the graph to be detected are papers, and the prediction result is the field to which the papers belong; when the graph to be detected is a social prediction graph, the nodes in the graph to be detected are people, and the prediction result is the familiarity between people; when the graph to be detected is a molecular structure graph, the nodes in the graph to be detected are atoms or residues, and the prediction result is a molecular structure; when the graph to be detected is a traffic flow prediction graph, the nodes in the graph to be detected are intersections, and the prediction result is the traffic flow at the intersections.
[0035] In a fifth aspect, the present application provides an electronic device comprising: one or more processors; one or more memories; wherein the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes any one of the graph sampling methods provided in the first aspect, or any one of the graph prediction methods provided in the second aspect.
[0036] In a sixth aspect, the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are run on a computer, the computer executes any one of the graph sampling methods provided in the first aspect, or any one of the graph prediction methods provided in the second aspect.
[0037] In the seventh aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes any one of the graph sampling methods provided in the first aspect, or any one of the graph prediction methods provided in the second aspect.
[0038] For the specific description of the second to seventh aspects and their various implementations in the present application, reference may be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to seventh aspects and their various implementations, reference may be made to the beneficial effects analysis in the first aspect and its various implementations, which will not be repeated here.
[0039] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of the structure of a graph neural network training system applicable to a graph sampling method provided in an embodiment of the present application;
[0041] Figure 2 A logical schematic diagram of a graph neural network training process provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the hardware composition of a computing device provided in an embodiment of the present application;
[0043] Figure 4 A flowchart of a graph sampling method provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of a usage scenario of a graph sampling method provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of the structure of a graph sampling device provided in an embodiment of the present application;
[0046] Figure 7 A schematic structural diagram of a spectrum detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise specified, "multiple" means two or more.
[0049] Due to its powerful feature extraction and fitting capabilities, deep learning has achieved good results in many fields, replacing traditional machine learning and manual feature extraction methods. However, traditional deep learning methods are usually applicable to data represented in Euclidean space and cannot solve non-Euclidean space problems well. Non-Euclidean space data usually uses graphs to represent the relationship between objects. In order to better apply deep learning on graphs, graph neural networks came into being. Graph neural networks (GNN) can be regarded as a neural network model for processing graph data. It is widely used in product recommendations, paper field predictions, social network predictions, protein and molecular interactions, and other scenarios. Graph convolutional networks (GCN) that can use convolution operations to extract features from non-Euclidean data have also been developed.
[0050] For example, in the academic network scenario, using papers, authors, and institutions as nodes, and using their subordinate and associated relationships as edges to build a graph, and using a graph neural network model based on the graph, can help us predict information such as the field to which the paper belongs and the type of paper. For another example, in the product recommendation scenario, using users, products, and attributes as nodes, and using their purchase, review, and other associated relationships as edges to build a graph, and using a graph neural network model based on the graph, can help us predict the products that users like, and then recommend the products to users. For another example, in the social network prediction scenario, using people as nodes, and using the associated relationships between people as edges to build a graph, and using a graph neural network model based on the graph, can help us predict people that users may know, and then recommend people that users may know to users. For another example, in the protein and molecule interaction scenario, molecules and proteins are structured entities that can be represented by graphs. Using atoms and residues as nodes, and chemical bonds or chains as edges to build a graph, and using a graph neural network model based on the graph, can help us design drugs, predict chemical reactions, and predict interactions.
[0051] When training graph neural networks, it is necessary to sample the graph data used as training data. Graph sampling takes a relatively long time in graph neural network training. Traditional graph sampling methods will bring a heavy burden to the calculation process of graph neural networks. Different graph sampling strategies also have different effects on the performance of graph neural networks.
[0052] Therefore, how to select a suitable graph sampling method to obtain representative sampling points so as to obtain better training results when training graph neural networks based on the sampling points is a problem that needs to be solved.
[0053] In this regard, an embodiment of the present application provides a graph sampling method, which determines the probability density function through the out-degree value of the node and the attribute information of the node, and then determines the sampling points based on the probability density function by using the importance sampling method and combining the Monte Carlo integration method. Since the out-degree value of the node is determined based on the topological relationship of the nodes in the graph, the probability density function determined by the present application takes into account both the topological relationship of the nodes in the graph and the attribute information of each node, and then the sampling points determined based on the probability density function are more representative, and better graph neural network training effects can be obtained. Since the sampling points are more representative, there is no need to select a large number of sampling points to obtain prediction results, that is, the processing process of the graph neural network on these sampling points is faster, and the method provided by the present application can increase the speed of obtaining prediction results through the graph neural network.
[0054] Please refer to Figure 1 , which shows the graph neural network training system to which the graph sampling method provided in this application is applicable. Figure 1As shown, the graph neural network training system 1 includes: a graph construction module 10, a feature extraction module 20, a graph sampling module 30, a sub-graph feature extraction module 40, a graph neural network training module 50, and a graph neural network deployment module 60.
[0055] In some embodiments, data related to the graph spectrum is input into the graph neural network training system 1, and then the graph construction module 10 generates a graph based on these data and stores the generated graph. For example, if the graph construction module 10 receives information such as a map data table, traffic signal equipment data, traffic event detection equipment data, and road traffic IoT data, the graph construction module 10 can generate a graph with intersections, road sections, lanes, traffic flows, traffic signals, traffic events, etc. as nodes, and the associations between these nodes as edges. Such a graph is continuously input into other modules in the graph neural network training system 1, and tasks such as congestion identification at intersections and traffic flow prediction at intersections can be completed.
[0056] In some embodiments, the feature extraction module 20 is used to extract feature information of each node and feature information of each edge from the graph.
[0057] In some embodiments, the graph sampling module 30 is used to sample a sub-graph from the graph.
[0058] In some embodiments, the subgraph feature extraction module 40 is used to determine the feature information of the nodes and the feature information of the edges in each subgraph based on the feature information of each node in the graph and the feature information of each edge.
[0059] In some embodiments, the graph neural network training module 50 is used to train the graph neural network based on the subgraph, the feature information of the nodes on the subgraph and the feature information of the edges, and a preset training strategy to obtain a trained graph deep learning model.
[0060] In some embodiments, the graph neural network deployment module 60 is used to deploy the trained graph deep learning model to a user-specified device to enable the graph deep learning model to predict the graph and obtain prediction results.
[0061] Generally, the graph construction module 10 and the feature extraction module 20 can be performed in a central processing unit (CPU) or a distributed CPU environment, and the functions of the graph sampling module 30, the subgraph feature extraction module 40, the graph neural network training module 50, and the graph neural network deployment module 60 can be performed in a central processing unit (CPU), a distributed CPU, a graphics processing unit (GPU), or a distributed GPU environment. The functions of the graph construction module 10, the feature extraction module 20, the graph sampling module 30, the subgraph feature extraction module 40, the graph neural network training module 50, and the graph neural network deployment module 60 can be supported in a bare metal environment and / or a containerized platform environment.
[0062] Based on the above description, the graph neural network training process can be as follows Figure 2 As shown, the graph construction module 10 constructs a graph, the feature extraction module 20 determines the feature information of each node in the graph and the feature information of each edge, the graph sampling module 30 samples a subgraph from the graph, and the subgraph feature extraction model 40 determines the subgraph features (the feature information of the nodes in the subgraph and the feature information of the edges), and then the graph neural network training module 50 trains the graph neural network based on the subgraph, subgraph features, and preset training strategies to obtain a trained graph deep learning model, and then the graph neural network deployment module 60 deploys the graph deep learning model and uses the graph deep learning model to perform graph prediction to obtain prediction results.
[0063] In this way, in the graph neural network training system 1, through the collaborative work between various modules, the complete process of data input → graph construction → feature extraction → model training → model application can be realized.
[0064] The hardware structure of the graph construction module 10, feature extraction module 20, graph sampling module 30, subgraph feature extraction module 40, graph neural network training module 50, and graph neural network deployment module 60 may include Figure 3 The computing device shown in FIG. Figure 3 Taking the computing device shown as an example, the above-mentioned graph construction module 10, feature extraction module 20, graph sampling module 30, sub-graph feature extraction module 40, graph neural network training module 50, and graph neural network deployment module 60 are introduced.
[0065] like Figure 3 As shown, the computing device may include a processor 301, a memory 302, a communication interface 303, and a bus 304. The processor 301, the memory 302, and the communication interface 303 may be connected via a bus 304.
[0066] The processor 301 is the control center of the computing device, which can be a processor or a general term for multiple processing elements. For example, the processor 301 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0067] As an embodiment, the processor 301 may include one or more CPUs, such as Figure 3 CPU 0 and CPU 1 are shown in .
[0068] The memory 302 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0069] In a possible implementation, the memory 302 may exist independently of the processor 301, and the memory 302 may be connected to the processor 301 via a bus 304 to store instructions or program codes. When the processor 301 calls and executes the instructions or program codes stored in the memory 302, the model deployment method provided in the embodiment of the present application can be implemented.
[0070] In another possible implementation, the memory 302 may also be integrated with the processor 301 .
[0071] The communication interface 303 is used for the computing device to connect with other devices through a communication network, which may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 303 may include a receiving unit for receiving data and a sending unit for sending data.
[0072] The bus 304 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0073] It should be pointed out that Figure 3 The structure shown in the figure does not constitute a limitation on the computing device, except Figure 3 In addition to the components shown, the computing device may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0074] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0075] In some embodiments, the graph sampling method provided in the embodiments of the present application may be run in a CPU (including a distributed CPU).
[0076] In other embodiments, the graph sampling method provided in the embodiments of the present application may also be run in a GPU (including a distributed GPU).
[0077] In other embodiments, the graph sampling method provided in the embodiments of the present application can also be run in a neural network processing unit (NPU) or a tensor processing unit (TPU).
[0078] like Figure 4 As shown, the embodiment of the present application provides a graph sampling method, which can be performed by the above-mentioned graph sampling module 30, and the method includes the following steps:
[0079] S101. For each node in the graph, determine the out-degree value of the node and the attribute information of the node.
[0080] Among them, the out-degree value is used to represent the number of edges in the graph starting from the node.
[0081] For example, in Figure 5In the graph shown, the number of edges starting from node 0 is 1, so the out-degree value of node 0 is 0, the number of edges starting from node 1 is 0, so the out-degree value of node 1 is 0, the number of edges starting from node 2 is 2, so the out-degree value of node 2 is 2, and the number of edges starting from node 3 is 3, so the in-degree value of node 3 is 3.
[0082] Specifically, if Figure 5 The graph shown is a paper field prediction graph constructed with papers, authors, and institutions as nodes and their subordinate and associated relationships as edges. Node 0 represents institution a, node 1 represents paper b, node 2 represents author c, and node 3 represents author d. Figure 5 The graph shown indicates that the relationship between author c and author d is that of teacher and student, both author c and author d have submitted papers to institution a, institution a has published papers published by author c, institution a has published paper b, and the author of paper b is author d.
[0083] In practical applications, during the training of graph neural networks, a The graph convolutional neural network of layers is composed of The graph convolutional layers are composed of graph convolutional layers, each of which generates the representation function of the current layer of the central node by aggregating the representation functions of the previous layer of adjacent nodes:
[0084] (1);
[0085] in, represents the normalized and normalized adjacency matrix; Indicates The weight matrix of the layer, that is, the parameters to train the graph neural network; Indicates The representation function of the layer node, Indicates Characterization function of layer nodes; Represents the activation function, usually a linear rectification function (ReLU). Represents the loss function, and the above weight matrix is learned through the loss function to achieve the training of the graph neural network.
[0086] Based on the definition of integral, the representation function and loss function of the nodes in the network layer can be rewritten into integral form according to the definition of graph convolution, as shown below:
[0087] (2);
[0088] in, . Representation Node The adjacent nodes of Represents adjacent nodes probability.
[0089] Since the above integral form is not a numerical form in the Riemann function, the specific integral value in formula (2) cannot be determined by definite integral calculation. Currently, the Monte Carlo integral method is often used to determine the above integral value. The basic idea of the Monte Carlo integral method is to randomly select points based on probability distribution. According to the law of large numbers, the frequency mean of the processing calculation based on the above random points can be approximately represented by the expected value. Among them, the law of large numbers characterizes that the frequency of a random event is approximately its probability.
[0090] Estimation of function integral based on Monte Carlo integration method The steps are:
[0091] Step 1: Through the probability density function Generate n independent and identically distributed random numbers [a, b], ;
[0092] Step 2: Definition , according to the random number obtained in step 1 calculate , get independent and identical samples ;
[0093] Step 3: Use The observed value of is used as the estimated value of E[g(x)];
[0094] Step 4: Define according to expected value. .
[0095] Based on the above steps, (3);
[0096] Among them, a simpler probability density function can be selected , which means uniform sampling. At present, there are also probability density functions defined in combination with graph topology (4);
[0097] in is a node in the graph, Represents any node in the graph.
[0098] Combining the above formula (3) and formula (4), we can get the formula (2): Layer Node The specific execution formula of the characterization function is:
[0099] (5);
[0100] The probability density function It also satisfies formula (4) Definition of .
[0101] However, this method only considers the out-degree value of the node, that is, only considers the graph topological relationship of the nodes, and the finally selected sampling points are not representative.
[0102] In some embodiments, the attribute information of a node is represented by the norm of the node's feature vector; the graph sampling module determines the information gain of each attribute variable by determining the attribute variables of the node; and then determines the norm of the node's feature vector based on the information gain of each attribute variable.
[0103] If the attribute variable of the marked node is , and the information gain brought by each attribute variable is marked as , then the information gain of the attribute variable and the norm of the node's feature vector satisfy the following relationship:
[0104] ;
[0105] in, The norm of the eigenvector used to represent the node, the eigenvector of the node is a vector composed of the node's attribute variables, It is used to represent the information gain of the i-th attribute variable of the node. Multiple categories can be included under each attribute variable. If the node belongs to the j-th category under the i-th attribute variable, the information gain of the i-th attribute variable of the node can be determined by the information entropy of the j-th category of the i-th attribute variable. The relationship between the information gain of the i-th attribute variable of the node and the information entropy of the j-th category in the i-th attribute variable to which the node belongs can be expressed as:
[0106] ;
[0107] The information entropy of the jth category in the i-th attribute variable used to represent the node’s belonging, It is used to indicate the probability of the jth category in the graph in the i-th attribute variable to which the node belongs.
[0108] For example, in a social graph with people as nodes, if the attribute variables of the nodes include movie lovers, food lovers, and game lovers, and movie lovers include three categories: martial arts, suspense, and romance, if a person in this graph is a movie lover and his favorite movie category is martial arts, assuming that the probability of the martial arts category appearing in the entire graph is , then the information gain of the attribute variable of movie lovers of this person representation node is , and then based on the information gain of the three attribute variables of movie lovers, food lovers, and game lovers, the norm of the feature vector of the node representing this person can be determined.
[0109] In particular, when the graph is a homogeneous graph, the node label can be a type of attribute variable. For the information gain of a node label, the graph sampling module can determine the information gain of the node label of the node based on the information entropy of the category of the node label to which the node belongs, and then determine the norm of the feature vector of the node in combination with the information gain of other attribute variables. Among them, the graph that does not distinguish between the types of nodes and edges is a homogeneous graph. Different node labels have different effects on nodes. When the number of node labels and the distribution of node labels are greatly different, the node label has a more obvious effect on the node.
[0110] When the graph is a heterogeneous graph, the node type can be a type of attribute variable. For the information gain of the node type of a node, the graph sampling module can determine the information gain of the node type of the node based on the information entropy of the category of the node type to which the node belongs, and then determine the norm of the feature vector of the node in combination with the information gain of other attribute variables. Among them, the graph that distinguishes the types of nodes and edges is a heterogeneous graph.
[0111] For graphs with more specific structures, such as the movie lover attributes, food lover attributes, game lover attributes, etc. of people in the social graph, we can determine the probability of each category appearing in the graph based on the number of categories of each attribute variable in the node and the number of each attribute variable, and then determine the information entropy of the category, and then determine the information gain of the attribute variable of the node.
[0112] In this way, information gain is defined by information entropy, and the norm of the eigenvector of each node is determined based on the information gain. The attribute information of the node is taken into account when determining the probability density function in the subsequent process, and then the sampled nodes determined based on the probability density function are more representative.
[0113] S102: Determine a probability density function based on the out-degree value of the node and the attribute information of the node.
[0114] In some embodiments, the graph sampling module determines the variance of a preset function; when the variance of the preset function is minimum, the probability density function is determined based on the out-degree value of the node and the attribute information of the node.
[0115] Among them, the preset function is based on the integral solution function and probability density function of the graph neural network, and the preset function is used to determine the sampling value.
[0116] Based on the above description, the preset function is , Importance sampling requires that the variance of the preset function is as small as possible, and the variance of the preset function is:
[0117] D g x =E g x 2 - E g x 2 ] = E f x pdf x 2 - E f x pdf x 2 = ∫ a b f(x) 2 pdf(x) dx- ( ∫ a b f(x)dx ) 2 ;
[0118] Then when the variance is minimum, that is, when the variance is 0, the probability density function Combining formula (2), substituting the integral to be calculated into the probability density function when the variance is 0, we get the following formula (6):
[0119] (6);
[0120] Among them, x is used to represent the independent variable node of the probability density function; It is used to represent the out-degree value of the independent variable node, which can reflect the topological relationship of the graph; The norm of the feature vector used to represent the node, representing the attribute information of the node; Used to represent a collection of nodes in a graph; Used to represent any node in the graph; Used to represent the out-degree value of any node; Represents the attribute information of any node.
[0121] In this way, the probability density function is improved along the direction of minimum sampling variance. The improved probability density function takes into account the topological relationship between the nodes in the graph as well as the attribute information of the nodes in the graph. The sampling points finally selected are more representative, and better training results can be obtained when training the graph neural network based on the subgraph composed of the selected sampling points.
[0122] S103. Based on the probability density function, sample the graph to obtain a subgraph.
[0123] Among them, the subgraph is used to train the graph neural network.
[0124] Exemplarily, the user first determines a first preset number of target nodes in the graph. For any target node, based on the probability density function, a second preset number of nodes related to the target node are selected. Based on the edges between the selected nodes, a subgraph consisting of the selected nodes and the target node can be obtained. Finally, a first preset number of subgraphs will be obtained. Based on the sampled multiple subgraphs, the graph neural network can be trained. Among them, the selected nodes related to the target node can be adjacent nodes of the target node. Optionally, the selected nodes related to the target node can also be adjacent nodes of adjacent nodes of the target node.
[0125] Figure 4 The technical solution shown brings at least the following beneficial effects: the probability density function is determined by the out-degree value of the node and the attribute information of the node, and then based on the probability density function, the importance sampling method is adopted, combined with the Monte Carlo integration method, to determine the sampling points. Since the out-degree value of the node is determined based on the topological relationship of the nodes in the graph, the probability density function determined by the present application takes into account both the topological relationship of the nodes in the graph and the attribute information of each node, and then the sampling points determined based on the probability density function are more representative, and better graph neural network training effects can be obtained. Since the sampling points are more representative, there is no need to select a large number of sampling points to obtain prediction results, that is, the processing process of the graph neural network on these sampling points is faster, and the method provided by the present application can increase the speed of obtaining prediction results through the graph neural network.
[0126] In some embodiments, the graph sampling module can also set a training task; input multiple subgraphs into the graph neural network to obtain prediction results corresponding to the training task; and display the prediction results corresponding to the training task when the training end conditions are met.
[0127] Among them, the training end condition can be determined based on the loss function, performance index, number of iterations, training time, output results, etc. For example, by observing the changes in the loss function during the training process, if the loss function remains stable after multiple iterations and no longer decreases significantly, this may mean that the model has converged and has reached the training end condition, and the training can be stopped. For another example, by observing the changes in performance indicators such as accuracy, recall rate, F1 value, etc. during the training process, if these performance indicators no longer increase significantly over a period of time, then the model may have been trained to the best performance and has reached the training end condition, and the training can be stopped. For another example, an increase in the number of training times will increase the computing cost and time cost, so a preset number of iterations can be set. When the model training reaches the preset number of iterations, it means that the performance and cost of the model training have reached a balance, and the training conditions have been met, and the training can be stopped. For another example, long-term training may increase the computing cost and time cost, so a preset duration can be set. When the model training reaches the preset duration, it means that the performance and cost of the model training have reached a balance, and the training end condition has been met, and the training can be stopped. For example, the prediction results of the subgraphs output by other trained models are obtained in advance as standard results, and the training results output by the graph neural network are compared. If the error between the training results output by the graph neural network and the standard results is less than the preset difference, it can be determined that the graph neural network has reached the training end condition and the training can be stopped. It should be understood that the training end condition can be one of the above examples, or a combination of multiple of the above examples, and there can be other specific implementation methods, which are not limited in this application.
[0128] The training task refers to using the labeled data set to train the model so that the model can accurately perform various training tasks. For example, based on the subgraph obtained by the above-mentioned graph sampling method, the subgraph is input into the graph neural network, and the true value is the category of each node labeled by the user in the subgraph. Then the prediction result of the training output can be the category of each node in the subgraph labeled by the graph neural network. For another example, the subgraph is input into the graph neural network, and the true value is the feature vector of each node labeled by the user in the subgraph. Then the prediction result of the training output can be the feature vector of each node in the subgraph labeled by the graph neural network.
[0129] In this way, the prediction effect of the graph neural network trained based on the above-mentioned graph sampling method is better, and the final prediction result output by the graph neural network corresponding to the training task is displayed to the user, so that the user can intuitively feel the training effect of the graph neural network.
[0130] In some embodiments, the embodiments of the present application also provide a graph prediction method, which can be executed by the above-mentioned graph neural network training module 50, and the method can include: the graph neural network training module obtains the graph to be detected; the graph to be detected is input into the graph neural network trained based on the above-mentioned graph sampling method to obtain the prediction result corresponding to the graph to be detected; and the prediction result corresponding to the graph to be detected is displayed. The prediction effect of the graph neural network trained based on the above-mentioned graph sampling method is better, so when the prediction result corresponding to the graph to be detected is obtained using the graph neural network trained based on the above-mentioned graph sampling method and displayed to the user, it can bring a better user experience.
[0131] In some embodiments, the graph prediction method provided in the embodiments of the present application can be run in a CPU (including a distributed CPU).
[0132] In other embodiments, the graph prediction method provided in the embodiments of the present application can also run in a GPU (including a distributed GPU).
[0133] In other embodiments, the graph prediction method provided in the embodiments of the present application can also be run in a neural network processing unit (NPU) or a tensor processing unit (TPU).
[0134] In some embodiments, the graph to be detected is any one of a product recommendation graph, a paper field prediction graph, a social prediction graph, and a molecular structure graph; when the graph to be detected is a product recommendation graph, the nodes in the graph to be detected are products, and the prediction result is the recommendation degree of the product; when the graph to be detected is a paper field prediction graph, the nodes in the graph to be detected are papers, and the prediction result is the field to which the papers belong; when the graph to be detected is a social prediction graph, the nodes in the graph to be detected are people, and the prediction result is the familiarity between people; when the graph to be detected is a molecular structure graph, the nodes in the graph to be detected are atoms or residues, and the prediction result is a molecular structure; when the graph to be detected is a traffic flow prediction graph, the nodes in the graph to be detected are intersections, and the prediction result is the traffic flow at the intersections.
[0135] For example, in a social graph with people as nodes, if the attribute variables of the nodes include movie lovers, food lovers, and game lovers, and movie lovers include three categories: martial arts, suspense, and romance, if more than a preset number of people in this graph are movie lovers, and their favorite movie category is martial arts, then the graph is input into the graph neural network, and the prediction results obtained may indicate that people related to these people are movie lovers and their favorite movie category is martial arts.
[0136] As another example, in a graph with papers as nodes and citation relationships between papers as edges, if all papers cited by a node belong to field A, the prediction result obtained by the graph neural network for this graph may indicate that this node also belongs to field A.
[0137] As another example, in a graph with products as nodes and similarities between products as edges, if a user purchases product a more times and product b is more similar to product a, then the result predicted by the graph neural network may indicate that the user is more likely to purchase product b, and product b can be recommended to the user.
[0138] As another example, in a graph with people as nodes and the relationships between people as edges, if the number of interactions between person a and person b is large, and the number of interactions between person b and person c is also large, then the result predicted by the graph neural network may indicate the possibility of mutual acquaintance between person a and person c, and user a may be recommended to user c, or user c may be recommended to user a.
[0139] As another example, in a graph with atoms or residues as nodes and chemical bonds between atoms, between atoms and residues, and between residues as edges, the prediction result obtained by the graph neural network can be a molecular structure composed of multiple nodes, which is convenient for users to conduct research on molecular structure expansion.
[0140] As another example, in a graph with intersections as nodes and road sections, lanes, traffic flows, traffic signals, and traffic events as edges, the prediction results obtained through the graph neural network can be the traffic flows at each intersection. Based on this, it is possible to determine whether each intersection is congested. When congestion occurs at an intersection, traffic controllers can be promptly reminded to direct the intersection to avoid traffic jams.
[0141] In this way, since the sampling points used to train the graph neural network are more representative, the trained graph neural network has a better effect in predicting the graph spectrum, so the trained graph neural network can be applied to different graph spectrum prediction scenarios to obtain prediction results that meet user expectations. Since the sampling points obtained based on the graph sampling method provided in this application are more representative, the graph neural network trained by the sampling points has a higher accuracy in predicting the graph spectrum.
[0142] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easy to realize that the technical goals in this field are combined with the units and algorithm steps of each example described in the embodiments disclosed in this article, and the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical goals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0143] like Figure 6 As shown, the embodiment of the present application further provides a graph sampling device, which is used in the graph sampling method shown in the above method embodiment. The graph sampling device 400 includes: a processing module 401 and an interaction module 402.
[0144] Among them, processing module 401 is used to determine the out-degree value of the node and the attribute information of the node for each node in the graph, and the out-degree value is used to characterize the number of edges in the graph starting from the node; processing module 401 is also used to determine the probability density function based on the out-degree value of the node and the attribute information of the node; processing module 401 is also used to sample the graph based on the probability density function to obtain a subgraph, and the subgraph is used to train the graph neural network.
[0145] In a possible implementation, the attribute information of the node is represented by the norm of the node's feature vector; the processing module 401 is also used to: determine the attribute variables of the node and determine the information gain of each attribute variable; based on the information gain of each attribute variable, determine the norm of the node's feature vector.
[0146] In a possible implementation, each attribute variable includes multiple categories; the processing module 401 is specifically configured to, for any attribute variable of a node, determine the information entropy of the category of the attribute variable to which the node belongs as the information gain of the attribute variable.
[0147] In a possible implementation, if for the i-th attribute variable, the node belongs to the j-th category in the i-th attribute variable, then the information gain of the i-th attribute variable of the node and the information entropy of the j-th category of the i-th attribute variable to which the node belongs satisfy the following relationship: ;in, The information gain used to represent the i-th attribute variable of the node, The information entropy of the jth category of the i-th attribute variable used to represent the node’s belonging, It is used to represent the probability of the jth category in the graph in the i-th attribute variable to which the node belongs; the information gain of the attribute variable and the norm of the node's feature vector satisfy the following relationship: ;in, The norm of the eigenvector used to represent the node.
[0148] In one possible implementation, the processing module 401 is specifically used to: determine the variance of a preset function, the preset function is based on an integral solution function of a graph neural network and a probability density function, and the preset function is used to determine a sampling value; when the variance of the preset function is minimal, determine the probability density function based on the out-degree value of the node and the attribute information of the node.
[0149] In a possible implementation, the probability density function, the out-degree value of the node, and the attribute information of the node satisfy the following relationship: ; Among them, x is used to represent the independent variable node of the probability density function, It is used to represent the probability density function, Used to represent the out-degree value of the independent variable node, Used to represent the attribute information of the node. Used to represent a collection of nodes in a graph. Used to represent any node in the graph. Used to represent the out-degree value of any node. Used to represent the attribute information of any node.
[0150] In one possible implementation, the processing module 401 is also used to set a training task; the processing module 401 is also used to input multiple subgraphs into the graph neural network to obtain prediction results corresponding to the training task; the graph sampling device 400 also includes an interaction module 402, and the interaction module 402 is used to display the prediction results corresponding to the training task when the training end conditions are met.
[0151] like Figure 7 As shown, the present application embodiment also provides a spectrum detection device, which is used in the spectrum detection method shown in the above method embodiment. The spectrum detection device 500 includes: an acquisition module 501, a processing module 502 and an interaction module 503.
[0152] Among them, the acquisition module 501 is used to obtain the graph to be detected; the processing module 502 is used to input the graph to be detected into the graph neural network to obtain the detection result corresponding to the graph to be detected, and the graph neural network is trained by the sub-graph obtained based on the above-mentioned graph sampling method; the interaction module 503 is used to display the prediction result corresponding to the graph to be detected.
[0153] In a possible implementation, the graph to be detected is any one of a product recommendation graph, a paper field prediction graph, a social prediction graph, and a molecular structure graph; when the graph to be detected is a product recommendation graph, the nodes in the graph to be detected are products, and the prediction result is the recommendation degree of the product; when the graph to be detected is a paper field prediction graph, the nodes in the graph to be detected are papers, and the prediction result is the field to which the papers belong; when the graph to be detected is a social prediction graph, the nodes in the graph to be detected are people, and the prediction result is the familiarity between people; when the graph to be detected is a molecular structure graph, the nodes in the graph to be detected are atoms or residues, and the prediction result is a molecular structure; when the graph to be detected is a traffic flow prediction graph, the nodes in the graph to be detected are intersections, and the prediction result is the traffic flow at the intersections.
[0154] It should be noted that Figure 6 and Figure 7 The division of modules in the example is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or software function modules.
[0155] Another embodiment of the present application further provides an electronic device, the electronic device includes a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes each step performed by the graph sampling module or the graph neural network training module in the method flow shown in the above method embodiment.
[0156] In actual implementation, the processing module 401 and the interaction module 402, or the acquisition module 501, the processing module 502 and the interaction module 503 can be implemented by the processor of the electronic device calling the computer program code in the memory. The specific execution process can refer to the description of the above-mentioned graph sampling method or graph spectrum detection method, which will not be repeated here.
[0157] Another embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes each step performed by the graph sampling module or the graph neural network training module in the method flow shown in the above method embodiment.
[0158] In another embodiment of the present application, a computer program product is also provided. The computer program product includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes each step executed by the graph sampling module or the graph neural network training module in the method flow shown in the above method embodiment.
[0159] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer execution instruction is loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by the computer or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with the medium. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), etc.
[0160] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.
Claims
1. A graph sampling method, It is characterized in that The method is applied to a graph sampling system, the graph sampling system includes any one of a central processing unit, a graphics processing unit, a neural network processor and a tensor processor, and the graph sampling system also includes an interaction device; the method includes: Any one of the central processing unit, the graphics processing unit, the neural network processor and the tensor processor performs the following steps: For each node in the graph, determine the out-degree value of the node and the attribute information of the node, the out-degree value is used to characterize the number of edges in the graph starting from the node; determine the variance of a preset function, the variance of the preset function is based on the integral solution function of the graph neural network and the probability density function, the preset function is used to determine the sampling value; when the variance of the preset function is minimum, determine the probability density function based on the out-degree value of the node and the attribute information of the node; the attribute information of the node is characterized by the norm of the feature vector of the node, specifically including: determining the attribute variables of the node, and determining the information gain of each of the attribute variables; based on the information gain of each of the attribute variables, determine the norm of the feature vector of the node; based on the probability density function, sample the graph to obtain a subgraph, and the subgraph is used to train the graph neural network; The graphics processor sets a training task; The graphics processor inputs the plurality of subgraphs into the graph neural network to obtain a prediction result corresponding to the training task; The interactive device displays the prediction result corresponding to the training task when the training end condition is met; Wherein, the spectrum is any one of the following: The nodes are papers, authors and institutions, the edges are graphs constructed by the affiliation and association between papers, authors and institutions, and the prediction results are the fields and types of papers to which the papers belong; The nodes are users, products and attributes, and the edges are graphs constructed by the associations among users, products and attributes. The preset values are the products that users like. The nodes are people, the edges are graphs constructed by the associations between people, and the prediction results are people that the user may know; The nodes are atoms and residues, and the edges are graphs constructed by chemical bonds between atoms, between residues, or between atoms and residues, the graphs represent molecules or proteins, and the prediction results are chemical reactions and interactions between molecules, between proteins, or between molecules and proteins; The nodes are intersections, road sections, lanes, traffic flow directions, traffic signals, and traffic events, the edges are graphs constructed by the association relationships between the nodes, and the prediction results are the congestion identification results of the intersections and the traffic flow at the intersections; The nodes are products, the edges are graphs constructed by the similarities between products, and the prediction results are the recommendation levels of the products; The nodes are papers, the edges are graphs constructed by the citation relationships between papers, and the prediction results are the fields to which the papers belong; The nodes are people, the edges are graphs constructed by the association relationships between people, and the prediction result is the familiarity between people; The nodes are atoms or residues, the edges are graphs constructed by chemical bonds between atoms, between atoms and residues, or between residues, and the prediction result is a molecular structure; The nodes are intersections, the edges are graphs constructed by road sections, lanes, traffic flows, traffic signals, and traffic events, and the prediction result is the traffic flow at the intersection.
2. The method according to claim 1, It is characterized in that Each of the attribute variables includes a plurality of categories; The determining of the information gain of each attribute variable comprises: For any attribute variable of the node, the central processor determines the information entropy of the category of the attribute variable to which the node belongs as the information gain of the attribute variable.
3. The method according to claim 2, It is characterized in that If for the i-th attribute variable, the node belongs to the j-th category in the i-th attribute variable, then the information gain of the i-th attribute variable of the node and the information entropy of the j-th category of the i-th attribute variable to which the node belongs satisfy the following relationship: ; in, The information gain of the i-th attribute variable of the node is represented by: The information entropy of the j-th category of the i-th attribute variable to which the node belongs is used to represent the information entropy of the j-th category of the i-th attribute variable to which the node belongs. The probability of the jth category in the i-th attribute variable to which the node belongs appearing in the graph; The information gain of the attribute variable and the norm of the feature vector of the node satisfy the following relationship: ; in, The norm of the eigenvector used to represent the node.
4. The method according to any one of claims 1 to 3, It is characterized in that The probability density function, the out-degree value of the node, and the attribute information of the node satisfy the following relationship: ; Wherein, x is used to represent the independent variable node of the probability density function, is used to represent the probability density function, It is used to represent the out-degree value of the independent variable node. Used to represent the attribute information of the node, is used to represent a collection of nodes in the graph, Used to represent any node in the graph, It is used to represent the out-degree value of any node. Used to represent the attribute information of the arbitrary node.
5. A graph prediction method, It is characterized in that The method is applied to a graph prediction system, which includes a graphics processor and an interaction device; the method includes: The graphics processor obtains a graph to be detected; The graphics processor inputs the to-be-detected graph into a graph neural network to obtain a prediction result corresponding to the to-be-detected graph, wherein the graph neural network is trained by sampling the graph based on a probability density function in the method described in any one of claims 1 to 4 above to obtain a subgraph; The interactive device displays the prediction result corresponding to the to-be-detected graph.
6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed on a computer, the computer executes the graph sampling method according to any one of claims 1 to 4, or the graph prediction method according to claim 5.
Citation Information
Patent Citations
Graph node low-dimensional representation learning method and device, terminal equipment and storage medium
CN111860783A
Information recommendation method and device based on knowledge graph, equipment and storage medium
CN112084383A
Probability calculation method and device in graph, computer equipment and storage medium
CN112256886A
Scientific research knowledge graph talent recommendation method and device based on graph neural network
CN112905891A
Image processing method, neural radiation field training method and neural network
CN115631418A
