METHOD FOR GENERATING A GRAPH STRUCTURE FOR TRAINING A GRAPH NEURAL NETWORK
20230101250 ยท 2023-03-30
Inventors
Cpc classification
G06V10/774
PHYSICS
International classification
Abstract
A method for generating a graph structure for training a graph neural network. The method includes: obtaining data representing a computational graph, wherein the computational graph comprises a plurality of nodes connected by edges; and generating the graph structure for training the graph neural network by removing edges from the computational graph. The edges are removed in such a way that an environment in the computational graph corresponds to an environment in the graph structure.
Claims
1. A method for generating a graph structure for training a graph neural network, the method comprising the following steps: obtaining data representing a computational graph, the computational graph including a plurality of nodes connected by edges; and generating the graph structure for training the graph neural network by removing edges from the computational graph, the edges being removed in such a way that an environment in the computational graph corresponds to an environment in the graph structure.
2. The method according to claim 1, wherein at least one edge attribute is assigned to each edge of the computational graph, and the step of generating the graph structure for training the graph neural network by removing edges from the computational graph includes removing edges from the computational graph based on the edge attributes assigned to the edges of the computational graph.
3. The method according to claim 2, wherein the step of generating the graph structure for training the graph neural network by removing edges from the computational graph further includes: assigning, for all edges of the computational graph, a signature to each respective edge of the computational graph based on the at least one edge attribute assigned to the respective edge, so that similar edges are assigned with the same signature; applying a hash function to respectively convert the signatures assigned to the edges of the computational graph into a numerical value; and maintaining, for all nodes of the computational graph, those of the edges of the computational graph that are connected to a node of the computational graph and whose signatures are converted into a minimum of all the numerical values and removing all other edges that are connected to the corresponding node of the computational graph.
4. The method according to claim 2, wherein the method further comprises: generating, for all edges of the computational graph, the at least one edge attribute assigned to an edge of the computational graph based on at least one node attribute of at least one node that is connected to the corresponding edge.
5. A method for training a graph neural network, the method comprising the following steps: generating a graph structure for training the graph neural network by: obtaining data representing a computational graph, the computational graph includes a plurality of nodes connected by edges, and generating the graph structure for training the graph neural network by removing edges from the computational graph, the edges being removed in such a way that an environment in the computational graph corresponds to an environment in the graph structure; providing training data for training the graph neural network; and training the graph neural network based on the generated graph structure and the training data.
6. The method according to claim 5, wherein the training data includes sensor data.
7. A method for classifying image data by a graph neural network, the method comprising the following steps: classifying image data using the graph neural network, the graph neural network being trained by: generating a graph structure for training the graph neural network by: obtaining data representing a computational graph, the computational graph includes a plurality of nodes connected by edges, and generating the graph structure for training the graph neural network by removing edges from the computational graph, the edges being removed in such a way that an environment in the computational graph corresponds to an environment in the graph structure; providing training data for training the graph neural network, and training the graph neural network based on the generated graph structure and the training data.
8. A control unit configured to generate a graph structure for training a graph neural network, the control unit comprising: an obtaining unit configured to obtain data representing a computational graph, the computational graph including a plurality of nodes connected by edges; and a first generating unit configured to generate the graph structure for training the graph neural network by removing edges from the computational graph, wherein the first generating unit is configured to remove the edges from the computational graph in such a way, that an environment in the computational graph corresponds to an environment in the graph structure.
9. The control unit according to claim 8, wherein at least one edge attribute is assigned to each edge of the computational graph, and wherein the first generating unit is configured to remove edges from the computational graph based on the edge attributes assigned to the edges of the computational graph.
10. The control unit according to claim 9, wherein the first generating unit includes: an assigning unit configured to for all edges of the computational graph, respectively assign a signature to an edge of the computational graph based on the at least one edge attribute assigned to the corresponding edge, so that similar edges are assigned with the same signature; a computing unit configured to apply a hash function to respectively convert the signatures assigned to the edges of the computational graph into a numerical value; and a removing unit configured to, for all nodes of the computational graph, maintain those of the edges of the computational graph connected a node of the computational graph and whose signatures are converted into the minimum of all the numerical values and to remove all other edges connected to the corresponding node from the computational graph.
11. The control unit according to claim 8, further comprising: a second generating unit configured to, for all edges of the computational graph, respectively generate the at least one edge attribute based on at least one node attribute of at least one node that is connected to the corresponding edge.
12. A control unit configured to train a graph neural network, the control unit comprising: a first receiver configured to receive a graph structure for training the graph neural network generated by a control unit configured to generate the graph structure, the control unit configured to generate the graph structure including: an obtaining unit configured to obtain data representing a computational graph, the computational graph including a plurality of nodes connected by edges, and a first generating unit configured to generate the graph structure for training the graph neural network by removing edges from the computational graph, wherein the first generating unit is configured to remove the edges from the computational graph in such a way, that an environment in the computational graph corresponds to an environment in the graph structure; a second receiver configured to receive training data for training the graph neural network; and a training unit configured to train the graph neural network based on the graph structure and the training data.
13. The control unit according to claim 12, wherein the training data includes sensor data.
14. An image classifier configured to classify image data, comprising: a receiver configured to receive a graph neural network trained by a control unit configured to train a graph neural network, the control unit configured to train the graph neural network including: a first receiver configured to receive a graph structure for training the graph neural network generated by a control unit configured to generate the graph structure, the control unit configured to generate the graph structure including: an obtaining unit configured to obtain data representing a computational graph, the computational graph including a plurality of nodes connected by edges, and a first generating unit configured to generate the graph structure for training the graph neural network by removing edges from the computational graph, wherein the first generating unit is configured to remove the edges from the computational graph in such a way, that an environment in the computational graph corresponds to an environment in the graph structure, a second receiver configured to receive training data for training the graph neural network; and a training unit configured to train the graph neural network based on the graph structure and the training data; and a classifying unit configured to classify image data using the graph neural network.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0045]
[0046]
[0047]
DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS
[0048]
[0049] Graph Neural Networks (GNNs) are a class of deep learning methods designed to perform inference on data described by graphs, wherein the graphs respectively comprise a plurality of nodes connected by edges. Such graph neural networks have become extremely popular for tasks involving graph data. Therein, graph neural networks often employ architectures that utilize message-passing, for example graph convolutional networks. In such architectures, data or information is propagated from a node of the graph through the neighbourhood of the corresponding node in order to generate a representation that depends on wide graph environments. Further, each node can represent a respective operation performed by the neural network as part of determining a neural network output from a neural network input This makes graph neural networks suitable for learning many real-world tasks.
[0050] However, real-world problems often involve very large graphs, wherein a lot of computer resources are required for training such a graph neural network, and wherein there might also be scenarios where much more computer resources are required for training such a graph neural network than common systems can provide. The size of the graphs frequently also causes graph neural networks to be overfitted if they are not properly regularized. Further, for example graph convolutional networks or graph attention networks are computer intensive tasks due to their mechanisms of neighbourhood aggregation, which utilizes computations of self-attentions to assign weights for neighbouring nodes.
[0051] In order to address these problems, it is conventional to base the training of such a graph neural network on a simplified architecture respectively graph structure. This is, for example, possible as very large graphs often involve many redundant components which can be removed, in order to simplify the training of such a graph neural network.
[0052]
[0053] In particular,
[0054] That a simplified architecture for the training of the graph neural network is generated has the advantage that the amount of computer recourses that are required for training the graph neural network based on the generated graph structure, for example storage space and/or processing time, can be significantly reduced. Thereby, it can be ensured that the graph neural network can also be trained by common systems with limited resources. Further, by training the graph neural network on such a reduced graph structure, also the subsequent implementation or usage of the graph neural network can be greatly simplified.
[0055] Further, that environments that are included in the computational graph are also included in the generated graph structure has the additional advantage that the performance of the trained graph neural network is not significantly reduced by training the graph neural network based on the generated reduced graph structure.
[0056] Thus,
[0057] According to the embodiments of
[0058] Therein, edge attributes mean data associated with edges. Here the edge attributes in particular define relations between nodes of the computational graph. For example, the edge attributes can, among others, define how many edges are connected to a specific node of the computational graph or how many edges are respectively connected between two specific nodes of the graph. The edge attributes can for example be in vector or list form.
[0059] According to the embodiments of
[0060] Therein, in step 6, for example the min-wise independent permutations locality sensitive hashing (MinHash-LSH) can be used, which is a technique for finding similar items efficiently in large databases.
[0061] Further, the hash function can be a pseudo-random hash function. This pseudo-random hash function can then be used across all graph regions or environments of the computational graph, wherein the method results in a graph structure, wherein regions of the graph structure are similar to corresponding regions in the computational graph, wherein edges whose signatures have not been converted into the minimum value of all the numerical values have been removed.
[0062] As shown in
[0063] For example, the edge attribute of an edge of the computational graph can be a vector that is composed of a vector that represents the node attribute of a first node connected to the edge and vector that represents the node attribute of a second node connected to the edge.
[0064] The method 1 further comprises step 8 of providing training data for training the graph neural network, and step 9 of training the graph neural network based on the generated graph structure and the training data.
[0065] According to the embodiments of
[0066] The trained graph neural network can then be implemented respectively be used for image classification. For example, the graph neural network can be used to detect traffic signs, road surfaces, pedestrians or vehicles in digital images.
[0067] However, for example based on the kind of training data, the trained graph neural network can also be used to determine a continuous value or multiple continuous values for example regarding a distance, a velocity or an acceleration, or to control the functions of an electronic control unit, for example an electronic control unit of a car.
[0068]
[0069] In particular,
[0070] Further,
[0071] As can be seen in
[0072]
[0073] As shown in
[0074] According to the embodiments of
[0075] Therein, the obtaining unit can for example include a receiver that is configured to receive data representing the computational graph, or an input device, wherein data representing the computational graph can be inputted via the input device. The first generating unit can further be implemented by code that is stored in a memory and processable by a processor.
[0076] According to the embodiments of
[0077] As shown in
[0078] Further, the assigning unit, the computing unit and the removing unit can e.g. be implemented by code that is stored in a memory and processable by a processor.
[0079] The shown control unit 21 further comprises a second generating unit 28 that is configured to, for all edges of the computational graph, respectively generate the at least one edge attribute based on at least one node attribute of at least one node that is connected to the corresponding edge.
[0080] The second generating unit can again for example be implemented by code that is stored in a memory and processable by a processor.
[0081] According to the embodiments of
[0082] The training unit can again for example be implemented by code that is stored in a memory and processable by a processor.
[0083] Further, according to the embodiments of