CN115238134A - Method and apparatus for generating a graph vector representation of a graph data structure - Google Patents

Method and apparatus for generating a graph vector representation of a graph data structure Download PDF

Info

Publication number
CN115238134A
CN115238134A CN202210811350.0A CN202210811350A CN115238134A CN 115238134 A CN115238134 A CN 115238134A CN 202210811350 A CN202210811350 A CN 202210811350A CN 115238134 A CN115238134 A CN 115238134A
Authority
CN
China
Prior art keywords
node
graph
embedding
layer
neighbor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210811350.0A
Other languages
Chinese (zh)
Inventor
张铁华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced Nova Technology Singapore Holdings Ltd
Original Assignee
Alipay Labs Singapore Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Labs Singapore Pte Ltd filed Critical Alipay Labs Singapore Pte Ltd
Priority to CN202210811350.0A priority Critical patent/CN115238134A/en
Publication of CN115238134A publication Critical patent/CN115238134A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present specification provide methods and apparatus for generating a graph vector representation of graph structure data. In the method, initial node embedding of each graph node is generated based on node description information of each graph node, and a complete adjacency matrix is constructed according to edge connection information in graph structure data. And then, providing the initial node embedding and the complete adjacency matrix of each graph node for the graph neural network to execute node embedding updating layer by layer, and obtaining the updated node embedding of each graph node. Then, a graph vector representation of the graph structure data is generated based on the updated node embedding of each graph node. When node embedding updating is carried out on each aggregation layer, for each graph node, a target neighbor graph node of the graph node is determined based on a node relevance metric value of the neighbor graph node on the previous aggregation layer, and node embedding updating is carried out by using the graph node and the node embedding of the corresponding target neighbor graph node which is updated through the previous aggregation layer.

Description

Method and apparatus for generating a graph vector representation of a graph data structure
Technical Field
Embodiments of the present description relate generally to the field of graph data processing, and more particularly, to a method and apparatus for generating a graph vector representation of a graph data structure.
Background
Graph structure data describes a complex non-linear data storage structure that cannot be described in euclidean space. Using graph structure data, concepts and interrelationships in the physical world can be quickly described. Graph structure data can form point-edge-point relationships by way of modeling.
Under scenarios such as intelligent search, intelligent question and answer, personalized recommendation, intelligence analysis, anti-fraud, etc., graph structure data may be generated. And the generated graph structure data contains a large amount of point-edge interactive topological information, and the topological information can be effectively modeled and applied to the scene. Thus, there is a need for a graph representation scheme to map topology information in graph structure data into a graph representation of the graph structure data to more efficiently apply the graph structure data.
Disclosure of Invention
In view of the foregoing, embodiments of the present specification provide methods and apparatus for generating a graph representation of graph structure data. By using the method and the device, the topological information of the graph structure data can be efficiently mapped to the graph vector representation of the graph structure data.
According to an aspect of embodiments of the present specification, there is provided a method for generating a graph vector representation of graph structure data, comprising: generating initial node embedding (embedding) of each graph node based on the node description information in the graph structure data; constructing a complete adjacency matrix of the graph structure data according to the edge connection information in the graph structure data; providing the initial node embedding of each graph node and the complete adjacency matrix to a graph neural network to iteratively execute a node embedding updating process layer by layer so as to obtain updated node embedding of each graph node; and generating graph vector representation of the graph structure data based on the updated node embedding of each graph node, wherein when node embedding updating is carried out on each aggregation layer, a target neighbor graph node of each graph node is determined based on a node correlation metric value of the neighbor graph node on the current aggregation layer, and the graph node and the node embedding updating which is updated by the previous aggregation layer and corresponds to the target neighbor graph node are used for carrying out node embedding updating.
Optionally, in an example of the above aspect, providing the initial node embedding and the full adjacency matrix of each graph node to the graph neural network to iteratively perform the node embedding updating process layer by layer to obtain an updated node embedding of each graph node includes: determining neighbor graph nodes of all graph nodes on the current aggregation layer according to the complete adjacency matrix; determining a node correlation metric value of each neighbor graph node of each graph node on a previous aggregation layer according to each graph node and node embedding of the neighbor graph node after updating through the previous aggregation layer; determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes; and updating the node embedding of each graph node based on each graph node and the updated node embedding of the corresponding target neighbor graph node via the previous aggregation layer.
Optionally, in an example of the above aspect, determining the node relevance metric value of each neighbor graph node of each graph node on a previous aggregation layer according to the updated node embedding of each graph node and the corresponding neighbor graph node via the previous aggregation layer comprises: embedding and projecting each graph node and the updated nodes of the corresponding neighbor graph nodes through the previous aggregation layer to a comparison space by using a first weight coefficient matrix and a second weight coefficient matrix respectively; and determining a node relevance metric value of each neighbor graph node of each graph node on the previous aggregation layer according to each graph node and the node embedding of the corresponding neighbor graph node projected to the comparison space.
Optionally, in one example of the above aspect, the first weight coefficient matrix and the second weight coefficient matrix are weight coefficient matrices that can be learned based on a graph vector representation training process.
Optionally, in an example of the above aspect, determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes comprises: determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes by using a path pruning strategy, wherein the path pruning strategy is used for limiting the number of adjacent edges of the graph nodes.
Optionally, in an example of the above aspect, updating the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding neighbor graph node via a previous aggregation layer includes: and updating the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding neighbor graph node through the previous aggregation layer and the layer sharing weight coefficient matrix of the current aggregation layer.
Optionally, in one example of the above aspect, the layer-sharing weight coefficient matrix of each aggregation layer is a weight coefficient matrix that can be learned based on a graph vector representation training process.
Optionally, in an example of the above aspect, the node embedding updating process may include: constructing a layer-by-layer adjacency matrix of the current aggregation layer based on the complete adjacency matrix, wherein the layer-by-layer adjacency matrix is used for indicating neighbor graph nodes of all graph nodes on the current aggregation layer; determining a node correlation metric matrix on a previous aggregation layer according to a node embedding matrix updated by the previous aggregation layer and the layer-by-layer adjacency matrix of each graph node and the corresponding neighbor graph node, wherein the node correlation metric matrix is used for indicating a node correlation metric value of the neighbor graph node of each graph node on the previous aggregation layer; performing path pruning based on the node correlation metric matrix, wherein the node correlation metric matrix after path pruning is used for indicating target neighbor graph nodes of all graph nodes on the current aggregation layer; and updating the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding target neighbor graph node through the previous aggregation layer and the node correlation metric matrix subjected to the path pruning.
Optionally, in an example of the above aspect, generating the graph vector representation of the graph structure data based on the updated node embedding of the respective graph nodes may include: generating a graph vector representation of the graph structure data based on the initial node embedding and the updated node embedding of each graph node.
Optionally, in an example of the above aspect, generating the graph vector representation of the graph structure data based on the initial node embedding and the updated node embedding of each graph node may include: embedding the initial node of each graph node into the corresponding updated node embedding cascade; providing the cascaded node embedding of each graph node to a shallow MLP network to obtain the node embedding of each graph node after MLP processing; and embedding and averaging nodes of each graph node after MLP processing to generate graph vector representation of the graph structure data.
Optionally, in an example of the above aspect, the node relevance metric value may include one of the following relevance metric values: a correlation metric value based on a dot product; a correlation metric value based on the normalized cosine; a distance-based correlation metric.
According to another aspect of embodiments of the present specification, there is provided an apparatus for generating a graph vector representation of graph structure data, comprising: an initial node embedding generation unit which generates initial node embedding of each graph node based on the node description information in the graph structure data; a complete adjacency matrix construction unit which constructs a complete adjacency matrix of the graph structure data according to the edge connection information in the graph structure data; the node embedding updating unit is used for providing the initial node embedding of each graph node and the complete adjacency matrix to the graph neural network to iteratively execute a node embedding updating process layer by layer so as to obtain updated node embedding of each graph node; and a graph vector representation generation unit which generates a graph vector representation of the graph structure data based on the updated node embedding of each graph node, wherein when node embedding updating is performed on each aggregation layer, for each graph node, the node embedding updating unit determines a target neighbor graph node of the graph node based on a node correlation metric value of the neighbor graph node on a previous aggregation layer, and performs node embedding updating by using the graph node and the node embedding updated by the previous aggregation layer of the corresponding target neighbor graph node.
Optionally, in an example of the above aspect, the node-embedded updating unit includes: the neighbor graph node determining module is used for determining neighbor graph nodes of all graph nodes on the current aggregation layer according to the complete adjacency matrix; the node correlation determination module is used for determining a node correlation metric value of each neighbor graph node of each graph node on a previous aggregation layer according to each graph node and the node embedding of the neighbor graph node after being updated by the previous aggregation layer; the target neighbor graph node determining module is used for determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node correlation metric value of the neighbor graph node; and a node embedding updating module for updating the node embedding of each graph node based on each graph node and the updated node embedding of the corresponding target neighbor graph node via the previous aggregation layer.
Optionally, in an example of the above aspect, the node relevance determining module includes: the node embedding projection submodule is used for embedding and projecting each graph node and the updated nodes of the corresponding neighbor graph nodes through the previous aggregation layer to a comparison space by using a first weight coefficient matrix and a second weight coefficient matrix respectively; and a node correlation determination submodule for determining a node correlation metric value of each neighbor graph node of each graph node on the current aggregation layer according to each graph node and the node embedding of the corresponding neighbor graph node projected to the comparison space.
Optionally, in an example of the above aspect, the target neighbor graph node determining module determines the target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes by using a path pruning policy, where the path pruning policy is used to limit the number of adjacent edges of the graph node.
Optionally, in an example of the above aspect, the node embedding updating module updates the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding target neighbor graph node via the previous aggregation layer and the layer sharing weight coefficient matrix of the current aggregation layer.
Optionally, in an example of the above aspect, the node-embedded updating unit includes: a layer-by-layer adjacency matrix construction module, which constructs a layer-by-layer adjacency matrix of the current aggregation layer based on the complete adjacency matrix, wherein the layer-by-layer adjacency matrix is used for indicating neighbor graph nodes of all graph nodes on the current aggregation layer; a node correlation determination module, configured to determine a node correlation metric matrix on the current aggregation layer according to the node embedding matrix updated by a previous aggregation layer and the layer-by-layer adjacency matrix of each graph node and the corresponding neighbor graph node, where the node correlation metric matrix is used to indicate a node correlation metric value of a neighbor graph node of each graph node on the previous aggregation layer; a path pruning module, configured to perform path pruning based on the node correlation metric matrix, where the node correlation metric matrix after the path pruning is used to indicate a target neighbor graph node of each graph node on the current aggregation layer; and the node embedding updating module is used for updating the node embedding of each graph node based on the node embedding of each graph node and the corresponding target neighbor graph node after updating through the previous aggregation layer and the node correlation measurement matrix after path pruning.
Optionally, in an example of the above aspect, the graph vector representation generating unit generates the graph vector representation of the graph structure data based on initial node embedding and updated node embedding of each graph node.
Optionally, in an example of the above aspect, the graph vector representation generating unit includes: the node embedding cascade module is used for embedding the initial node of each graph node into the corresponding updated node embedding cascade respectively; the MLP processing module is used for embedding the cascaded nodes of each graph node into a shallow MLP network to obtain the node embedding of each graph node after MLP processing; and a graph vector representation generation module for embedding and averaging the nodes after MLP processing of each graph node to generate a graph vector representation of the graph structure data.
According to another aspect of embodiments of the present specification, there is provided an apparatus for generating a graph vector representation of graph structure data, comprising: at least one processor, a memory coupled with the at least one processor, and a computer program stored in the memory, the at least one processor executing the computer program to implement the method for generating a graph vector representation of graph structure data as described above.
According to another aspect of embodiments of the present specification, there is provided a computer-readable storage medium storing executable instructions that, when executed, cause a processor to perform a method for generating a graph vector representation of graph structure data as described above.
According to another aspect of embodiments of the present specification, there is provided a computer program product comprising a computer program for execution by a processor to implement the method for generating a graph vector representation of graph structure data as described above.
Drawings
A further understanding of the nature and advantages of the present disclosure may be realized by reference to the following drawings. In the drawings, similar components or features may have the same reference numerals.
FIG. 1 illustrates an example diagram of graph structure data according to an embodiment of this specification.
FIG. 2 shows an example schematic of a graph neural network.
FIG. 3 illustrates an example flow diagram of a method for generating a graph vector representation of graph structure data in accordance with an embodiment of the present description.
FIG. 4 illustrates an example flow diagram of a complete adjacency matrix construction process according to another embodiment of this specification.
Fig. 5 illustrates an example schematic diagram of a single-hop messaging path of a graph node in accordance with an embodiment of the present description.
Fig. 6 illustrates an example flow diagram of a node relevance metric value determination process in accordance with embodiments of the present description.
FIG. 7 illustrates an example flow diagram of a graph vector representation generation process in accordance with embodiments of this specification.
FIG. 8 illustrates an example schematic diagram of a graph vector representation generation process in accordance with an embodiment of the present description.
FIG. 9 illustrates an example flow diagram of a method for generating a graph vector representation of graph structure data according to another embodiment of this description.
FIG. 10 illustrates an example flow diagram of a method for generating a graph vector representation of graph structure data according to another embodiment of this description.
Fig. 11 illustrates an example block diagram of a graph vector representation generation apparatus in accordance with an embodiment of this description.
FIG. 12 illustrates an example block diagram of a node-embedded update unit in accordance with an embodiment of this specification.
Fig. 13 illustrates an example block diagram of a node relevance determination module in accordance with an embodiment of this specification.
FIG. 14 illustrates an example block diagram of a graph vector representation generation unit in accordance with an embodiment of this specification.
FIG. 15 illustrates an example block diagram of a node-embedded update unit in accordance with another embodiment of this specification.
FIG. 16 illustrates an example schematic diagram of a computer-system-implementation-based graph vector representation generation apparatus according to embodiments of this specification.
Detailed Description
The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand the subject matter described herein and are not intended to limit the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements discussed without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as needed. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, features described with respect to some examples may also be combined in other examples.
As used herein, the term "include" and its variants mean open-ended terms in the sense of "including, but not limited to. The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first," "second," and the like may refer to different or the same object. Other definitions, whether explicit or implicit, may be included below. Unless the context clearly dictates otherwise, the definition of a term is consistent throughout the specification.
Graph representation learning has received increasing attention in recent years, especially for learning low dimensional embedding at the node and graph level for classification and recommendation tasks. To enable learning graph representations for large-scale graph data in the real world, much research has focused on developing different sampling strategies to facilitate the training process.
When a Graph Neural Network (GNN) is introduced to be applied to low-dimensional embedding of learning graph structure data, GNN becomes a de facto criterion for graph representation learning. Since the low-dimensional embedding is obtained by aggregating and distilling the high-dimensional information of graph nodes and the neighbor node information thereof in the graph structure data into a dense vector form, the low-dimensional embedding of the graph structure data can be used as an effective input for various prediction tasks, recommendation tasks, or any other graph-related analysis tasks.
Many implementations have emerged in recent years regarding the use of GNNs to learn graph vector representations of graph structure data. Conventional GNN schemes refer to implementations that use embedding of target optimization nodes based on matrix decomposition in a single fixed graph, while aggregating knowledge (knowledge) from all connected node pairs. An example of a conventional GNN scheme may be, for example, a Graph Convolution Network (GCN). The GCN scheme is recursively expanded layer by layer in a top-down manner, which requires expensive convolution calculation for all neighbor nodes for each node, thereby easily causing the problem of "neighbor explosion" in a large-scale dense graph.
To solve the above problem, a sampling-based GNN implementation is proposed that introduces a unified layer-by-layer sampling algorithm that iteratively applies a fixed-size sampling window to each layer from inside to outside. One sampling-based GNN implementation is GraphSAGE, which randomly samples fixed-size neighbor nodes for each node, rather than all neighbor nodes, thereby avoiding the "neighbor explosion" problem. For example, in some implementations, sampling may be based on conditions (i.e., a layer-by-layer sampling strategy) in which lower layers of the layer are sampled conditionally on each layer, e.g., nodes with the highest number of visits by the lower layer are treated as neighbor nodes, and a domain is built based thereon. In some implementations, sampling may be based on variance reduction (i.e., a graph-level sampling strategy) in which different subgraphs are constructed as small batches while decoupling the sampling process from the forward and backward propagation processes.
However, in the above GNN implementation scheme based on sampling, the correlation between the graph node to be processed and its neighbor nodes is not considered when sampling the neighbor nodes, so that the neighbor nodes sampled are not necessarily strong correlation neighbor nodes of the graph node to be processed, but the neighbor nodes with stronger correlation have a greater influence on the node embedding of the graph node to be processed, and thus the node embedding of the obtained graph node to be processed cannot accurately describe the local network topology information of the graph structure data, and further the graph vector representation of the obtained graph structure data cannot accurately describe the overall network topology information of the graph structure data.
In view of the foregoing, a method and apparatus for generating a graph representation of graph structure data is presented. In the method and the device, node embedding updating is iteratively executed layer by layer based on a graph neural network, and when node embedding updating is carried out on each aggregation layer, the importance of all neighbor nodes of each graph node is quantized recursively aiming at each graph node, so that the locality of the graph node can be better described, and meanwhile, the neighbor nodes are sampled according to the importance level. And then, updating the node embedding of the graph node on the current aggregation layer based on the sampled neighbor nodes, thereby reducing the calculation amount and the calculation complexity in the node embedding updating process, further improving the node embedding updating efficiency, and simultaneously ensuring that the learned node embedding can accurately reflect the local or overall network topology information of the graph structure data. Then, a graph vector representation of the graph structure data is obtained based on the updated node embedding of each graph node, thereby enabling the obtained graph vector representation of the graph structure data to accurately describe the overall network topology information of the graph structure data.
Methods and apparatus for generating a graph vector representation of graph structure data according to embodiments of the present specification will be described below with reference to the accompanying drawings.
FIG. 1 illustrates an example diagram of graph structure data according to an embodiment of this specification.
The graph structure data illustrated in fig. 1 is an undirected graph. The undirected graph is composed of graph nodes and edges. An edge may also be referred to as an edge connection or edge connection information. Each graph node has node description information. Further, each edge has an edge attribute. For example, in the social network graph, the node description information of the graph node may be description information of each social account, for example, including name, age, gender, and the like. The edge attribute may be, for example, friend relationship information between social account numbers. In the drug molecular graph, the node description information of the graph nodes can be information such as molecular names, single molecules or multiple molecules. The edge property may be, for example, carbon bond connection information from molecule to molecule.
As shown in fig. 1, the undirected graph includes 8 graph nodes, i.e., graph node 1, graph node 2, graph node 3, graph node 4, graph node 5, graph node 6, graph node 7, and graph node 8. The neighbor nodes of the graph node 1 are graph node 2, graph node 3 and graph node 5. The neighbor nodes of the graph node 2 are the graph node 1 and the graph node 3. The neighbor nodes of the graph node 3 are the graph node 1, the graph node 2 and the graph node 5. The neighbor nodes of the graph node 4 are the graph node 5 and the graph node 8. The neighbor nodes of the graph node 5 are graph node 1, graph node 3, graph node 4, graph node 6, and graph node 7. The neighbor nodes of the graph node 6 are graph nodes 5. The neighbor nodes of the graph node 7 are the graph node 5 and the graph node 8. The neighbor nodes of the graph node 8 are the graph node 4 and the graph node 7. Furthermore, the undirected graph shown in fig. 1 includes 10 edges, i.e., edges between graph nodes and their neighboring points, which may also be referred to as adjoining edges or single-hop adjoining edges. Note that, in this specification, the term "neighbor node" refers to a first-order neighbor node or a single-hop neighbor node.
The graph neural network is a network for extracting node feature representations from graph structure data. FIG. 2 shows an example schematic of a graph neural network. As shown in fig. 2, the graph neural network may include a plurality of aggregation layers, such as aggregation layer 1 through aggregation layer N in fig. 2. At each aggregation layer, for each graph node, the output node feature information of the previous aggregation layer propagated by each neighbor node of the graph node according to some propagation rule may be received and aggregated, so as to generate node feature information (node representation or node embedding) of the graph node on the aggregation layer, and the generated node feature information of the graph node is then propagated to the neighbor node at the next aggregation layer. And transmitting layer by layer, and outputting the node characteristic information obtained by the last polymerization layer as node embedding processed by the neural network of the graph. The term "aggregation layer" may also be referred to herein as a "messaging layer" or a "hidden layer".
Let us say that a given graph G = (V, E), where V = { ν = 1 ,…,ν N Is a set of nodes, E = { (v) ij )|ν ij E V represents the set of edges in the graph. Each node has a node characteristic with a dimension d 0 . The edge connection information of the graph G may be represented as an N × N full adjacency matrix a. In this case, the node feature matrix of the graph G can be represented with dimensions of Nxd 0 And the node feature matrix X is used as an input of the graph neural network. Each aggregation layer (e.g., aggregation layer l) in the graph neural network may be represented as H l =f(H l-1 A) wherein H l-1 The presentation aggregation layer l-1, f () represents the propagation rules.
FIG. 3 illustrates an example flow diagram of a method 300 for generating a graph vector representation of graph structure data in accordance with embodiments of the present description.
As shown in FIG. 3, at 310, initial node embeddings for respective graph nodes are generated based on node description information for the respective graph nodes in the graph structure data. For example, each graph node may have various kinds of node description information, each kind of node description information is used to describe node characteristics of one dimension of the graph node, so that the various kinds of node description information of the graph node may also be referred to as multidimensional node description information, for example, M-dimensional node description information. The value of M is usually very large, and therefore, the M-dimensional node description information needs to be subjected to dimension reduction processing, so that a mapping method is used to map the M-dimensional node description information into a low-dimensional embedding in a low-dimensional embedding representation space, for example, N-dimensional embedding, where N is much smaller than M. The value of N is typically a given value, e.g., 200. The value of each element in the generated initial node embedding is typically normalized to one of [0,1 ].
In one example, the node description information for each graph node in the graph structure data can be provided to a GTransformer model, for example, whereby initial node embedding for each graph node is output via the GTransformer model. In some embodiments, the edge connection information may include information related to node description information of the graph node. In this case, the node description information and the corresponding edge connection information of each graph node may be provided to the GTransformer model to output initial node embedding of each graph node.
At 320, a complete adjacency matrix of the graph structure data is constructed according to the edge connection information in the graph structure data, and the constructed complete adjacency matrix reflects the overall link relation between the graph nodes in the graph structure data.
Defining undirected graphs
Figure BDA0003739272730000091
Wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003739272730000092
is a set of nodes that are to be connected,
Figure BDA0003739272730000093
representing the set of edges in the graph. Using the full adjacency matrix A e {0,1} M×N To represent all connection information of the edge set, wherein if (v) i ,ν j ) E, a =1. If it is used
Figure BDA0003739272730000094
Then a =0. Because GNN learns node embedding using adjacency matrices and vectorized node features as inputs, it has a property expressed as
Figure BDA0003739272730000095
Of x, wherein i ∈X 0 Corresponding to node v i D-dimensional feature vector of (1). Briefly, node v i Is denoted as N (v) i ). Use of
Figure BDA0003739272730000096
Representing the entire graph data set, and using { y } 1 ,...,y n As the corresponding map label. L ∈ {1, 2., L } represents an aggregation layer (which may also be referred to as a messaging layer), and L represents a maximum aggregation layer/messaging layer.
FIG. 4 illustrates an example flow diagram of a complete adjacency matrix construction process 400 according to this specification. Note that, in the complete adjacency matrix construction process shown in fig. 4, the initial complete adjacency matrix is an all-0 matrix.
As shown in fig. 4, at 410, the graph structure data is traversed. At 420, it is determined whether there is link information between the graph nodes, i.e., whether there are link edges between the graph nodes and the graph nodes. If linking information exists, then at 430, the current full adjacency matrix is populated with the corresponding element information, i.e., the corresponding element is assigned a value of 1.
Next, at 440, it is determined whether there are non-traversed graph nodes. If so, return to 410 and continue to perform full adjacency matrix construction. If not, then full adjacency matrix construction is complete, thus, at 450, the constructed full adjacency matrix is output.
For example, for the graph structure data shown in fig. 1, the constructed full adjacency matrix may be an 8 × 8 matrix with one node pair for each element in the matrix, as described below. For example, the elements of the first row and the first column of the matrix correspond to the adjacency (node-pair relationship) to which the node pair consisting of node 1 and node 1 corresponds. If the node pair is present in the graph, then an adjacency is considered to exist, with a value of 1. And if not, 0. The elements of the first row and the third column of the matrix correspond to the adjacency (node-pair relationship) to which the node pair consisting of node 1 and node 3 corresponds. Since the node pair exists in the graph, the value of the adjacency relation is 1.
Figure BDA0003739272730000101
After the initial node embedding and full adjacency matrices of each graph node in the graph structure data are generated as above, the initial node embedding and full adjacency matrices of each graph node are provided to the graph neural network, and a node embedding updating process is iteratively performed layer by layer through each aggregation layer in the graph neural network to obtain updated node embedding of each graph node. When node embedding updating is carried out on each aggregation layer, for each graph node, a target neighbor graph node is determined from neighbor graph nodes of the graph node based on a node correlation metric value of the neighbor graph node on a previous aggregation layer, and node embedding updating is carried out by using the graph node and node embedding updated by the previous aggregation layer of the corresponding target neighbor graph node.
Specifically, as shown in FIG. 3, the operations 330 through 370 are performed in a layer-by-layer loop from the first aggregation layer of the graph neural network until the node embedding update of the last aggregation layer is completed.
Specifically, during each cycle, at 330, the neighbor graph nodes of the respective graph nodes on the current aggregation level are determined based on the full adjacency matrix. For example, a single-hop messaging path of the current aggregation layer may be constructed according to the full adjacency matrix, where the constructed single-hop messaging path includes a single-hop messaging path between each graph node and a neighbor graph node on the previous aggregation layer, and the single-hop messaging path of each graph node includes an adjacent edge between the graph node and its neighbor graph node, so as to determine the neighbor graph node of the graph node on the current aggregation layer. Fig. 5 shows a single-hop messaging path for the graph node 1 in fig. 1, i.e., the graph node 2, the graph node 3, and the graph node 5 deliver their node embedding to the graph node 1, thereby resulting in the neighbor graph nodes of the graph node 1 being the graph node 2, the graph node 3, and the graph node 5.
After determining the neighbor graph nodes of each graph node on the current aggregation layer as described above, at 340, a node relevance metric value of each neighbor graph node of each graph node on the previous aggregation layer is determined according to each graph node and the node embedding of the corresponding neighbor graph node updated by the previous aggregation layer.
In some embodiments, examples of node relevance metric values may include, but are not limited to: a correlation metric value based on a dot product; a correlation metric value based on the normalized cosine; a distance-based correlation metric.
In some examples, a correlation coefficient function may be applied directly to the graph nodes and the nodes embedding of the corresponding neighbor graph nodes updated via a previous aggregation layer to determine a node relevance metric value at each neighbor graph node on the previous aggregation layer. Examples of correlation coefficient functions include, for example, but are not limited to: correlation coefficient functions based on dot products, correlation coefficient functions based on normalized cosines; or a distance-based correlation coefficient function.
In some embodiments, the graph nodes and the updated node embedding of the corresponding neighbor graph nodes via the previous aggregation layer may be subjected to embedding spatial transformation, and then a correlation coefficient function may be applied to the transformed node embedding to determine a node correlation metric value of each neighbor graph node on the previous aggregation layer.
Fig. 6 illustrates an example flow diagram of a node relevance metric value determination process 600 according to embodiments of this specification.
As shown in fig. 6, each graph node and nodes of corresponding neighbor graph nodes updated via a previous aggregation layer are embedded and projected to a comparison space using a first weight coefficient matrix and a second weight coefficient matrix, respectively, at 610.
In some examples, the first weight coefficient matrix and the second weight coefficient matrix are weight coefficient matrices that may be learned based on a graph vector representation training process. For example, the first weight coefficient matrix and the second weight coefficient matrix may be adaptively adjusted through training. Specifically, in the current iteration process, after the graph vector representation is determined according to the message passing manner, prediction is performed based on the obtained graph vector representation to obtain a prediction result, and then a loss function is calculated based on the prediction result and the label. Then, the first weight coefficient matrix and the second weight coefficient matrix are dynamically adjusted in a back propagation manner based on the calculated loss function. The adjusted first and second weight coefficient matrices are further used to determine a current picture vector representation. The process is cycled through until a final vector representation of the graph is determined.
In some embodiments, the penalty function used in the graph vector representation learning process may be a cross-entropy based penalty function. The cross-entropy based loss function can be expressed, for example, as follows:
Figure BDA0003739272730000111
wherein the content of the first and second substances,
Figure BDA0003739272730000112
which represents the function of the loss(s),
Figure BDA0003739272730000113
representing a vector representation of the prediction map,
Figure BDA0003739272730000114
representing the corresponding label
Figure BDA0003739272730000115
And i represents a prediction map vector representation
Figure BDA0003739272730000121
The index of the vector element (logit) in (1). For example, assume a prediction graph vector representation
Figure BDA0003739272730000122
Is [0.3,0.1,0.2,0.5 ]]Then the prediction map vector representation
Figure BDA0003739272730000123
Contains 4 vector elements, i is used to index the vector elements. For example, if i =0, then the corresponding vector element is "0.3". If i =2, the corresponding vector element is "0.2".
At 620, a node relevance metric value for each neighbor graph node of each graph node at the current aggregation level is determined based on each graph node and the node embedding of the corresponding neighbor graph node projected into the comparison space.
Returning to fig. 3, after the node relevance metric values of the neighbor graph nodes of the graph nodes on the previous aggregation layer are obtained as described above, at 350, the target neighbor graph node of each graph node on the current aggregation layer is determined from the neighbor graph nodes of each graph node based on the determined node relevance metric values of each neighbor graph node.
In some embodiments, a path pruning policy for limiting the number of adjacent edges of a graph node may be used to determine a target neighbor graph node for each graph node at a current aggregation level based on a node relevance metric value for each neighbor graph node at a previous aggregation level for each graph node. For example, assume that a path pruning policy includes: the number of adjacent edges of each graph node is K. Here, K may also be referred to as a predetermined budget for defining the sample size of the graph nodes' neighbors. According to the path pruning strategy, the adjacent edges with the node correlation metric value of TopK are respectively selected (sampled) from the adjacent edges (single-hop message transmission paths) formed by each graph node and the neighbor graph nodes. For example, for the graph node 1 in fig. 5, assuming that K is 2, 2 adjacent edges with higher node correlation metric values are selected from the 3 adjacent edges of the graph node 1, and the adjacent edge with the worst node correlation metric value is cut off, thereby determining the target neighbor graph node. Optionally, the value of K is preferably 3.
After the target neighbor graph nodes of each graph node on the current aggregation layer are determined as described above, at 360, the node inlays for each graph node are updated based on each graph node and the updated node inlays for the corresponding target neighbor graph node via the previous aggregation layer.
In some embodiments, the node embedding of a graph node may be updated according to the following equation (2):
Figure BDA0003739272730000124
wherein the content of the first and second substances,
Figure BDA0003739272730000125
representing node embedding of graph node i on the l +1 st aggregation level,
Figure BDA0003739272730000126
representing node embedding of graph node i on the ith aggregation level,
Figure BDA0003739272730000127
representing a cascade operator, sigma is a non-linear activation function (e.g., reLu),
Figure BDA0003739272730000128
represents a set of nodes of a target neighbor graph,
Figure BDA0003739272730000129
representing the number of graph nodes in the target neighbor graph node set, j represents the neighbor graph node set
Figure BDA00037392727300001210
Of the neighbor graph node j in (1),
Figure BDA00037392727300001211
represents a node relevance metric between graph node i and neighbor graph node j at the aggregation level, an
Figure BDA00037392727300001212
Representing node embedding of the neighbor graph node j on the ith aggregation level.
In some embodiments, each aggregation layer may have a layer-sharing weight coefficient matrix. In some examples, the layer-sharing weight coefficient matrices of the respective aggregation layers are weight coefficient matrices that can be learned based on the graph vector representation training process, and each aggregation layer corresponds to one common layer-sharing weight coefficient matrix. For example, the adaptive adjustment layer may share the weight coefficient matrix through training. Specifically, in the current iteration process, after the graph vector representation is determined in the above-described message passing manner, prediction is performed based on the obtained graph vector representation to obtain a prediction result, and then a loss function is calculated based on the prediction result and the label. Then, the layer sharing weight coefficient matrix of each aggregation layer is dynamically adjusted in a back propagation manner based on the calculated loss function. The adjusted layer sharing weight coefficient matrix of each aggregation layer is further used to determine the current graph vector representation. The process is cycled through until a final vector representation of the graph is determined.
In the case where an aggregation layer has a layer-sharing weight coefficient matrix, the node embedding of each graph node may be updated based on the updated node embedding of the previous aggregation layer of each graph node and the corresponding target neighbor graph node and the layer-sharing weight coefficient matrix of the current aggregation layer.
For example, the node embedding of a graph node may be updated according to the following equation (3):
Figure BDA0003739272730000131
wherein the content of the first and second substances,
Figure BDA0003739272730000132
representing node embedding of graph node i on the l +1 st aggregation level,
Figure BDA0003739272730000133
representing node embedding of graph node i on the ith aggregation level,
Figure BDA0003739272730000134
representing a cascade operator, sigma is a non-linear activation function (e.g., reLu),
Figure BDA0003739272730000135
the layer sharing weight coefficient matrix of the l +1 th aggregation layer,
Figure BDA0003739272730000136
represents a set of nodes of a target neighbor graph,
Figure BDA0003739272730000137
representing the number of graph nodes in the target neighbor graph node set, j represents the neighbor graph node set
Figure BDA0003739272730000138
Of the neighbor graph node j in (a),
Figure BDA0003739272730000139
represents a node relevance metric between graph node i and neighbor graph node j at the aggregation level, an
Figure BDA00037392727300001310
Representing node embedding of the neighbor graph node j on the ith aggregation level.
After the update of the node embedding for each graph node of the current aggregation layer is completed in the above manner, it is determined whether the node embedding update is completed for all aggregation layers, at 370.
If there is a next aggregation layer that does not complete node embedding updates, then returning to 330, the node embedding update process described above is performed for that next aggregation layer.
If the node embedding updates described above are completed for all aggregation layers, then at 380, a graph vector representation of the graph structure data is generated based on the updated node embedding of each graph node in the graph structure data. The generated graph vector representation has the same vector dimensions as the vector dimensions of the node embedding of each graph node.
In some embodiments, a graph vector representation of graph structure data may be generated based on initial node embedding and updated node embedding of individual graph nodes in the graph structure data.
Fig. 7 illustrates an example flow diagram of a graph vector representation generation process 700 according to embodiments of this specification.
As shown in FIG. 7, at 710, initial node embedding for each graph node in the graph structure data is cascaded with corresponding updated node embedding.
After the node embedding cascade is completed for each graph node, the cascaded node embedding of each graph node is provided to the shallow MLP network at 720, and the MLP processed node embedding of each graph node is obtained.
At 730, the MLP processed node embedding averages for each graph node to generate a graph vector representation of the graph structure data.
FIG. 8 illustrates an example schematic diagram of a graph vector representation generation process in accordance with an embodiment of the present description.
As shown in FIG. 8, the graph structure data includes N graph nodes, each graph node having an initial node embedding and an updated node embedding. And aiming at each graph node, embedding the initial node into the updated node embedding cascade, and then providing the node embedding cascade to a shallow MLP layer to obtain the node embedding processed by MLP. Then, the nodes after MLP processing of each graph node are embedded and averaged to obtain a graph vector representation of graph structure data.
The graph vector representation generation process shown in FIG. 8 may be represented as a READOUT operation as shown by the following equation:
Figure BDA0003739272730000141
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003739272730000142
is a graph vector representation, MEAN () represents the averaging operation, X 0 An initial node embedding matrix representing graph structure data, and H L Representing the updated node embedding matrix output by the graph neural network.
The above-described node embedding update process will be described below in conjunction with the graph structure data shown in fig. 1.
Assume that the graph neural network includes 4 aggregation layers, i.e., aggregation layer 1 through aggregation layer 4. Firstly, providing the respective node description information of the graph nodes 1 to 8 to the GTransformer model respectively to obtain the initial node embedding of the graph nodes 1 to 8
Figure BDA0003739272730000143
To
Figure BDA0003739272730000144
After the characteristic information is propagated according to a preset propagation rule, the obtained initial node is embedded
Figure BDA0003739272730000145
To
Figure BDA0003739272730000146
And respectively propagating to corresponding neighbor nodes according to respective message propagation paths for aggregation processing on the aggregation layer 1. Taking fig. node 5 as an example, when aggregation processing is performed on aggregation layer 1, fig. node 5 receives initial node embedding propagated by fig. node 1, fig. node 3, fig. node 4, fig. node 6, and fig. node 7
Figure BDA0003739272730000147
Figure BDA0003739272730000148
And
Figure BDA0003739272730000149
then, on aggregation layer 1, initial node embedding based on graph nodes 5, respectively
Figure BDA00037392727300001410
And initial node embedding for graph node 1, graph node 3, graph node 4, graph node 6, and graph node 7 propagation
Figure BDA00037392727300001411
And
Figure BDA00037392727300001412
a node relevance metric value at aggregation level 0 between graph node 5 and graph node 1, graph node 3, graph node 4, graph node 6 and graph node 7 is determined (i.e.,
Figure BDA00037392727300001413
and
Figure BDA00037392727300001414
). Subsequently, a target neighbor graph node is determined based on the determined node relevance metric value, e.g., assuming the target neighbor graph node is determined to be graph node 1 and graph node 4, initial node embedding using graph node 1
Figure BDA0003739272730000151
Initial node embedding for graph node 4
Figure BDA0003739272730000152
And initial node embedding of graph node 5
Figure BDA0003739272730000153
Determining node embedding of graph node 5 on aggregation layer 1
Figure BDA0003739272730000154
Determined node embedding
Figure BDA0003739272730000155
Is propagated to graph nodes 1, 3, 4, 6, and 7 for graph nodes 1, 3, 4, 6, and 7 to perform node-embedded updates at aggregation layer 2. When aggregation processing is performed on the aggregation layer 2, the graph node 5 receives the updated node embedding propagated via the aggregation layer 1 from the graph nodes 1, 3, 4, 6, and 7
Figure BDA0003739272730000156
And
Figure BDA0003739272730000157
then, on the aggregation layer 2, node embedding based on the graph nodes 5, respectively
Figure BDA0003739272730000158
And node embedding for graph node 1, graph node 3, graph node 4, graph node 6, and graph node 7 propagation
Figure BDA0003739272730000159
And
Figure BDA00037392727300001510
a node relevance metric value at aggregation level 1 between graph node 5 and graph node 1, graph node 3, graph node 4, graph node 6, and graph node 7 is determined (i.e.,
Figure BDA00037392727300001511
and
Figure BDA00037392727300001512
). Subsequently, a target neighbor graph node is determined based on the determined node relevance metric value, e.g., assuming the target neighbor graph node is determined to be graph node 4 and graph node 6, node embedding using graph node 4
Figure BDA00037392727300001513
Node embedding for node 5 of a graph
Figure BDA00037392727300001514
And node embedding of figure node 6
Figure BDA00037392727300001515
Determining node embedding of graph node 5 on aggregation layer 2
Figure BDA00037392727300001516
Determined node embedding
Figure BDA00037392727300001517
Is propagated to the graph nodes 1, 3, 4, 6, and 7 for the graph nodes 1, 3, 4, 6, and 7 to perform the node-embedded update at the aggregation layer 3. This is similar until the node embedding update of aggregation layer 4 is completed.
The diagram vector representation generation process according to the embodiments of the present specification is generally described above with reference to the drawings. In some embodiments, for each aggregation layer, node-embedded updates may be performed as a whole, or per graph node.
FIG. 9 illustrates an example flow diagram of a method 900 for generating a graph vector representation of graph structure data according to another embodiment of this description. In the example shown in fig. 9, node-embedded updates are performed in their entirety.
As shown in FIG. 9, at 910, a complete adjacency matrix of the graph structure data is constructed according to the edge connection information in the graph structure data, and the constructed complete adjacency matrix reflects the overall link relationship of each graph node in the graph structure data.
At 920, initial node embeddings for respective graph nodes are generated based on the node description information for the respective graph nodes in the graph structure data.
Then, the initial node embedding and the complete adjacency matrix of each graph node are provided for the graph neural network, and the node embedding updating process is executed by each aggregation layer in the graph neural network layer by layer until the node embedding updating of all the aggregation layers is completed. That is, from the first aggregation layer of the graph neural network, operations 930 through 970 are performed in a loop, layer-by-layer manner, until the node embedding update of the last aggregation layer is completed.
Specifically, during each cycle, at 930, a layer-by-layer adjacency matrix for the current aggregation layer is constructed based on the full adjacency matrix, the constructed layer-by-layer adjacency matrix being used to indicate neighboring graph nodes of respective graph nodes on the current aggregation layer. The rows of the layer-by-layer adjacency matrix are the individual graph nodes in the current aggregation layer, and the columns of the layer-by-layer adjacency matrix are the individual graph nodes in the previous aggregation layer. In the layer-by-layer adjacency matrix, if a linking edge exists between two graph nodes, the corresponding element in the layer-by-layer adjacency matrix is assigned to 1, and the graph nodes in the columns are considered as neighbor graph nodes of the graph nodes in the rows. Otherwise, it is assigned a value of 0 and the graph nodes in the column are considered not to be neighbor graph nodes of the graph nodes in the row.
For example, a row filter matrix may be defined
Figure BDA0003739272730000161
Sum column filter matrix
Figure BDA0003739272730000162
To select a row or column from a fully contiguous matrix, wherein,
Figure BDA0003739272730000163
a set of sampled graph nodes representing the ith aggregation layer, an
Figure BDA0003739272730000164
A set of neighbor graph nodes representing the ith aggregation layer. Simply put, with
Figure BDA0003739272730000165
The left multiplication can be considered as selecting the graph node (sampling graph node) of the current aggregation layer from the adjacency matrix A, and
Figure BDA0003739272730000166
the occupation means that a neighbor node (neighbor graph node) of the current aggregation layer is selected.Taking the column filter matrix as an example,
Figure BDA0003739272730000167
is unfolded into
Figure BDA0003739272730000168
Wherein e is i ∈{0,1} N×1 And, and
Figure BDA0003739272730000169
in particular, the present invention relates to a method for producing,
Figure BDA00037392727300001610
serves as a location indicator and identifies the ith graph node location of the l-th layer in the full adjacency matrix a. For example, in the case of a liquid,
Figure BDA00037392727300001611
meaning that the first graph node is located in the second row (node 2) of the fully contiguous matrix a. In this specification, a column filter matrix
Figure BDA00037392727300001612
The same logic is followed to filter out the neighbor nodes of the graph node. Thus, the layer-by-layer adjacency matrix
Figure BDA00037392727300001613
Can be expressed as:
Figure BDA00037392727300001614
further, it is assumed that the node embedding matrix of all the graph nodes of the l-th layer is represented as
Figure BDA00037392727300001615
Then
Figure BDA00037392727300001616
And
Figure BDA00037392727300001617
wherein the content of the first and second substances,
Figure BDA00037392727300001618
a node embedding matrix representing nodes of the sampling graph at the l-th aggregation level, an
Figure BDA00037392727300001619
And representing the node embedding matrix of the neighbor graph nodes on the ith aggregation layer. Further, H 0 =X 0 Which represents the initial node embedding matrix for all graph nodes.
At 940, a node correlation metric matrix on the current aggregation layer is determined according to the node embedding matrix of the sampling graph node on the previous aggregation layer, the node embedding matrix of the neighbor graph node on the previous aggregation layer, and the layer-by-layer adjacency matrix, where the determined node correlation metric matrix is used to indicate the node correlation metric value of the neighbor graph node of each graph node on the current aggregation layer.
At 950, a path pruning (message passing path pruning) is performed on the node relevance metric matrix based on the determined node relevance metric values in the node relevance metric matrix. In the node-dependency metric matrix, each row corresponds to a graph node. For example, topK elements may be selected from the row of elements in the node-correlation metric matrix, and all elements having non-zero values except the selected TopK elements are assigned to zero, so that the messaging path corresponding to the element is pruned. And non-zero elements in each row of elements of the node correlation metric matrix after path pruning respectively indicate target neighbor graph nodes corresponding to the graph nodes.
For example, the path pruning may be performed on the node correlation metric matrix of the current aggregation layer as follows to determine the node correlation metric matrix of the current aggregation layer after the path pruning:
Figure BDA0003739272730000171
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003739272730000172
represents a node correlation metric matrix of the aggregation level after the path pruning treatment, delta (-) represents a correlation coefficient function, and is used for quantifying the correlation metric between each graph node of the aggregation level and different neighbor graph nodes,
Figure BDA0003739272730000173
and
Figure BDA0003739272730000174
is two learnable weight coefficient matrices, (-) is a hadamard product operator used to hold graph node pairs with adjacent edges, and Φ (-) is a policy function for defining a path pruning policy for limiting the number of adjacent edges of a graph node, i.e., the defined path pruning policy is used to define a predetermined budget for the sample size of the graph node's neighbor graph nodes. With this policy function Φ (·), the computational complexity can be easily limited. In this description, the policy function Φ (-) can be defined, for example, to implement top (K,) row by row, i.e., at the calculated
Figure BDA0003739272730000175
Selects the number of TopK with the maximum node correlation metric value in each row, thereby selecting K target adjacent edges. And after K target adjacent edges are selected, assigning the node correlation metric values corresponding to other adjacent edges in the line to be 0, thereby realizing the path pruning processing. Here, K may also be referred to as a sampling budget. Preferably, the value of K is chosen to be 3. Determined
Figure BDA0003739272730000176
Element (1) of
Figure BDA0003739272730000177
A node relevance metric value at the i-th aggregation level between graph node i and graph node j is represented. By this approach, the graph node vector can be updated to the maximum extent using the least neighbor graph node information.
In the above embodiments, node embedding is replaced for graph nodes
Figure BDA0003739272730000178
Node embedding with neighbor graph nodes
Figure BDA0003739272730000179
Directly applying correlation coefficient function, using two learnable weight coefficient matrixes
Figure BDA00037392727300001710
And
Figure BDA00037392727300001711
to perform a further linear transformation to embed the nodes of the graph node
Figure BDA00037392727300001712
And node embedding of neighbor graph nodes
Figure BDA00037392727300001713
Projected into the comparison space (embedding space), respectively, and then a correlation coefficient function is applied to the node embedding projected into the comparison space to determine a node correlation metric. For example, the node relevance metric value is determined by performing a specified operation (e.g., a dot product multiplication, a normalized cosine or distance based operation, etc.). In other embodiments, the weighting coefficient matrix may not be used
Figure BDA00037392727300001714
And
Figure BDA00037392727300001715
at 960, the node embedding of each graph node on the current aggregation level is updated based on the node relevance metric matrix after path pruning. Specifically, the node embedding of each graph node on the current aggregation layer is updated based on the node embedding of each graph node and the corresponding target neighbor graph node on the previous aggregation layer and the node correlation metric matrix after path pruning.
For example, in one example, the node embedding of a graph node on the l +1 aggregation level may be updated according to the following formula:
Figure BDA0003739272730000181
wherein the content of the first and second substances,
Figure BDA0003739272730000182
representing node embedding of graph node i on the l +1 st aggregation level,
Figure BDA0003739272730000183
representing node embedding of graph node i at the ith aggregation level,
Figure BDA0003739272730000184
representing a cascade operator, sigma is a non-linear activation function (e.g., reLu),
Figure BDA0003739272730000185
the layer sharing weight coefficient matrix of the l +1 th aggregation layer,
Figure BDA0003739272730000186
represents a set of nodes of a target neighbor graph,
Figure BDA0003739272730000187
representing the number of graph nodes in the target neighbor graph node set, j represents the neighbor graph node set
Figure BDA0003739272730000188
Of the neighbor graph node j in (a),
Figure BDA0003739272730000189
a node relevance metric value at the aggregation level between graph node i and neighbor graph node j, an
Figure BDA00037392727300001810
Representing node embedding of neighbor graph node j on the ith aggregation level.
After the node embedding update for the current aggregation layer is completed as above, at 970, it is determined whether the node embedding update is completed for all aggregation layers. If there is an aggregation layer for which node embedding updates are not complete, then returning to 930, the above-described node embedding update process is performed for that aggregation layer.
If the above-described node embedding updates are completed for all aggregation layers, then at 980, a graph vector representation of the graph structure data is generated based on the updated node embedding of each graph node in the graph structure data. The graph vector representation generation process may refer to the operations described above with reference to 380 of FIG. 3.
FIG. 10 illustrates an example flow diagram of a method 1000 for generating a graph vector representation of graph structure data according to another embodiment of this description. In the example shown in fig. 10, node-embedded updates are performed per graph node.
As shown in FIG. 10, at 1010, initial node embeddings for respective graph nodes are generated based on node description information for the respective graph nodes in the graph structure data.
After the initial node embedding of each graph node in the graph structure data is generated as above, the initial node embedding of each graph node is provided for the graph neural network, and the node embedding updating process is executed layer by each aggregation layer in the graph neural network until the node embedding updating of all aggregation layers is completed. As shown in fig. 10, operations 1020 through 1060 are performed in a loop until all node-embedded updates for the aggregation layer are completed.
Specifically, in each loop process, at 1020, neighbor graph nodes of each graph node in the current aggregation layer are obtained from the graph structure data, and adjacent edges between each graph node and the corresponding neighbor graph nodes form a single-hop message transmission path of the graph node.
After the neighbor graph nodes of each graph node in the current aggregation layer are obtained as described above, at 1030, a node relevance metric value of each neighbor graph node of each graph node on the previous aggregation layer is determined according to each graph node and the node embedding of the corresponding neighbor graph node updated by the previous aggregation layer.
After the node relevance metric value of each neighbor graph node of each graph node on the previous aggregation layer is obtained as described above, at 1040, a target neighbor graph node of each graph node on the current aggregation layer is determined from the neighbor graph nodes of each graph node based on the node relevance metric value of each neighbor graph node of each graph node on the previous aggregation layer, so that path pruning of a single-hop message transfer path for each graph node is realized.
After the target neighbor graph nodes of each graph node on the current aggregation layer are determined as described above, at 1050, based on each graph node and the updated node embedding of the corresponding target neighbor graph node via the previous aggregation layer, the node embedding of each graph node is updated, and the node embedding is output on the current aggregation layer as each graph node.
After the node embedding completion update of each graph node is completed for the current aggregation layer in the above manner, at 1060, it is determined whether the node embedding update is completed for all aggregation layers.
If there is an aggregation layer that does not complete node embedding updates, then returning to 1020, the above-described node embedding update process is performed for the next aggregation layer.
If the above-described node embedding updates are completed for all aggregation layers, then at 1070, a graph vector representation of the graph structure data is generated based on the updated node embedding of each graph node in the graph structure data.
The diagram vector representation generation method according to the embodiment of the present specification is described above with reference to fig. 1 to 10.
By using the graph vector representation generation method, when each layer of aggregation layer is aggregated, the importance of all neighbor nodes of each graph node is quantized recursively, so that the locality of the graph node can be better described, and the neighbor nodes are sampled according to the importance level. And then, learning the node embedding of the graph node based on the sampled neighbor nodes, thereby reducing the calculation amount and the calculation complexity in the node embedding updating process, further improving the node embedding updating efficiency, and simultaneously ensuring that the learned node embedding can accurately reflect the local or overall network topology information of the graph structure data. Then, a graph vector representation of the graph structure data is obtained based on the obtained node embedding of each graph node, so that the obtained graph vector representation of the graph structure data can accurately describe the overall network topology information of the graph structure data.
Using the above-described graph vector representation generation method, two learnable weight coefficient matrices are used
Figure BDA0003739272730000191
And
Figure BDA0003739272730000192
to perform a further linear transformation to embed the nodes of the graph node
Figure BDA0003739272730000193
And node embedding of neighbor graph nodes
Figure BDA0003739272730000194
And by adaptively adjusting the two learnable weight coefficient matrixes in the graph vector representation learning process, the importance of the graph nodes can be adaptively adjusted according to the change of the gradient towards the minimum loss, so that the obtained graph vector representation of the graph structure data more accurately describes the overall network topology information of the graph structure data.
By using the graph vector representation generation method, the layer sharing weight coefficient matrix of the aggregation layer is introduced when the node embedding updating is carried out, so that the updated node embedding more accurately describes the overall network topology information of the graph structure data.
FIG. 11 illustrates an example block diagram of a graph vector representation generation apparatus 1100 in accordance with an embodiment of this specification. As shown in fig. 11, the graph vector representation generating apparatus 1100 includes an initial node embedding generating unit 1110, a full adjacency matrix constructing unit 1120, a node embedding updating unit 1130, and a graph vector representation generating unit 1140.
The initial node embedding generation unit 1110 is configured to generate initial node embedding of each graph node based on node description information in the graph structure data. The operation of the initial node embedding generating unit 1110 may refer to the operation described above with reference to 310 of fig. 3.
The full adjacency matrix construction unit 1120 is configured to construct a full adjacency matrix of the graph structure data according to the edge connection information in the graph structure data. The operation of the full adjacency matrix building unit 1120 may refer to the operation described above with reference to 320 of fig. 3.
The node embedding update unit 1130 is configured to provide the initial node embedding and the full adjacency matrix of each graph node to the graph neural network to perform a node embedding update process layer by layer to obtain an updated node embedding of each graph node. When performing node embedding update on each aggregation layer, for each graph node, the node embedding update unit 1130 determines, based on the node correlation metric value of the neighbor node of the graph node on the previous aggregation layer, a target neighbor graph node on the aggregation layer from the neighbor graph nodes of the graph node, and performs node embedding update using the graph node and the node embedding of the corresponding target neighbor graph node updated via the previous aggregation layer. The operation of the node-embedded update unit 1130 may refer to the operations described above with reference to 330-370 of FIG. 3.
The graph vector representation generation unit 1140 is configured to generate a graph vector representation of the graph structure data based on the updated node embedding of each graph node in the graph structure data. The operation of the graph vector representation generation unit 1140 may refer to the operation described above with reference to 380 of fig. 3.
Fig. 12 illustrates an example block diagram of a node embedded update unit 1200 in accordance with an embodiment of this specification. As shown in fig. 12, the node-embedding updating unit 1200 includes a neighbor graph node determining module 1210, a node correlation determining module 1220, a target neighbor graph node determining module 1230, and a node-embedding updating module 1240.
In performing the node embedding update, the neighbor graph node determining module 1210, the node correlation determining module 1220, the target neighbor graph node determining module 1230, and the node embedding update module 1240 are configured to perform the node embedding update process layer by layer from the first aggregation layer of the graph neural network until the node embedding update operation for all aggregation layers is completed, thereby obtaining the node embedding of each graph node output by the graph neural network.
In particular, the neighbor graph node determination module 1210 is configured to determine neighbor graph nodes of respective graph nodes on a current aggregation layer according to a full adjacency matrix. The operations of the neighbor graph node determination module 1210 may refer to the operations described above with reference to 330 of fig. 3.
The node relevance determination module 1220 is configured to determine a node relevance metric value for each neighbor graph node of each graph node at a previous aggregation layer according to the updated node embedding of each graph node and the corresponding neighbor graph node via the previous aggregation layer. The operations of the node relevance determining module 1220 may refer to the operations described above with reference to 340 of fig. 3.
The target neighbor graph node determination module 1230 is configured to determine a target neighbor graph node for each graph node at the current aggregation level from the neighbor graph nodes of each graph node based on the determined node relevance metric values for the neighbor graph nodes. The operation of the target neighbor graph node determination module 1230 may refer to the operation described above with reference to 350 of fig. 3.
In one example, the target neighbor graph node determining module 1230 may be configured to determine the target neighbor graph node for each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes using a path pruning policy for limiting a number of adjacent edges of the graph node.
Node embedding update module 1240 is configured to update the node embedding for each graph node based on the updated node embedding for each graph node and the corresponding target neighbor graph node via the previous aggregation layer.
In one example, each aggregation layer has a layer-sharing weight coefficient matrix. Node embedding update module 1240 may update the node embedding for each graph node based on the updated node embedding for each graph node and the corresponding target neighbor graph node via the previous aggregation layer and the layer-sharing weight coefficient matrix for the current aggregation layer.
Fig. 13 illustrates an example block diagram of a node relevance determination module 1300 in accordance with embodiments of the present description. As shown in fig. 13, the node relevance determination module 1300 includes a node embedding projection sub-module 1310 and a node relevance determination sub-module 1320.
The node embedding projection submodule 1310 is configured to embed and project the updated nodes of the respective graph nodes and the corresponding neighbor graph nodes via the previous aggregation layer to the comparison space using the first weight coefficient matrix and the second weight coefficient matrix, respectively. The operation of the projection sub-module 1310 may refer to the operation described above with reference to 610 of FIG. 6.
The node relevance determination sub-module 1320 is configured to determine a node relevance metric value for each neighbor graph node of each graph node on a previous aggregation level based on the node embedding of each graph node and the corresponding neighbor graph nodes projected into the comparison space. The operations of the node relevance metric determining submodule 1320 may refer to the operations described above with reference to 620 of fig. 6.
In some embodiments, the graph vector representation generation unit 1140 may generate the graph vector representation of the graph structure data based on the initial node embedding and the updated node embedding of the respective graph nodes in the graph structure data.
Fig. 14 illustrates an example block diagram of a graph vector representation generation unit 1400 in accordance with an embodiment of this specification. As shown in fig. 14, the graph vector representation generation unit 1400 includes a node embedding cascade module 1410, an MLP processing module 1420, and a graph vector representation generation module 1430.
The node embedding cascade module 1410 is configured to embed an initial node of each graph node in the graph structure data in a cascade with a corresponding updated node, respectively. The operation of the node embedding cascade module 1410 may refer to the operation described above with reference to 710 of fig. 7.
The MLP processing module 1420 is configured to provide the concatenated node embeddings of each graph node in the graph structure data to the shallow MLP network, resulting in MLP processed node embeddings of each graph node in the graph structure data. The operation of MLP processing module 1420 may refer to the operation described above with reference to 720 of fig. 7.
The graph vector representation generation module 1430 is configured to average the MLP processed node embedding of each graph node in the graph structure data to generate a graph vector representation of the graph structure data. The operations of the graph vector representation generation module 1430 may refer to the operations described above with reference to 730 of FIG. 7.
FIG. 15 illustrates an example block diagram of a node-embedded update unit 1500 according to another embodiment of this description. As shown in fig. 15, the node-embedded updating unit 1500 includes a layer-by-layer adjacency matrix construction module 1510, a node correlation determination module 1520, a path pruning module 1530, and a node-embedded updating module 1540.
The layer-by-layer adjacency matrix construction module 1510 is configured to construct a layer-by-layer adjacency matrix for the current aggregation layer based on the full adjacency matrix, the constructed layer-by-layer adjacency matrix indicating neighboring graph nodes of the respective graph nodes on the current aggregation layer. The operation of layer-by-layer adjacency matrix building module 1510 may refer to the operation described above with reference to 930 of fig. 9.
The node relevance determination module 1520 is configured to determine a node relevance metric matrix on a current aggregation layer from the updated node embedding matrix via a previous aggregation layer and the layer-by-layer adjacency matrix of each graph node and the corresponding neighbor graph nodes, the node relevance metric matrix indicating node relevance metric values of neighbor graph nodes of each graph node on the previous aggregation layer. The operation of the node relevance determination module 1520 may refer to the operation described above with reference to 940 of fig. 9.
The path pruning module 1530 is configured to perform path pruning based on the node correlation metric matrix, where the node correlation metric matrix after the path pruning is used to indicate a target neighbor graph node of each graph node on the current aggregation layer. The operation of the path pruning module 1530 may refer to the operation described above with reference to 950 of fig. 9.
The node embedding update module 1540 is configured to update the node embedding for each graph node based on the updated node embedding for each graph node and the corresponding target neighbor graph node via the previous aggregation layer and the node correlation metric matrix after path pruning. The operation of the node-embedded update module 1540 may refer to the operation described above with reference to 960 of fig. 9.
As described above with reference to fig. 1 to 15, the diagram vector representation generation method and the diagram vector representation generation apparatus according to the embodiment of the present specification are described. The above figure vector representation generating means may be implemented in hardware, or may be implemented in software, or a combination of hardware and software.
Fig. 16 illustrates an example schematic diagram of a graph vector representation generation apparatus 1600 implemented based on a computer system according to an embodiment of this specification. As shown in fig. 16, the diagram vector representation generating device 1600 may include at least one processor 1610, a memory (e.g., non-volatile memory) 1620, a memory 1630, and a communication interface 1640, and the at least one processor 1610, the memory 1620, the memory 1630, and the communication interface 1640 are connected together via a bus 1660. The at least one processor 1610 executes at least one computer-readable instruction (i.e., the elements described above as being implemented in software) stored or encoded in memory.
In one embodiment, computer-executable instructions are stored in the memory that, when executed, cause the at least one processor 1610 to: generating initial node embedding of each graph node based on node description information in the graph structure data; constructing a complete adjacency matrix of the graph structure data according to the edge connection information in the graph structure data; providing the initial node embedding and the complete adjacency matrix of each graph node to a graph neural network to execute a node embedding updating process layer by layer so as to obtain updated node embedding of each graph node; and generating graph vector representation of the graph structure data based on the updated node embedding of each graph node in the graph structure data, wherein when node embedding updating is carried out on each aggregation layer, for each graph node, a target neighbor graph node of the graph node is determined based on a node correlation metric value of the neighbor graph node on a previous aggregation layer, and node embedding updating is carried out by using the graph node and the node embedding of the corresponding target neighbor graph node updated through the previous aggregation layer.
It should be appreciated that the computer-executable instructions stored in the memory, when executed, cause the at least one processor 1610 to perform the various operations and functions described above in connection with fig. 1-15 in the various embodiments of the present description.
According to one embodiment, a program product, such as a machine-readable medium (e.g., a non-transitory machine-readable medium), is provided. A machine-readable medium may have instructions (i.e., elements described above as being implemented in software) that, when executed by a machine, cause the machine to perform various operations and functions described above in connection with fig. 1-15 in the various embodiments of the present specification. Specifically, a system or apparatus may be provided which is provided with a readable storage medium on which software program code implementing the functions of any of the above embodiments is stored, and causes a computer or processor of the system or apparatus to read out and execute instructions stored in the readable storage medium.
In this case, the program code itself read from the readable medium can realize the functions of any of the above-described embodiments, and thus the machine-readable code and the readable storage medium storing the machine-readable code form part of the present invention.
Examples of the readable storage medium include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-Rs, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs), magnetic tapes, nonvolatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or from the cloud via a communications network.
According to one embodiment, a computer program product is provided that includes a computer program that, when executed by a processor, causes the processor to perform various operations and functions described above in connection with fig. 1-15 in various embodiments of the present specification.
It will be understood by those skilled in the art that various changes and modifications may be made in the above-disclosed embodiments without departing from the spirit of the invention. Accordingly, the scope of the invention should be determined from the following claims.
It should be noted that not all steps and units in the above flows and system structure diagrams are necessary, and some steps or units may be omitted according to actual needs. The execution order of the steps is not fixed, and can be determined as required. The apparatus structures described in the above embodiments may be physical structures or logical structures, that is, some units may be implemented by the same physical entity, or some units may be implemented by a plurality of physical entities, or some units may be implemented by some components in a plurality of independent devices.
In the above embodiments, the hardware units or modules may be implemented mechanically or electrically. For example, a hardware unit, module or processor may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware units or processors may also include programmable logic or circuitry (e.g., a general purpose processor or other programmable processor) that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
The detailed description set forth above in connection with the appended drawings describes exemplary embodiments but does not represent all embodiments that may be practiced or fall within the scope of the claims. The term "exemplary" used throughout this specification means "serving as an example, instance, or illustration," and does not mean "preferred" or "advantageous" over other embodiments. The detailed description includes specific details for the purpose of providing an understanding of the described technology. However, the techniques may be practiced without these specific details. In some instances, well-known structures and devices are shown in block diagram form in order to avoid obscuring the concepts of the described embodiments.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (22)

1. A method for generating a graph vector representation of graph structure data, comprising:
generating initial node embedding of each graph node based on node description information in the graph structure data;
constructing a complete adjacency matrix of the graph structure data according to the edge connection information in the graph structure data;
providing the initial node embedding of each graph node and the complete adjacency matrix to a graph neural network to iteratively execute a node embedding updating process layer by layer so as to obtain updated node embedding of each graph node; and
generating a graph vector representation of the graph structure data based on the updated node embedding of each graph node,
when node embedding updating is carried out on each aggregation layer, a target neighbor graph node of the graph node is determined for each graph node based on a node correlation metric value of the neighbor graph node on the previous aggregation layer, and the graph node and the node embedding updating which is updated through the previous aggregation layer and corresponds to the target neighbor graph node are used for carrying out node embedding updating.
2. The method of claim 1, wherein providing the initial node embedding of each graph node and the full adjacency matrix to a graph neural network to iteratively perform node embedding updates layer-by-layer to obtain updated node embedding of each graph node comprises:
determining neighbor graph nodes of all graph nodes on the current aggregation layer according to the complete adjacency matrix;
determining a node correlation metric value of each neighbor graph node of each graph node on a previous aggregation layer according to each graph node and node embedding of the neighbor graph node after updating through the previous aggregation layer;
determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes; and
updating the node embedding of each graph node based on each graph node and the updated node embedding of the corresponding target neighbor graph node via the previous aggregation layer.
3. The method of claim 2, wherein determining the node relevance metric value at a previous aggregation level for each neighbor graph node of each graph node based on updated node embedding of each graph node and corresponding neighbor graph nodes via the previous aggregation level comprises:
embedding and projecting each graph node and the updated nodes of the corresponding neighbor graph nodes through the previous aggregation layer to a comparison space by using a first weight coefficient matrix and a second weight coefficient matrix respectively; and
determining a node relevance metric value of each neighbor graph node of each graph node on the previous aggregation layer according to each graph node and the node embedding of the corresponding neighbor graph node projected to the comparison space.
4. The method of claim 3, wherein the first and second weight coefficient matrices are weight coefficient matrices that are learnable based on a graph vector representation training process.
5. The method of claim 2, wherein determining a target neighbor graph node for each graph node at the current aggregation level from the neighbor graph nodes of each graph node based on the determined node relevance metric values for the neighbor graph nodes comprises:
determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node relevance metric values of the neighbor graph nodes by using a path pruning strategy, wherein the path pruning strategy is used for limiting the number of adjacent edges of the graph nodes.
6. The method of claim 2, wherein updating the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding target neighbor graph node via the previous aggregation layer comprises:
updating the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding target neighbor graph node via the previous aggregation layer and the layer sharing weight coefficient matrix of the current aggregation layer.
7. The method of claim 6, wherein the layer-sharing weight coefficient matrix of each aggregation layer is a weight coefficient matrix learnable by a training process based on a graph vector representation.
8. The method of claim 1, wherein the node embedding update procedure comprises:
constructing a layer-by-layer adjacency matrix of the current aggregation layer based on the complete adjacency matrix, wherein the layer-by-layer adjacency matrix is used for indicating neighbor graph nodes of all graph nodes on the current aggregation layer;
determining a node correlation metric matrix on the previous aggregation layer according to the updated node embedding matrix of each graph node and the corresponding neighbor graph node through the previous aggregation layer and the layer-by-layer adjacency matrix, wherein the node correlation metric matrix is used for indicating a node correlation metric value of the neighbor graph node of each graph node on the previous aggregation layer;
performing path pruning based on the node correlation metric matrix, wherein the node correlation metric matrix after path pruning is used for indicating target neighbor graph nodes of all graph nodes on the current aggregation layer; and
and updating the node embedding of each graph node based on the node embedding of each graph node and the corresponding target neighbor graph node after updating through the previous aggregation layer and the node correlation measurement matrix after path pruning.
9. The method of claim 1 or 8, wherein generating the graph vector representation of the graph structure data based on the updated node embedding of the respective graph node comprises:
generating a graph vector representation of the graph structure data based on the initial node embedding and the updated node embedding of each graph node.
10. The method of claim 9, wherein generating the graph vector representation of the graph structure data based on the initial node embedding and the updated node embedding of the respective graph nodes comprises:
embedding the initial nodes of all graph nodes into the corresponding updated nodes respectively;
providing the cascaded node embedding of each graph node to a shallow MLP network to obtain the node embedding of each graph node after MLP processing; and
and embedding and averaging the nodes subjected to MLP processing of each graph node to generate graph vector representation of the graph structure data.
11. The method of any of claims 1 to 10, wherein the node relevance metric value comprises one of the following relevance metric values:
a correlation metric value based on a dot product;
a correlation metric value based on the normalized cosine;
a distance-based correlation metric.
12. An apparatus for generating a graph vector representation of graph structure data, comprising:
an initial node embedding generation unit which generates initial node embedding of each graph node based on the node description information in the graph structure data;
a complete adjacency matrix construction unit which constructs a complete adjacency matrix of the graph structure data according to the edge connection information in the graph structure data;
the node embedding updating unit is used for providing the initial node embedding of each graph node and the complete adjacency matrix to the graph neural network to iteratively execute a node embedding updating process layer by layer so as to obtain updated node embedding of each graph node; and
a graph vector representation generating unit that generates a graph vector representation of the graph structure data based on the updated node embedding of each graph node,
when each aggregation layer carries out node embedding updating, aiming at each graph node, the node embedding updating unit determines a target neighbor graph node of the graph node based on a node correlation metric value of the neighbor graph node on a previous aggregation layer, and carries out node embedding updating by using the graph node and the node embedding of the corresponding target neighbor graph node which is updated by the previous aggregation layer.
13. The apparatus of claim 12, wherein the node embedding update unit comprises:
the neighbor graph node determining module is used for determining neighbor graph nodes of all graph nodes on the current aggregation layer according to the complete adjacency matrix;
the node correlation determination module is used for determining a node correlation metric value of each neighbor graph node of each graph node on a previous aggregation layer according to each graph node and the node embedding of the neighbor graph node after being updated by the previous aggregation layer;
the target neighbor graph node determining module is used for determining a target neighbor graph node of each graph node on the current aggregation layer from the neighbor graph nodes of each graph node based on the determined node correlation metric value of the neighbor graph node; and
and the node embedding updating module updates the node embedding of each graph node based on each graph node and the node embedding of the corresponding target neighbor graph node after being updated by the previous aggregation layer.
14. The apparatus of claim 13, wherein the node relevance determining module comprises:
the node embedding projection submodule is used for embedding and projecting each graph node and the updated nodes of the corresponding neighbor graph nodes through the previous aggregation layer to a comparison space by using a first weight coefficient matrix and a second weight coefficient matrix respectively; and
and the node correlation determination submodule determines the node correlation metric value of each neighbor graph node of each graph node on the previous aggregation layer according to each graph node and the node embedding of the corresponding neighbor graph node projected to the comparison space.
15. The apparatus of claim 13, wherein the target neighbor graph node determining module determines the target neighbor graph node for each graph node from the neighbor graph nodes of each graph node based on the determined node relevance metric values for the neighbor graph nodes using a path pruning policy for limiting a number of adjacent edges of the graph node.
16. The apparatus of claim 13, wherein the node embedding update module updates node embedding for each graph node based on updated node embedding for each graph node and corresponding target neighbor graph nodes via the previous aggregation layer and a layer sharing weight coefficient matrix for the current aggregation layer.
17. The apparatus of claim 12, wherein the node embedding update unit comprises:
a layer-by-layer adjacency matrix construction module, which constructs a layer-by-layer adjacency matrix of the current aggregation layer based on the complete adjacency matrix, wherein the layer-by-layer adjacency matrix is used for indicating neighbor graph nodes of all graph nodes on the current aggregation layer;
a node correlation determination module, configured to determine a node correlation metric matrix on the current aggregation layer according to the node embedding matrix updated by the previous aggregation layer and the layer-by-layer adjacency matrix of each graph node and the corresponding neighbor graph node, where the node correlation metric matrix is used to indicate a node correlation metric value of the neighbor graph node of each graph node on the previous aggregation layer;
a path pruning module, configured to perform path pruning based on the node correlation metric matrix, where the node correlation metric matrix after the path pruning is used to indicate a target neighbor graph node of each graph node on the current aggregation layer; and
and the node embedding updating module is used for updating the node embedding of each graph node based on the updated node embedding of each graph node and the corresponding target neighbor graph node through the previous aggregation layer and the node correlation measurement matrix subjected to path pruning.
18. The apparatus according to claim 12 or 17, wherein the graph vector representation generating unit generates the graph vector representation of the graph structure data based on initial node embedding and updated node embedding of the respective graph nodes.
19. The apparatus of claim 18, wherein the graph vector representation generating unit comprises:
the node embedding cascade module is used for embedding the initial node of each graph node into the corresponding updated node embedding cascade respectively;
the MLP processing module is used for embedding the cascaded nodes of each graph node into a shallow MLP network to obtain the node embedding of each graph node after MLP processing; and
and a graph vector representation generation module for embedding and averaging the nodes of each graph node after MLP processing to generate a graph vector representation of the graph structure data.
20. An apparatus for generating a graph vector representation of graph structure data, comprising:
at least one processor for processing the received data,
a memory coupled to the at least one processor, an
A computer program stored in the memory, the computer program being executable by the at least one processor to perform the method of any of claims 1 to 11.
21. A computer readable storage medium storing executable instructions that when executed cause a processor to perform the method of any one of claims 1 to 11.
22. A computer program product comprising a computer program for execution by a processor to perform the method of any one of claims 1 to 11.
CN202210811350.0A 2022-07-11 2022-07-11 Method and apparatus for generating a graph vector representation of a graph data structure Pending CN115238134A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210811350.0A CN115238134A (en) 2022-07-11 2022-07-11 Method and apparatus for generating a graph vector representation of a graph data structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210811350.0A CN115238134A (en) 2022-07-11 2022-07-11 Method and apparatus for generating a graph vector representation of a graph data structure

Publications (1)

Publication Number Publication Date
CN115238134A true CN115238134A (en) 2022-10-25

Family

ID=83671059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210811350.0A Pending CN115238134A (en) 2022-07-11 2022-07-11 Method and apparatus for generating a graph vector representation of a graph data structure

Country Status (1)

Country Link
CN (1) CN115238134A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115759183A (en) * 2023-01-06 2023-03-07 浪潮电子信息产业股份有限公司 Related method and related device for multi-structure text graph neural network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115759183A (en) * 2023-01-06 2023-03-07 浪潮电子信息产业股份有限公司 Related method and related device for multi-structure text graph neural network
CN115759183B (en) * 2023-01-06 2023-05-16 浪潮电子信息产业股份有限公司 Correlation method and correlation device for multi-structure text graph neural network

Similar Documents

Publication Publication Date Title
US20230169140A1 (en) Graph convolutional networks with motif-based attention
CN109948029B (en) Neural network self-adaptive depth Hash image searching method
WO2022063151A1 (en) Method and system for relation learning by multi-hop attention graph neural network
CN112035746A (en) Session recommendation method based on space-time sequence diagram convolutional network
CN113536383B (en) Method and device for training graph neural network based on privacy protection
US20220309334A1 (en) Graph neural networks for datasets with heterophily
WO2022166115A1 (en) Recommendation system with adaptive thresholds for neighborhood selection
CN112085615A (en) Method and device for training graph neural network
CN115688913A (en) Cloud-side collaborative personalized federal learning method, system, equipment and medium
CN110659394B (en) Recommendation method based on bidirectional proximity
CN111695046A (en) User portrait inference method and device based on spatio-temporal mobile data representation learning
CN113987236A (en) Unsupervised training method and unsupervised training device for visual retrieval model based on graph convolution network
CN115238134A (en) Method and apparatus for generating a graph vector representation of a graph data structure
CN116090504A (en) Training method and device for graphic neural network model, classifying method and computing equipment
CN116992151A (en) Online course recommendation method based on double-tower graph convolution neural network
WO2023143570A1 (en) Connection relationship prediction method and related device
CN109582802B (en) Entity embedding method, device, medium and equipment
CN116467466A (en) Knowledge graph-based code recommendation method, device, equipment and medium
CN116090522A (en) Causal relation discovery method and system for missing data set based on causal feedback
CN116208399A (en) Network malicious behavior detection method and device based on metagraph
CN116010615A (en) Entity alignment method and device, electronic equipment and computer storage medium
CN115599990A (en) Knowledge perception and deep reinforcement learning combined cross-domain recommendation method and system
CN115131605A (en) Structure perception graph comparison learning method based on self-adaptive sub-graph
WO2022166125A1 (en) Recommendation system with adaptive weighted baysian personalized ranking loss
CN117010480A (en) Model training method, device, equipment, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20240226

Address after: Guohao Times City # 20-01, 128 Meizhi Road, Singapore

Applicant after: Advanced Nova Technology (Singapore) Holdings Ltd.

Country or region after: Singapore

Address before: Singapore

Applicant before: Alipay laboratories (Singapore) Ltd.

Country or region before: Singapore

TA01 Transfer of patent application right