Region type determination method, training method and device based on graph data
By training a graph neural network with spatially aware partitioning, the method addresses the heterogeneity challenge in city maps, enhancing region type recognition accuracy and adaptability across tasks.
Patent Information
- Application Number
- CN202411320489.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-20
AI Technical Summary
Existing graph neural networks struggle to effectively model the spatial heterogeneity of city maps, leading to loss of key difference information and reduced performance in downstream tasks due to assumptions of homogeneity and limited modeling of node differences.
A method that determines region types by training a graph neural network using a target partition parameter based on matching probability, dividing the target relationship graph into target neighborhoods, updating central node features, and generating region type information, while considering spatial heterogeneity through multi-dimensional partitioning strategies.
Improves the representation ability and accuracy of region type recognition by alleviating spatial heterogeneity, allowing the graph neural network to better adapt to various downstream tasks with reduced computational costs.
Smart Images

Figure CN119167107A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, especially to technical fields such as deep learning and smart cities, and specifically to a method for determining region types based on graph data, a training method, an apparatus, an electronic device, a storage medium, and a program product. Background Art
[0002] With the rise of smart cities, cities are modeled, various urban entities (such as regions, points of interest, roads, etc.) are characterized, and intelligent computing is performed based on the characterization. The calculation results provide an important basis for urban business analysis and social management, thereby promoting the construction of intelligent cities, digital city layout and development. Summary of the invention
[0003] The present disclosure provides a method, a training method, an apparatus, an electronic device, a storage medium, and a program product for determining a region type based on graph data.
[0004] According to one aspect of the present disclosure, a method for determining region types based on graph data is provided, comprising: determining a target partition parameter from a plurality of candidate partition parameters based on a matching probability between each of the plurality of candidate partition parameters and a task to be processed; wherein the matching probability is obtained by training a graph neural network using region type information corresponding to a target node in a target relationship graph for the task to be processed as a label; the target relationship graph comprises a plurality of nodes representing various types of entity regions; the target relationship graph is divided based on the target partition parameter to obtain a plurality of target neighborhoods of a central node, each target neighborhood comprising at least one neighbor node; the initial features of the central node are updated based on the initial features of each target neighborhood to obtain the target features; and the target features are identified to generate region type information of the central node.
[0005] According to another aspect of the present disclosure, a training method for a graph neural network is provided, wherein the graph neural network includes: a partitioning module, a feature aggregation module, a feature updating module and a feature recognition module; the method includes: utilizing the partitioning module to partition a target relationship graph based on sample partitioning parameters to obtain a plurality of first sample target neighborhoods, each sample target neighborhood including at least one sample neighbor node; the target relationship graph includes a plurality of nodes representing various types of entity regions; utilizing the feature updating module to update the initial features of the sample center node based on the respective sample initial features of each first sample target neighborhood to obtain the sample target features; utilizing the feature recognition module to identify the sample target features to generate the first region type information of the sample center node; based on the target loss function, obtaining a first loss value according to the first region type information and the label of the sample center node, the label being the region type information of the sample center node; and adjusting the model parameters of the graph neural network based on the first loss value to obtain a trained graph neural network.
[0006] According to another aspect of the present disclosure, a device for determining a region type based on graph data is provided, comprising: a first determining module, a first dividing module, a first updating module and a first generating module.
[0007] The first determination module is used to determine the target partition parameter from multiple candidate partition parameters based on the matching probability of each of the multiple candidate partition parameters with the task to be processed; wherein the matching probability is obtained by training the graph neural network using the area type information corresponding to the target node in the target relationship graph of the task to be processed as a label; the target relationship graph includes multiple nodes representing various types of entity areas.
[0008] The first partitioning module is used to partition the target relationship graph based on the target partitioning parameter to obtain multiple target neighborhoods of the central node, each target neighborhood including at least one neighbor node.
[0009] The first updating module is used to update the initial features of the central node based on the initial features of each target neighborhood to obtain the target features.
[0010] The first generation module is used to identify the target features and generate the region type information of the central node.
[0011] According to another aspect of the present disclosure, a training device for a graph neural network is provided, the graph neural network comprising: a partitioning module, a feature aggregation module, a feature updating module and a feature recognition module. The training device comprises: a second partitioning module, a second updating module, a second generating module, a first loss calculating module and a first adjusting module.
[0012] The second partitioning module is used to use the partitioning module to partition the target relationship graph based on the sample partitioning parameters to obtain multiple first sample target neighborhoods, each sample target neighborhood includes at least one sample neighbor node; the target relationship graph includes multiple nodes representing various types of entity areas.
[0013] The second updating module is used to utilize the feature updating module to update the initial features of the sample center node based on the respective initial features of the samples in each first sample target neighborhood to obtain the sample target features.
[0014] The second generating module is used to utilize the feature recognition module to recognize the sample target feature and generate the first region type information of the sample center node.
[0015] The first loss calculation module is used to obtain a first loss value based on the target loss function according to the first region type information and the label of the sample center node, where the label is the region type information of the sample center node.
[0016] The first adjustment module is used to adjust the model parameters of the graph neural network based on the first loss value to obtain a trained graph neural network.
[0017] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.
[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program implements the above method when executed by a processor.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0022] Figure 1 An exemplary system architecture is schematically shown in which a method for determining a region type based on graph data, a method for training a graph neural network, and an apparatus can be applied according to an embodiment of the present disclosure;
[0023] Figure 2 A flowchart of a method for determining a region type based on graph data according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 3A An example diagram schematically shows division according to a direction dimension according to an embodiment of the present disclosure;
[0025] Figure 3B An example diagram schematically shows division according to a distance dimension according to an embodiment of the present disclosure;
[0026] Figure 4A An example diagram schematically shows the tree structure calculation steps according to an embodiment of the present disclosure. FIG;
[0027] Figure 4B A diagram schematically shows an example of applying the tree structure calculation step according to an embodiment of the present disclosure;
[0028] Figure 4C A diagram schematically shows an example of applying a tree structure calculation step according to another embodiment of the present disclosure;
[0029] Figure 5A An example diagram schematically shows an initial neighborhood obtained by dividing the direction dimension according to an embodiment of the present disclosure;
[0030] Figure 5B An example diagram schematically shows an example of a target neighborhood obtained by dividing the direction dimension according to an embodiment of the present disclosure;
[0031] Figure 5C An example diagram schematically shows a direction dimension division operation according to an embodiment of the present disclosure;
[0032] Fig. 6A An example diagram schematically shows an initial neighborhood obtained by dividing the distance dimension according to an embodiment of the present disclosure;
[0033] Figure 6B Schematically shows an example diagram of a target neighborhood obtained by dividing the distance dimension according to an embodiment of the present disclosure;
[0034] Figure 6C Schematically shows an example diagram of a distance dimension division operation according to an embodiment of the present disclosure;
[0035] Figure 7 An example diagram schematically shows a spatial heterogeneity-aware graph learning process according to an embodiment of the present disclosure;
[0036] Figure 8 A flowchart of a method for training a graph neural network according to an embodiment of the present disclosure is schematically shown;
[0037] Fig. 9A block diagram of a device for determining a region type based on graph data according to an embodiment of the present disclosure is schematically shown;
[0038] Fig.10 A block diagram schematically shows a training apparatus for a graph neural network according to an embodiment of the present disclosure; and
[0039] Fig.11 A block diagram of an electronic device suitable for implementing a method for determining a region type based on graph data according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0040] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0041] A city map is a relationship diagram constructed with city entities as nodes and the relationships between city entities as edges. The relationships between city entities can be, for example, population mobility relationships.
[0042] In related technologies, homogeneous graph neural networks (GNNs) or heterogeneous graph neural networks are usually used for representation learning.
[0043] However, city maps usually have certain spatial heterogeneity. For example, for the population flow map between urban areas, there is often a population flow relationship between residential areas and workplaces, but there is usually a large difference between these two areas. Not only that, in the city map, the differential distribution between neighbor nodes and central nodes is also uneven. Therefore, city maps have spatial heterogeneity.
[0044] Since homogeneous graph neural networks assume that city maps are homogeneous, the representations of adjacent nodes are smoothed during neighborhood aggregation to learn similar representations for adjacent nodes. However, for heterogeneous city maps, adjacent nodes are not necessarily similar, and the differences between them are key information to distinguish them. The smoothing effect of homogeneous GNNs will lose the difference information, which will cause the model to fail in many downstream tasks.
[0045] Although heterogeneous neural networks can take into account the differences between neighbors, they are still not enough to solve the unique spatial heterogeneity on city maps. On the one hand, it is difficult to model the differences between neighbors under different spatial relationships because the spatial distribution of urban entities is not taken into account. On the other hand, it can only model the differences between nodes in a limited way, such as assuming that there are two frequencies of information between nodes, or assuming that there are only two different types of nodes, and it is impossible to consider the spatial diversity of the heterogeneous characteristics of neighbors in city maps.
[0046] Therefore, an embodiment of the present disclosure proposes a method for determining region types based on graph data, including: determining a target partition parameter from multiple candidate partition parameters based on the matching probability of each of the multiple candidate partition parameters with the task to be processed; wherein the matching probability is obtained by training a graph neural network using the region type information corresponding to the target node in the target relationship graph of the task to be processed as a label; the target relationship graph includes multiple nodes representing various types of entity regions; the target relationship graph is divided based on the target partition parameter to obtain multiple target neighborhoods of the central node, each target neighborhood including at least one neighbor node; the initial features of the central node are updated based on the initial features of each target neighborhood to obtain the target features; and the target features are identified to generate region type information of the central node.
[0047] Figure 1 An exemplary system architecture is schematically shown to which an exemplary method for determining a region type based on graph data, a method for training a graph neural network, and an exemplary device according to an embodiment of the present disclosure can be applied.
[0048] It should be noted that Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0049] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0050] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0051] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0052] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device.
[0053] It should be noted that the region type determination method based on graph data provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the region type determination apparatus based on graph data provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0054] Alternatively, the region type determination method based on graph data provided in the embodiment of the present disclosure may also be generally performed by the server 105. Accordingly, the region type determination device based on graph data provided in the embodiment of the present disclosure may generally be arranged in the server 105. The region type determination method based on graph data provided in the embodiment of the present disclosure may also be performed by a server or server cluster that is different from the server 105 and that can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the region type determination device based on graph data provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and that can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0055] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0056] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0057] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0058] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
[0059] Figure 2 The flowchart of the method for determining the region type based on graph data according to an embodiment of the present disclosure is schematically shown.
[0060] like Figure 2 As shown, the region type determination method based on graph data includes operations S210 to S240.
[0061] In operation S210 , a target partition parameter is determined from a plurality of candidate partition parameters based on a matching probability between each of the plurality of candidate partition parameters and a task to be processed.
[0062] In operation S220, the target relationship graph is partitioned based on the target partitioning parameter to obtain a plurality of target neighborhoods of the central node, each target neighborhood including at least one neighbor node.
[0063] In operation S230, the initial features of the central node are updated based on the initial features of each target neighborhood to obtain the target features.
[0064] In operation S240, the target features are identified and region type information of the central node is generated.
[0065] According to an embodiment of the present disclosure, a city is a complex system, and there are various connections between various entities in the city, such as population flow between regions, road connection, etc. The target relationship graph can be a city map in which nodes represent certain entity areas and edges represent certain connections between entity areas. The target relationship graph may include multiple nodes representing various types of entity areas. The city map may represent various types of basic, comprehensive, and single-element general and thematic maps with the city as the scope, which can reflect the basic appearance and various facilities of the city, such as administrative areas, blocks, roads, etc.
[0066] According to the embodiments of the present disclosure, the target relationship graph can be formally defined, and a city map can be represented by G=(V, E), where represents a set of nodes consisting of some entity regions, including the central node and neighbor nodes. E represents a set of edges with some relationship between entity regions. A represents the adjacency matrix corresponding to the edge set E. Represents node v i 's neighborhood. Represents the node feature matrix, where the i-th row represents the node v iIn different tasks to be processed, the node set V and the edge set E represent different entity regions and relationships.
[0067] For example, the target relationship graph may be a population flow graph with regions as nodes and edges built based on population flow relationships between regions. For another example, the target relationship graph may be a traffic road network graph with intersections as nodes and edges built based on road connection relationships.
[0068] According to an embodiment of the present disclosure, the task to be processed may be a task of various types, for example, a task of predicting the prosperity of a city, or a task of predicting the traffic flow of a city.
[0069] Due to the spatial heterogeneity of urban maps, urban entities with similar spatial locations usually have similar characteristics. Therefore, appropriate spatial division of the urban map can be performed to group neighbor nodes so that the neighbor nodes within the group have similar difference distributions with the central node, thereby alleviating the diversity of neighbor heterogeneity within the group.
[0070] However, there are many spatial division strategies for city maps. If a spatial division scheme is artificially set based on experience, it lacks flexibility in practical applications. The effect depends on whether the spatial division is reasonable. If the spatial division and neighbor grouping are not reasonable, the spatial heterogeneity cannot be well alleviated, thereby reducing the processing performance of the graph neural network. Even if sufficient expert knowledge is required to set appropriate divisions for different tasks to be processed, or different division schemes are evaluated as hyperparameters, this approach requires repeated model training and consumes a lot of computing costs.
[0071] Therefore, in practical applications, only a few simple partitioning schemes can be evaluated, e.g., only considering interval space partitioning, while potentially more reasonable partitioning schemes, e.g., non-equal interval space partitioning, cannot be explored and adopted, which will limit its effectiveness in a wide range of downstream tasks.
[0072] The disclosed embodiment can divide the target relationship graph into equal intervals first, and then adjust the boundaries of each neighborhood to obtain multiple candidate division strategies. Each division strategy can correspond to a set of candidate division parameters. Each set of candidate division parameters can include at least the number of neighborhood divisions and the neighborhood boundary adjustment parameter.
[0073] For example, the candidate partitioning parameter may be a partitioning parameter adjustable within a preset range, or may be a partitioning parameter pre-set according to demand.
[0074] According to an embodiment of the present disclosure, the candidate partition parameter with the highest matching probability can be determined as the target partition parameter according to the matching probability between each of the multiple candidate parameters and the task to be processed.
[0075] For example, when the task to be processed is a task of predicting the prosperity of a city, all candidate partitioning parameters corresponding to a variety of candidate partitioning strategies can be used as the search space. In the process of training the graph neural network, the regional type information of the city entity corresponding to the target node in the target relationship graph of the task to be processed is used as a label, and any candidate partitioning parameter is randomly selected to process the target relationship graph to obtain the output result of the regional type. Then, the parameters of the graph neural network are adjusted based on the loss value between the output result and the label, and the partitioning parameters are updated until the loss value converges or the maximum number of training times is reached. Finally, the probability distribution of the candidate partitioning parameters is statistically calculated, and the candidate partitioning parameter corresponding to the maximum probability value is determined as the target partitioning parameter corresponding to the prosperity prediction task.
[0076] The training process of the graph neural network can be semi-supervised training. For example, the graph neural network may include 100 nodes, but there are only 10 nodes with labels. Therefore, the 10 nodes with labels can be used to perform semi-supervised training on the graph neural network.
[0077] According to an embodiment of the present disclosure, the target relationship graph may be divided based on the target division parameter, wherein the division may be multi-dimensional division, for example, the target relationship graph may be divided according to a division method of a direction dimension. For another example, the target relationship may be divided according to a division method of a distance dimension.
[0078] According to the embodiment of the present disclosure, when the division is performed according to the direction dimension, for a certain central node , the central node The city map centered on the city is divided into a series of sectors. ,in represents the number of divided fan-shaped neighborhoods. Correspondingly, The neighbor nodes in can be assigned to various fan-shaped neighborhoods and redefined as neighborhoods of different directional dimensions. , neighborhoods of different direction dimensions (fan-shaped neighborhoods) are regarded as different target neighborhoods.
[0079] Figure 3A An example diagram of division according to a direction dimension according to an embodiment of the present disclosure is schematically shown.
[0080] like Figure 3A As shown, for the division of the directional dimension, node v1 can be regarded as the central node, and s1, s2, s3, and 4 can be regarded as multiple target neighborhoods. Each target neighborhood can include at least one neighbor node. Then, target neighborhood s1 includes neighbor node v3, target neighborhood s2 includes neighbor node v4, target neighborhood s3 includes neighbor node v5, and target neighborhood 4 includes neighbor nodes v2 and v6.
[0081] According to an embodiment of the present disclosure, when divided according to the distance dimension, the city map will be divided into a series of rings. ,in Indicates the number of rings. Different rings cover different distance ranges. Divide the target neighborhood into a series of distance dimensions For the central node , which can be considered as an additional target neighborhood .
[0082] Figure 3B An example diagram of division according to the distance dimension according to an embodiment of the present disclosure is schematically shown.
[0083] like Figure 3B As shown, for the division of the distance dimension, v1 can be regarded as the central node, r1, r2, and r3 can be regarded as multiple target neighborhoods, and each target neighborhood can include at least one neighbor node. Then, the target neighborhood r1 includes the neighbor node v2, the target neighborhood r2 includes the neighbor node v4, and the target neighborhood r3 includes the neighbor node v3.
[0084] According to an embodiment of the present disclosure, based on target partitioning parameters, by performing multi-dimensional partitioning on the target relationship graph, multiple target neighborhoods of the central node can be obtained, and each target neighborhood can include at least one neighbor node.
[0085] According to an embodiment of the present disclosure, the initial feature may be obtained by aggregating initial features of multiple neighbor nodes in the target neighborhood.
[0086] For example, in a city map, a neighbor node may be Area A, and the initial feature of Area A may be that the online transaction rate is 30% and the e-commerce prosperity is low.
[0087] According to the embodiments of the present disclosure, feature aggregation is performed on neighbor nodes in each initial neighborhood (sector neighborhood / ring), rather than mixing all neighbor information together as in a general GNN model. This feature aggregation avoids mixing together different initial neighborhoods with different distributions. The initial feature aggregation of multiple neighbor nodes in the target neighborhood can be the concatenation of the initial features of multiple neighbor nodes, or it can be the weighted sum of the initial features of multiple neighbor nodes.
[0088] For example, taking the weighted summation of the initial features of multiple neighbor nodes as an example, in the case of directional dimension division, for the initial neighborhood divided , we can use graph convolution with different parameters for each initial neighborhood The feature aggregation is performed as follows:
[0089] (1)
[0090] in Indicates Layer network from fan-shaped neighborhood The information aggregated in the fan-shaped neighborhood is also called the fan-shaped neighborhood The representation vector of Indicates The node representation features output by the layer network ( ); represents a trainable transformation matrix used to extract useful information from neighbor nodes; Represents the degree matrix of the graph.
[0091] According to the embodiments of the present disclosure, the initial features of the central node can be updated based on the initial features of each target neighborhood, and the target features can be obtained. The initial features of the central node can be the regional information of the city entity corresponding to the central node, such as: the population flow degree, traffic congestion degree, regional prosperity degree, etc. of the region.
[0092] According to an embodiment of the present disclosure, by identifying the target features, the regional type information of the central node can be generated. The regional type information of the central node can be used to evaluate the essential information of the urban entity. For example, the regional type information of the central node can be that the traffic flow is large, indicating that the area corresponding to the central node is the transportation hub of the city.
[0093] According to the embodiments of the present disclosure, the regional type information of the target node is used as a label to train the graph neural network for the task to be processed, and the matching probability between the candidate partitioning parameters and the task to be processed is obtained, thereby further improving the matching degree between the partitioning parameters and the task to be processed. In the process of message transmission of the graph neural network, the spatial position of the neighboring nodes is fully considered, and the characteristic that spatially close nodes have high similarity is utilized. The target relationship graph is divided based on the target partitioning parameters by adopting the spatial partitioning method, and then the features of the central node are updated based on the initial features of each target neighborhood, thereby reducing the diversity of heterogeneous distribution within each target neighborhood, solving the spatial heterogeneity problem of the city map with a divide-and-conquer strategy, improving the representation ability of the graph neural network for each city entity, and further improving the accuracy of regional type recognition.
[0094] Since urban entities with similar spatial locations in urban maps usually have similar characteristics, when dividing urban maps, we can formulate division strategies from two perspectives: direction dimension and distance dimension. Each division strategy corresponds to a set of candidate division parameters, thereby constructing a search space for candidate division parameters, so as to randomly sample any candidate division parameter from the search space and train the graph neural network. This not only does not destroy the initial relationship between the nodes in the urban map, but also fully considers the uneven distribution of differences between urban entities in the urban map.
[0095] According to an embodiment of the present disclosure, the operation of constructing a search space in the direction dimension may include two levels. The first level is the sector number decision level. The operation set Implemented as a set of initial fan-shaped neighborhood partitioning operations , determine the number of sector neighborhoods and make preliminary divisions. The second level is the sector boundary rotation level (Sector Boundary Rotation), which can design a series of sector boundary rotation operations , as a set of operations The specific implementation of .
[0096] According to the embodiment of the present disclosure, the level is determined according to the number of fan-shaped neighborhoods, and the designed fan-shaped neighborhood partitioning operation set is: , where the operation The relationship target graph will be divided into equally spaced fan-shaped neighborhood. Given an input relation target graph The adjacency matrix of , this operation can be expressed as the following formula (2):
[0097] (2)
[0098] in, represents the obtained fan-shaped neighborhood partitioning scheme, Represents a fan-shaped neighborhood The corresponding target neighborhood. At the first level, the edge Will be from Select an operation to determine the number of fan-shaped neighbors and generate the initial neighborhood , the initial partition is express.
[0099] For example, a tree-topology computation procedure (TCP) can be constructed to represent the partitioning process of the target relationship graph, and a search space containing a rich number of partitioning schemes can be designed based on the structure. The core idea is to first determine the number of target neighborhoods (the number of fan-shaped neighborhoods or rings) and perform an initial partition (Initial Partition) to obtain the initial neighborhood; then adjust the boundaries of the initial neighborhood to generate multiple target neighborhoods. By setting different numbers of target neighborhoods and using different boundary adjustment operations, a variety of spatial partitioning schemes can be achieved, and all possible schemes can constitute the search space. A suitable partitioning scheme can be selected from the rich search space as the input of the spatial heterogeneity-aware graph learning algorithm (SHGL for short).
[0100] According to the embodiments of the present disclosure, various partitioning schemes may be generated based on TCP to form a search space.
[0101] Figure 4A An example diagram schematically shows the tree structure calculation steps according to an embodiment of the present disclosure.
[0102] like Figure 4A As shown, the tree structure calculation step includes two levels, the first level is the neighborhood number determination level 401, and the second level is the boundary adjustment level 402. In the first level, the target relationship graph can be divided into multiple initial neighborhoods, starting from an input node node in , represents the adjacency matrix A of the given target relationship graph G. A directed edge e0 is connected by the input node node in Points to the first-level intermediate node , edge e0 will be added from the search space Select a partition operation in Different operations in can divide the target relationship graph into different numbers of initial neighborhoods. Where M represents the maximum number of initial neighborhoods, and the selection Indicates that m initial neighborhoods are initially divided. The central node It is used to represent the partitioning result of the operation, that is, a series of adjacency matrices can be obtained .
[0103] According to an embodiment of the present disclosure, the adjacency matrix obtained based on the initial partitioning obtained at the first level , the boundaries of the initial neighborhood can be adjusted to obtain the newly divided adjacency matrix This process will introduce richer partitioning schemes, thereby expanding the search space. First, assume that the initial space partitioning scheme The border can be Second-level intermediate node To represent them. On this basis, the second-level calculation process is expressed as Connecting Nodes and their Successor Node The edge of . To represent these edges, each edge From a set of candidate operations Select an operation from The corresponding boundaries are adjusted and the newly divided adjacency matrix Input heterogeneity-aware graph learning module SHGL (Spaial Heterophily Aware Graph Learning).
[0104] Figure 4B Schematically shows an example of applying the tree structure calculation step according to an embodiment of the present disclosure
[0105] like Figure 4B As shown in FIG. 1 , it is an example diagram of applying the tree structure calculation step to the direction dimension division. The target relationship graph is initially divided into four fan-shaped neighborhoods 421A in the direction dimension, that is, the divided target relationship graph includes four initial neighborhoods, and four nodes are used to represent the boundaries between the fan-shaped neighborhoods. Candidate set It can contain different types of boundary adjustment operations. The adjustment operation is defined as the rotation of the fan-shaped neighborhood boundary. By rotating the fan-shaped neighborhood boundary at different angles, various new partitioning schemes can be obtained, that is, the fan-shaped search space can be obtained. Adjust the boundary counterclockwise by an angle of 4221, and the neighbor node Adjusted to , adjust the border clockwise by an angle of 4222, the neighbor node Adjusted to , for neighbor nodes and neighbor nodes The boundary of the node is not adjusted, and the corresponding neighbor node can be obtained. and neighbor nodes , thereby obtaining the adjusted fan-shaped neighborhood 423A.
[0106] Figure 4C The following schematically shows an example diagram of applying the tree structure calculation step according to yet another embodiment of the present disclosure.
[0107] like Figure 4CAs shown, it is an example diagram of applying the tree structure calculation step to the distance dimension division. The target relationship graph is initially divided into three annular neighborhoods 421B in the distance dimension, that is, the target relationship graph after division includes three initial neighborhoods, and two nodes are used to represent the boundaries between the annular neighborhoods. The distance range of each annular neighborhood is changed by the annular neighborhood boundary expansion and contraction operation, that is, by adjusting the annular neighborhood boundary, it is possible to obtain a better space division scheme than the initial division, that is, to obtain the ring search space. The boundary is shrunk 4241, and the neighbor node Adjusted to , expand the border by 4242, neighbor nodes Adjusted to , thereby obtaining the adjusted annular neighborhood 425B.
[0108] According to the embodiments of the present disclosure, by constructing a search space for candidate partitioning parameters, target partitioning parameters that match the task to be processed are matched from the search space during the training of the graph neural network. Compared with the solution of evaluating the processing results of the set partitioning parameters according to the pre-set partitioning parameters, the computational processing amount of the graph neural network can be reduced, and more different downstream adaptation tasks can be adapted, thereby improving the performance of the graph neural network.
[0109] According to an embodiment of the present disclosure, dividing the target relationship graph based on the target division parameter from the direction dimension to obtain multiple target neighborhoods may include the following operations: dividing the target relationship graph into multiple initial neighborhoods at equal intervals according to the neighborhood quantity parameter. Adjusting the boundaries of the multiple initial neighborhoods according to the neighborhood boundary adjustment parameter to obtain multiple target neighborhoods.
[0110] According to an embodiment of the present disclosure, the target partitioning parameter may include a neighborhood number parameter and a neighborhood boundary adjustment parameter. The neighborhood number parameter may characterize the number of target neighborhoods obtained by partitioning the target relationship graph. The neighborhood boundary adjustment parameter may characterize the adjustable boundary of the target neighborhood.
[0111] According to an embodiment of the present disclosure, the target relationship graph can be divided into a plurality of initial neighborhoods at equal intervals according to the neighborhood quantity parameter. Since the division is at equal intervals, the plurality of initial neighborhoods are equal.
[0112] According to the embodiments of the present disclosure, the boundaries of multiple initial neighborhoods can be adjusted according to the neighborhood boundary adjustment parameters, so that multiple target neighborhoods can be obtained. For example, if the initial neighborhood is an annular area, the radius of the annular ring can be adjusted, so that multiple target neighborhoods with different ring widths can be obtained. For another example, if the initial neighborhood is a fan-shaped area, the angle of the fan-shaped area can be adjusted, so that multiple target neighborhoods with unequal areas can be obtained.
[0113] According to an embodiment of the present disclosure, by dividing the target relationship graph into equal intervals, initial neighborhoods of equal size can be obtained, and then the boundaries of the initial neighborhoods can be adjusted to obtain multiple target neighborhoods. This method of defining the division parameters through neighborhood quantity parameters and neighborhood boundary adjustment parameters can provide more flexible and diverse division strategies, so that a division scheme that is more suitable for the task to be processed can be matched during the training process, thereby improving the accuracy of the target relationship graph division.
[0114] According to an embodiment of the present disclosure, dividing the target relationship graph into a plurality of initial neighborhoods at equal intervals according to a domain quantity parameter may include the following operations: determining an initial direction of an endpoint of a first initial segmentation line for dividing the target relationship graph relative to a central node according to the neighborhood quantity parameter. Along the initial direction, the target relationship graph is divided into a plurality of first initial neighborhoods at equal intervals using the first initial segmentation line.
[0115] According to an embodiment of the present disclosure, the first initial segmentation line can represent a line for dividing the target relationship graph, and is used to divide the target relationship graph into different regions. Since the target relationship graph is divided into equal intervals, the initial direction of the endpoint of the first initial segmentation line relative to the central node can be determined according to the neighborhood quantity parameter.
[0116] According to an embodiment of the present disclosure, the target relationship graph may represent a circular area where multiple neighbor nodes having connecting edges with the central node are located. The multiple first initial neighborhoods may be fan-shaped. When the initial direction is determined, the target relationship graph may be divided into multiple first initial neighborhoods at equal intervals along the initial direction using the first initial segmentation line.
[0117] Figure 5A An example diagram schematically shows an initial neighborhood obtained by dividing the initial neighborhood into directional dimensions according to an embodiment of the present disclosure.
[0118] like Figure 5A As shown, in the case of directional dimension division, the multiple first initial fan-shaped neighborhoods obtained by the initial division of the directional dimension, the designed initial fan-shaped neighborhood division operation set is , multiple initial neighborhoods 521 can be obtained by the initial division in the direction dimension. When the number of fan-shaped neighborhoods is determined to be 2, 2 initial neighborhoods can be obtained. When the number of fan-shaped neighborhoods is determined to be 3, 3 initial neighborhoods can be obtained. When the number of fan-shaped neighborhoods is determined to be 4, 4 initial neighborhoods can be obtained.
[0119] According to the embodiments of the present disclosure, the target relationship is divided into equal intervals from the directional dimension based on the neighborhood quantity parameter, and the characteristic that nodes with similar distances in the city map have similar difference distributions is also utilized, which fully alleviates the impact of the spatial heterogeneity between the neighbor nodes on the feature representation of the central node.
[0120] According to an embodiment of the present disclosure, adjusting the boundaries of multiple initial neighborhoods according to neighborhood boundary adjustment parameters to obtain multiple target neighborhoods may include the following operations: determining the rotation direction and rotation angle of the boundary of each first target neighborhood relative to each first initial dividing line according to a direction adjustment parameter and an angle adjustment parameter; adjusting the boundary of each first initial neighborhood according to each rotation direction and each rotation angle to obtain multiple first target neighborhoods.
[0121] According to an embodiment of the present disclosure, the neighborhood boundary adjustment parameter may include a direction adjustment parameter and an angle adjustment parameter. The rotation direction of the boundary of each first target neighborhood relative to each first initial segmentation line may be determined according to the direction adjustment parameter. The rotation angle of the boundary of each first target neighborhood relative to each first initial segmentation line may be determined according to the angle adjustment parameter.
[0122] Figure 5B An example diagram schematically shows a target neighborhood obtained by dividing the target neighborhood in the direction dimension according to an embodiment of the present disclosure.
[0123] like Figure 5B As shown, the fan-shaped neighborhood adjusts multiple initial neighborhoods, that is, given The initial neighborhood of the fan-shaped neighborhood , we can use the intermediate nodes of the second level express Border. The represented boundary will affect two fan-shaped neighborhoods ( division. Affects two fan-shaped neighborhoods . The set of operations will be adjusted from the boundary of the fan-shaped neighborhood The selection operation adjusts these boundaries and calls the combination function to finally get the first target neighborhood By dividing the target relationship graph, four initial neighborhoods 521 can be obtained. By adjusting the boundaries of the initial neighborhoods, a target neighborhood 522 can be obtained.
[0124] According to an embodiment of the present disclosure, the central node and the neighboring nodes The initial neighborhood associated with the boundary line is A s1 and the initial neighborhood is A s2 , with the central node and neighboring nodes The initial neighborhood associated with the boundary line is A s2 and the initial neighborhood is A s3 , with the central node and neighboring nodes The initial neighborhood associated with the boundary line is A s3 and the initial neighborhood is A4, with the central node and neighbor nodes The initial neighborhood associated with the boundary line is A4 and the initial neighborhood is A s1 By adjusting multiple boundary lines, we can get the relationship with neighboring nodes. , neighbor nodes , neighbor nodes , neighbor nodes Corresponding neighbor nodes , neighbor nodes , neighbor nodes , neighbor nodes , and then the first target neighborhood .
[0125] Figure 5C An example diagram of a directional dimension division operation according to an embodiment of the present disclosure is schematically shown.
[0126] like Figure 5C As shown, for the fan-shaped neighborhood in the direction dimension, the rotation operation based on the boundary of the fan-shaped neighborhood can be performed , adjust the boundary direction and angle of the fan-shaped neighborhood. For the initial neighborhood , each fan-shaped neighborhood is further divided into four finer-grained fan-shaped neighborhood units 520. The relationship between the original fan-shaped neighborhood and these units can be expressed as , Corresponding to the fan-shaped neighborhood No. units.
[0127] Therefore, different operations can be defined according to the number of rotation units at the fan-shaped neighborhood boundary. Specifically, for different rotation operations , subscript is a signed value indicating the function of the operation. Its sign indicates the direction of rotation and its value indicates the number of units rotated. When u=0, the boundary remains unchanged. , will rotate the boundary counterclockwise. Indicates clockwise rotation of the border. For example: It means that it remains unchanged and gets 5201. It means rotating 1 unit counterclockwise to get 5202. It means rotating 2 units counterclockwise to get 5203. It means rotating 1 unit clockwise will give 5204. It means rotating 2 units clockwise gives 5205.
[0128] According to the embodiments of the present disclosure, the rotation operation changes the range of two adjacent fan-shaped neighborhoods, which is essentially to redistribute the neighbors in the two fan-shaped neighborhoods. The corresponding boundary is The operation modifies the The following formula (3):
[0129] (3)
[0130] in, Indicates the new neighbor allocation in these two fan-shaped neighborhoods.
[0131] Table 1 Fan-shaped neighborhood boundary rotation operation and ring boundary expansion operation table
[0132]
[0133] in, It is a general representation of a neighborhood, referring to a fan-shaped neighborhood in the direction dimension. , in the distance dimension, refers to the ring . In particular, for the distance dimension, Represents a fan-shaped neighborhood .
[0134] According to the embodiments of the present disclosure, Table 1 lists different The relationship between neighbor allocations before and after the application operation is applied.
[0135] like Figure 5C As shown, for Indicates that the fan-shaped neighborhood and The boundary between is rotated one unit counterclockwise. That is, The corresponding neighbors originally belong to , will be reallocated to Therefore, Modified to ,in ,and . And so on, Each edge in will be Select an operation to adjust the corresponding fan-shaped neighborhood boundary. The new boundary can be used to calculate the successor node. Indicates. To express Select the operation, The result is .and The result is .
[0136] According to the embodiment of the present disclosure, by integrating the results of all subsequent nodes, a new fan-shaped neighborhood partitioning scheme can be obtained. For a fan-shaped neighborhood , rotating both of its boundaries will affect the distribution of neighboring nodes. Specifically, The results include ,at the same time The results include , both of which will change the neighbor nodes assigned to them. Therefore, the following integration function can be designed as follows: and , to finally determine after the boundary rotation, to determine the neighbor nodes are assigned to the fan-shaped neighborhood situation.
[0137] (4)
[0138] According to the embodiment of the present disclosure, the target neighborhood can be obtained based on the output of the integration function, and then the partitioning scheme of the target relationship graph can be determined according to the target partitioning parameters. .
[0139] According to an embodiment of the present disclosure, when the rotation direction and rotation angle of the boundary of each first target neighborhood relative to each first initial segmentation line are determined, the boundaries of multiple initial neighborhoods can be rotated according to the rotation direction and rotation angle, thereby obtaining multiple first target neighborhoods.
[0140] According to the embodiments of the present disclosure, the rotation direction and rotation angle of the boundary of each first target neighborhood relative to each first initial dividing line can be determined based on the direction adjustment parameter and the angle adjustment parameter, and then the boundary of each first initial neighborhood can be adjusted according to each rotation angle and rotation direction, so that multiple first target neighborhoods can be obtained, which not only improves the adaptability of multiple target neighborhoods to the tasks to be processed, but also improves the ability of graph neural networks to characterize the spatial heterogeneity of urban entities.
[0141] According to an embodiment of the present disclosure, from a distance dimension, according to a domain quantity parameter, dividing the target relationship graph into multiple initial neighborhoods at equal intervals may include the following operations: determining an initial distance of a second initial segmentation line for dividing the target relationship graph relative to a central node according to the neighborhood quantity parameter. According to the initial distance, the target relationship graph is divided into multiple second initial neighborhoods at equal intervals using the second initial segmentation line, wherein the multiple second initial neighborhoods are ring-shaped.
[0142] According to an embodiment of the present disclosure, an initial distance of a second initial segmentation line for dividing the target relationship graph relative to a central node may be determined according to a neighborhood quantity parameter.
[0143] According to an embodiment of the present disclosure, the second initial neighborhood may be annular, the second initial segmentation line may be circular, and the target relationship graph may be divided into a plurality of second initial neighborhoods at equal intervals using the second initial segmentation line according to the initial distance.
[0144] Fig. 6A An example diagram schematically shows an initial neighborhood obtained by dividing the distance dimension according to an embodiment of the present disclosure.
[0145] like Fig. 6A As shown, the initial ring neighborhood partitioning operation set is determined based on the neighborhood quantity parameter: , where the operation The target relationship graph is divided into The ring neighborhood 621 can be divided into two rings, three rings, or four rings. Then the neighbor nodes are assigned to each ring according to the distance from the central node to form an initial neighborhood. Specifically, the distance distribution between neighbor nodes is first counted on the target relationship graph. Then, if the distance distribution between neighbor nodes is calculated, the target relationship graph is used. operate, The boundaries of the rings are defined as Quantiles. Using quantiles instead of absolute distances to define ring spans is to make it applicable to target relationship graphs with various distance distributions. Based on this, the operation It can be expressed as follows:
[0146] (5)
[0147] in, represents the obtained ring partitioning scheme, express The corresponding initial neighborhood. Will be from , select an action.
[0148] According to the embodiment of the present disclosure, the target relationship is divided into equal intervals from the distance dimension based on the neighborhood quantity parameter, and the characteristic that nodes with similar distances in the city map have similar difference distribution is also utilized, which fully alleviates the influence of the spatial heterogeneity between neighbor nodes on the characteristic representation of the central node. .
[0149] According to an embodiment of the present disclosure, for the division of the distance dimension, the operation set Implemented as a set of initial ring partitioning operations , determine the number of rings and make a preliminary division. Then, based on the operation set Ring boundary expansion and contraction operations .
[0150] According to an embodiment of the present disclosure, adjusting the boundaries of multiple initial neighborhoods according to the neighborhood boundary adjustment parameter to obtain multiple target neighborhoods may include the following operations: determining the boundary adjustment distance of each second initial neighborhood according to the distance adjustment parameter. Adjusting the boundaries of the second initial neighborhoods respectively according to the boundary adjustment distances corresponding to each second initial neighborhood to obtain multiple second target neighborhoods.
[0151] According to an embodiment of the present disclosure, when the second initial neighborhood is a ring, the neighborhood adjustment parameter may include a distance adjustment parameter.
[0152] According to an embodiment of the present disclosure, the boundary adjustment distance of each second initial neighborhood can be determined according to the distance adjustment parameter, and the boundary of the second initial neighborhood can be adjusted according to the boundary adjustment distance corresponding to each second initial neighborhood, so that multiple second target neighborhoods can be obtained.
[0153] Figure 6B An example diagram schematically shows a target neighborhood obtained by dividing the distance dimension according to an embodiment of the present disclosure.
[0154] like Figure 6B As shown, the ring neighborhood adjustment operation set is to adjust the initial neighborhood. The initial neighborhood of the ring 621, the initial neighborhood is The boundaries can be represented by the intermediate nodes of the second level. To express them, The represented boundary will affect both rings ( division. Will be from The selection operation in the target neighborhood is used to scale these boundaries. 622. For example, the first level obtains an initial neighborhood of 3 rings, which has 2 boundaries and can be obtained using the intermediate nodes of the second level. Represent them, and by scaling the boundaries, the target neighborhood can be obtained using the combination function .
[0155] Figure 6C An example diagram of a distance dimension division operation according to an embodiment of the present disclosure is schematically shown.
[0156] like Figure 6C As shown, the distance dimension can be divided by using the ring neighborhood boundary expansion operation , increase or decrease the radius of the ring, flexibly expand and contract the ring boundary, similar to the rotation of the fan-shaped neighborhood, first of all, the initial neighborhood Each ring in 621 is further divided into 4 ring units, formally represented as , Corresponds to No. units. Different ring expansion operations are defined as expanding or contracting different numbers of units. Specifically, the subscript To indicate Operation function. , will expand the ring boundary units, Indicates contraction units, Indicates that it remains unchanged. For example, Indicates expansion of 1 unit 6222, It means expanding 2 units 6223, It means shrinking 1 unit 6224, Indicates shrinking 2 units 6225. Indicates that it remains unchanged6221.
[0157] According to the embodiments of the present disclosure, For the corresponding boundaries, use The operation modifies the The following formula (6):
[0158] (6)
[0159] in, express The new neighbor allocation is generated.
[0160] According to the embodiments of the present disclosure, Table 1 lists different The relationship between the neighbor node allocation before and after the rotation operation. Figure 6C In and As an example, the boundary between Graphical instructions for the operation. Each edge in will be Select an operation to adjust the corresponding fan-shaped neighborhood boundary, and the new boundary is represented by the successor node Indicates. To express Select the operation, The result is .
[0161] According to the embodiment of the present disclosure, similar to the direction dimension, an integration function is designed to combine the results in all successor nodes to obtain a new ring partitioning scheme . Slightly different from the directional dimension, the ring and The distance span of is affected by only one boundary, that is, only In the results Will change the allocation to Neighbors; only In Will affect , while other rings are affected by two boundaries. Therefore, the integration function has different forms for different rings, as shown in formula (7):
[0162] (7)
[0163] According to the embodiment of the present disclosure, the second target neighborhood can be obtained based on the output of the integration function, and then the partitioning scheme of the target relationship graph can be determined according to the target partitioning parameters. .
[0164] According to an embodiment of the present disclosure, when the second initial neighborhood is a ring, the boundary adjustment distance can be determined based on the distance adjustment parameter, so that the boundary of the second initial neighborhood is adjusted according to the boundary adjustment distance, and then multiple second target neighborhoods are obtained, thereby improving the adaptability of the division of the target neighborhood and the task to be processed.
[0165] According to an embodiment of the present disclosure, the initial features of the central node are updated based on the initial features of each target neighborhood to obtain the target features, which may include the following operations: according to the initial features of each target neighborhood, the common features between the target neighborhoods are enhanced to obtain the first features of each target neighborhood. According to the initial features of each target neighborhood and the features of the central node, the difference features between the target neighborhoods are enhanced to obtain the second features of each target neighborhood. According to each first feature and each second feature, the enhanced features of each target neighborhood are obtained. According to the enhanced features of each target neighborhood, the initial features of the central node are updated to obtain the target features.
[0166] Figure 7 An example diagram of a spatial heterogeneity-aware graph learning process according to an embodiment of the present disclosure is schematically shown.
[0167] like Figure 7 As shown, the partitioning scheme is represented by an adjacency matrix, which includes a fan-shaped neighborhood partition in the direction dimension and a ring partition in the distance dimension 721. For each node , when the fan-shaped neighborhood is the neighborhood Divide , which is equivalent to taking the edge set Divide into subsets ,in, Includes connection and The edges of the neighbor nodes in the graph can define a series of adjacency matrices. . You can use To represent the fan-shaped neighborhood partitioning scheme, use Indicates that it is located in a fan-shaped neighborhood The target neighborhood is composed of the neighboring nodes of . Similarly, another set of adjacency matrices can be used To represent a ring division scheme. For the sector neighborhood division in the direction dimension and the ring division in the distance dimension, the common features are enhanced to obtain the common enhanced features 722 and the difference features are enhanced to obtain the difference enhanced features 723. The sector common enhanced features and sector difference enhancement features The weighted summation is performed using the attention gating module 724 to obtain , ring commonality enhancement features and ring difference enhancement features The weighted summation is performed using the attention gating module 724 to obtain , and then and The target enhancement feature is obtained by weighted summation.
[0168] According to an embodiment of the present disclosure, similarly, in the case of distance dimension division, the neighbors in each ring are also aggregated respectively according to the following formula (8):
[0169] (8)
[0170] in, Representation ring The representation vector of Features used to map neighbors of different distances.
[0171] like Figure 7 As shown, the method includes obtaining the first feature by using a common kernel function and obtaining the second feature by using a difference kernel function, and obtaining the target feature based on the weighting of the first feature and the second feature.
[0172] According to an embodiment of the present disclosure, each target neighborhood includes common features and difference features. The common features can characterize the common knowledge or similar characteristics of each target neighborhood, and the common features can be used to enhance the characterization of each target neighborhood. The common kernel function can be used to capture the common features between each target neighborhood.
[0173] According to the embodiments of the present disclosure, the common features between the target neighborhoods can be enhanced based on the initial features of the target neighborhoods to obtain the first features of the target neighborhoods.
[0174] According to the embodiments of the present disclosure, the difference feature can characterize the difference characteristics of each target neighborhood, and the difference feature can be used to capture the dissimilarities between each target neighborhood. The difference feature between each target neighborhood can be enhanced based on the initial features of each target neighborhood and the features of the central node to obtain the second features of each target neighborhood.
[0175] According to the embodiments of the present disclosure, enhanced features of each target neighborhood can be obtained based on each first feature and each second feature, and the enhanced features of each target neighborhood are used to update the initial features of the central node to obtain the target features.
[0176] According to the embodiments of the present disclosure, the connections within each target neighborhood and the differences between each target neighborhood can be better represented based on common feature enhancement and difference feature enhancement, and the initial features of the intermediate nodes are updated based on the enhanced features of each target neighborhood obtained according to the first feature and the second feature, thereby improving the representation capability between each entity area.
[0177] According to an embodiment of the present disclosure, based on the initial features of each target neighborhood, common features between each target neighborhood are enhanced to obtain the first features of each target neighborhood, which may include the following operations: based on the initial features of each target neighborhood, first similarities between each target neighborhood are calculated. Based on each first similarity and the initial features of each target neighborhood, each first feature is obtained.
[0178] According to an embodiment of the present disclosure, the first similarities between the target neighborhoods can be calculated based on the initial features of the target neighborhoods using a common kernel function, and the first features can be obtained based on the first similarities and the initial features of the target neighborhoods.
[0179] According to the embodiment of the present disclosure, since the division of the target relationship graph includes the division of the direction dimension and the division of the distance dimension. In the case of the direction dimension division, each target neighborhood can be a fan-shaped neighborhood, and the representation matrix of each fan-shaped neighborhood can be . Common kernel function Two fan-shaped neighborhoods will be modeled and The similarity between them is as follows:
[0180]
[0181] (9)
[0182] in, represents the inner product of two representation vectors, express A row of represents a learnable transformation matrix.
[0183] According to the embodiments of the present disclosure, the transformation matrix can be used to extract the common features between each fan-shaped neighborhood. The larger the first similarity output by the common kernel function, the higher the similarity between the two fan-shaped neighborhoods. Based on the first similarity, the common features can be extracted from other fan-shaped neighborhoods. Extract useful common features from the representation to better learn a fan-shaped neighborhood The expression is as follows:
[0184] (10)
[0185] Among them, the coefficient Indicates the similarity between fan-shaped neighborhoods. After the above process, we can use To represent the fan-shaped neighborhood representation matrix enhanced by common features, the fan-shaped neighborhood representation matrix represents the matrix of the first feature.
[0186] According to the embodiment of the present disclosure, in the case of distance dimension division, each target neighborhood can be a ring, or a Parameterized commonality kernel function To extract useful common features between different rings and obtain an enhanced ring representation matrix , the ring characterization matrix represents the matrix of the first feature.
[0187] According to the embodiments of the present disclosure, by enhancing the common features of each target neighborhood, the central node can better learn the common features of each target neighborhood.
[0188] According to an embodiment of the present disclosure, based on the initial features of each target neighborhood and the features of the central node, the difference features between each target neighborhood are enhanced to obtain the second features of each target neighborhood, which may include the following operations: based on the initial features of each target neighborhood, the second similarities between each target neighborhood and the first difference features between each target neighborhood are calculated respectively. Based on the initial features of each target neighborhood and the features of the central node, the third similarities between each target neighborhood and the central node and the second difference features between each target neighborhood and the central node are calculated respectively. Based on each second similarity, each first difference feature, each third similarity and each second difference feature, each second feature is obtained.
[0189] According to an embodiment of the present disclosure, the second similarity between the target neighborhoods may be calculated based on the initial features of the target neighborhoods. The first difference features between the target neighborhoods may be calculated based on the initial features of the target neighborhoods.
[0190] According to an embodiment of the present disclosure, the third similarity between each target neighborhood and the central node can be calculated based on the initial features of each target neighborhood and the features of the central node. The second difference features between each target neighborhood and the central node can be calculated based on the initial features of each target neighborhood and the features of the central node.
[0191] According to the embodiments of the present disclosure, each second feature may be obtained according to each second similarity, each first difference feature, each third similarity and each second difference feature.
[0192] According to an embodiment of the present disclosure, a difference kernel function can be used to capture the dissimilarities between a central node and multiple target neighborhoods or multiple target neighborhoods. In the case of directional dimension division, each target neighborhood can be a fan-shaped neighborhood, and the difference kernel function is as follows (11):
[0193] (11)
[0194] in, and Represents two learnable transformations for extracting fan-shaped neighborhoods Relative to the fan-shaped neighborhood difference.
[0195] According to an embodiment of the present disclosure, the difference kernel function can be regarded as calculating the dissimilarity of two input vectors, that is, the greater the difference between the two fan-shaped neighborhoods, the lower the similarity of the difference kernel function output. When representing, other fan-shaped neighborhoods will be perceived Useful difference features in , and aggregate them according to this difference measure to enhance The representation of is as follows formula (12):
[0196] (12)
[0197] According to an embodiment of the present disclosure, the obtained fan-shaped neighborhood representation can be used express.
[0198] According to the embodiment of the present disclosure, in the case of the distance dimension, each target neighborhood can be a ring, and the ring representation learning can also define a difference kernel function ,use and To extract the difference information between rings and generate enhanced ring representation .
[0199] According to an embodiment of the present disclosure, the third similarity between the central node and each target neighborhood and the second similarity between each target neighborhood feature may not be equal.
[0200] According to the embodiments of the present disclosure, by enhancing the difference characteristics of each target neighborhood, the central node can better learn the difference characteristics of each target neighborhood to adapt to the spatial heterogeneity of each node in the city map.
[0201] According to an embodiment of the present disclosure, obtaining enhanced features of each target neighborhood based on each first feature and each second feature may include the following operations: weighting each first feature and each second feature respectively according to a predetermined proportional coefficient to obtain each enhanced feature.
[0202] According to an embodiment of the present disclosure, the predetermined scale factor may be a scale factor set according to demand. In various application scenarios, different urban entities on a city map may have different degrees of spatial heterogeneity, and each first feature and each second feature may be weighted according to the predetermined scale factor to obtain each enhanced feature.
[0203] According to the embodiments of the present disclosure, each first feature and each second feature may be weighted according to a predetermined proportional coefficient to obtain each enhanced feature, thereby improving the representation of spatial heterogeneity among urban entities.
[0204] Due to the spatial diversity between neighbor nodes in the city map, the difference distribution of each target neighborhood relative to the central node is not the same. Therefore, when weighting the commonality enhancement features and the difference enhancement features, the parameters of adaptive learning can be referenced to learn the importance between the commonality information and the difference information, and the commonality enhancement features and the difference enhancement features can be weighted according to the learned importance ratio between the commonality information and the difference information.
[0205] For example, obtaining enhanced features of each target neighborhood according to each first feature and each second feature may include the following operations: calculating a target ratio parameter according to each first feature, each second feature and the feature of the central node. According to the target ratio parameter, weighting each first feature and each second feature respectively to obtain each enhanced feature.
[0206] According to an embodiment of the present disclosure, the target ratio parameter may characterize the ratio between the first feature and the second feature in each target neighborhood. The target ratio parameter may be calculated based on the features of each first feature, each second feature and the central node.
[0207] According to an embodiment of the present disclosure, each first feature and each second feature can be weighted according to a target ratio parameter to obtain each enhanced feature, and an attention gating mechanism can be used to adaptively learn the importance of the first feature and the second feature in an end-to-end manner.
[0208] According to the embodiment of the present disclosure, in the case of directional dimension division, the target scale parameter can be generated by splicing the representations of each fan-shaped neighborhood and then using this as input through a transformation matrix. , as follows formula (13):
[0209] (13)
[0210] in, represents the transformation matrix that produces the target scale parameters, Represents the Sigmoid function, which is used to limit the range of the output target ratio parameter to (0,1). The target ratio parameter will control the ratio of the first feature to the second feature. The first feature and the second feature are combined according to their importance to update the representation vector of the fan-shaped neighborhood, as shown in the following formula (14):
[0211] (14)
[0212] in, Hadamard product
[0213] According to an embodiment of the present disclosure, the target ratio parameter Broadcast to and and Same dimensions.
[0214] According to an embodiment of the present disclosure, in the case of distance dimension division, another target ratio parameter can also be learned to generate To control the ratio of the first feature and the second feature in the ring representation vector, the ring representation of the final enhanced feature is obtained. .
[0215] According to the embodiments of the present disclosure, the target ratio parameter is calculated based on the features of each first feature, each second feature and the central node, and the importance between common information and difference information is learned. Therefore, the accuracy of feature representation can be further improved.
[0216] Based on the above description, the target relationship graph can be divided from the direction dimension and the distance dimension respectively, and the common features and difference features of the fan-shaped neighborhood and the ring neighborhood obtained by the division are enhanced respectively, so as to realize the spatial interaction of heterogeneity perception between the nodes in the city map. Therefore, the initial features of the central node can be updated together based on the spatial interaction results of heterogeneity perception in the direction dimension and the distance dimension to improve the accuracy of the feature representation of the central node.
[0217] For example, updating the initial features of the central node according to the enhanced features of each target neighborhood to obtain the target feature may include the following operations: obtaining the target enhanced feature according to the enhanced features of each first target neighborhood and the enhanced features of each second target neighborhood. Concatenating the target enhanced feature with the initial features of the central node to obtain the target feature.
[0218] According to an embodiment of the present disclosure, the enhanced features may include enhanced features of a first target neighborhood and enhanced features of a second target neighborhood. The first target neighborhood and the second target neighborhood have different shapes. For example, the first target neighborhood may be a fan-shaped neighborhood, and the second target neighborhood may be a ring.
[0219] According to an embodiment of the present disclosure, a target enhanced feature can be obtained based on the enhanced features of each first target neighborhood and the enhanced features of each second target neighborhood, and the target enhanced feature is concatenated with the initial feature of the central node to obtain the target feature.
[0220] According to the embodiments of the present disclosure, after the interaction process between the target neighborhoods, each target neighborhood can contain the first feature within each target neighborhood and the diverse second features between the target neighborhoods. The representation vectors of each target neighborhood (sector neighborhood / ring) are spliced together to obtain the overall representation in two spatial dimensions. Unlike the general GNN model, the fusion is performed by summing or averaging. Instead, splicing is used to ensure that different target neighborhoods can be distinguished to avoid mixing the difference distribution with spatial diversity, as shown in the following formula (15):
[0221] (15)
[0222] in, and They are used to integrate the representations of different target neighborhoods in the case of direction dimension partitioning and distance dimension partitioning, and project them into the same space.
[0223] According to an embodiment of the present disclosure, the above formula (15) can be simplified by using two functions of the following formula (16):
[0224]
[0225] (16)
[0226] in, Represents the learning process under the direction dimension partitioning. It represents the learning process under the distance dimension division.
[0227] According to an embodiment of the present disclosure, a learnable weighted sum can be used to fuse the first feature and the second feature obtained in the case of direction dimension division and distance dimension division, and update the representation of the central node, as shown in the following formula (17):
[0228] (17)
[0229] in, Represents the target scale parameter.
[0230] According to the embodiments of the present disclosure, by concatenating the target enhancement features with the initial features of the central node, the perception ability of the graph neural network to spatial heterogeneity is improved compared to the conventional neural network in the related art which fuses the target enhancement features and the initial features of the central node by summing or averaging.
[0231] According to an embodiment of the present disclosure, obtaining a target enhancement feature based on the enhancement features of each first target neighborhood and the enhancement features of each second target neighborhood may include the following operations: weighting the enhancement features of each first target neighborhood and the enhancement features of each second target neighborhood according to a predetermined weight parameter to obtain the target enhancement feature.
[0232] According to an embodiment of the present disclosure, the predetermined weight parameter may be a weight parameter pre-set according to demand.
[0233] For example, the predetermined weight parameters of the enhanced features in the direction dimension and the enhanced features in the distance dimension may both be 50%. The enhanced features of each first target neighborhood and the enhanced features of each second target neighborhood may be weighted according to the predetermined weight parameters to obtain the target enhanced features.
[0234] According to the embodiments of the present disclosure, the enhanced features of the directional dimension and the enhanced features of the distance dimension are comprehensively considered, which can improve the graph neural network's perception of the spatial heterogeneity of the central node, thereby outputting more accurate central node features to improve the accuracy of the region type.
[0235] According to an embodiment of the present disclosure, obtaining a target enhancement feature based on the enhancement features of each first target neighborhood and the enhancement features of each second target neighborhood may include the following operations: weighting the enhancement features of each first target neighborhood and the enhancement features of each second target neighborhood according to a target weight parameter to obtain a target enhancement feature.
[0236] According to an embodiment of the present disclosure, the target weight parameter can be obtained by training the graph neural network by using the regional type information of the city entity corresponding to the target node in the target relationship graph of the task to be processed as a label.
[0237] According to an embodiment of the present disclosure, the weight parameters are used as learnable parameters, and target weight parameters adapted to the target relationship graph and the task to be processed are obtained during the graph neural network training process. The enhanced features of each first target neighborhood and the enhanced features of each second target neighborhood are then weighted to obtain more accurate target enhanced features.
[0238] Figure 8 A flowchart of a method for training a graph neural network according to an embodiment of the present disclosure is schematically shown.
[0239] like Figure 8 As shown, the method 800 includes operations S810 to S850.
[0240] In operation S810, a partitioning module is used to partition the target relationship graph based on sample partitioning parameters to obtain multiple first sample target neighborhoods, each of which includes at least one sample neighbor node; the target relationship graph includes multiple nodes representing various types of entity regions.
[0241] In operation S8820, a feature updating module is used to update the initial features of the sample center node based on the respective sample initial features of each first sample target neighborhood to obtain the sample target features.
[0242] In operation S830, a feature recognition module is used to recognize the sample target feature and generate first area type information of the city entity corresponding to the sample center node;
[0243] In operation S840, based on the target loss function, a first loss value is obtained according to the first region type information and the label of the sample center node, where the label is the region type information of the sample center node;
[0244] In operation S850, model parameters of the graph neural network are adjusted based on the first loss value to obtain a trained graph neural network.
[0245] According to an embodiment of the present disclosure, a graph neural network may include: a partitioning module, a feature aggregation module, a feature updating module and a feature recognition module.
[0246] According to an embodiment of the present disclosure, the feature aggregation module may be used to perform feature aggregation on sample neighbor nodes within each first sample target neighborhood to obtain respective sample initial features of each first sample target neighborhood.
[0247] According to the embodiments of the present disclosure, a series of learnable sample partition parameters (PartitionParameters) can be introduced To assign a weight to each operation, representing the importance of the operation. After the search, the operation with the maximum matching probability will be selected to obtain the final partitioning scheme, called is the partitioning scheme (code). represents the model parameters, the goal of the search process can be expressed as jointly learning the sample partition parameters and model parameters , is a bi-level optimization problem as shown in formula (18):
[0248]
[0249] (18)
[0250] in, and represents the loss function calculated on the training set and the validation set. The goal of the optimization process is to find a partitioning scheme that minimizes the validation set loss. , and based on this partitioning scheme, learn the model parameters that minimize the loss of the training set .
[0251] According to an embodiment of the present disclosure, the partitioning parameters Contains two parts ,in Determines the operations related to the partitioning of the fan-shaped neighborhood in the direction dimension, Determine the operations related to the ring partitioning of the distance dimension. Specifically, taking the direction dimension partitioning as an example, the number of fan-shaped neighborhoods determines the level, The sample partitioning parameter association, used to determine Select what operation to perform. Adjust the level at the boundary of the fan-shaped neighborhood. For the initial division, include The initial neighborhood of the fan-shaped neighborhood, introducing parameters To control each edge The possible rotation operation is Strip edge ,there will be . And so on, for all possible The initial neighborhood of a fan-shaped neighborhood will have { To control the rotation operation of each sector neighborhood boundary. In general, in order to search for sector neighborhood partitioning schemes, the sample partitioning parameters include Similarly, for the search of ring partitioning schemes, another set of partitioning parameters will be defined .
[0252] According to an embodiment of the present disclosure, in each iteration of the search phase, each edge in TCP will be divided according to the sample parameters The discrete probability distribution defined by the operator is sampled as an operation. Specifically, taking the direction dimension division as an example, Represents a set of sampling results, where express The sampling operation. Let each edge be sampled independently, and the sampling probability is calculated by the partitioning parameter about the edge, as shown in the following formula (19):
[0253] (19)
[0254] in, and represents different operations and sample partitioning parameters on different sides of TCP, Indicates operation The corresponding sample partitioning parameters.
[0255] According to an embodiment of the present disclosure, The sampling probability , The set of operations will be divided from the initial fan-shaped neighborhood The sample partitioning parameters are obtained by sampling Refers to . In the calculation side The sampling probability hour, is the set of fan-shaped neighborhood rotation operations Operations in, sample partitioning parameters Refers to Based on this, the sampling results are obtained The matching probability can be calculated as follows (20):
[0256] (20)
[0257] According to an embodiment of the present disclosure, based on the sampling results , a corresponding fan-shaped neighborhood partitioning scheme can be obtained from the search space through TCP SHGL will use this as input to group neighbors, and the above formula (16) can be rewritten as the following formula (21):
[0258] (twenty one)
[0259] in, Indicates a value A discrete random variable, and only if the sampling result is When the value is , and the value is 0 in other cases.
[0260] According to the embodiment of the present disclosure, in the case of distance dimension division, it can be used Represents the sampling result based on TCP, and the sampling probability is This will give the corresponding partitioning scheme , is applied by SHGL as follows (22):
[0261] (twenty two)
[0262] in, Only when the sampling result is When the value is , and the value is 0 in other cases.
[0263] According to an embodiment of the present disclosure, the output of the graph neural network can be obtained according to the above formula (22), and the loss function can be calculated to solve the optimization problem, thereby achieving accurate prediction of urban area types.
[0264] According to the embodiments of the present disclosure, for the tasks to be processed, the target relationship graph and the labels corresponding to the target nodes are used to perform semi-supervised training on the graph neural network. During the training process, the model parameters are continuously adjusted to improve the adaptability of the model processing capability and the target relationship graph. In addition, the target partitioning parameters that match the tasks to be processed can be screened out during the training process, thereby improving the processing capability of the graph neural network for urban graphs with spatial heterogeneity.
[0265] According to an embodiment of the present disclosure, adjusting the model parameters of the graph neural network based on the first loss value to obtain a trained graph neural network may include the following operations: based on the first loss value, fixing the model parameters of the feature update module and the model parameters of the feature recognition module, adjusting the sample partitioning parameters of the partitioning module until the first loss value converges to obtain a trained graph neural network; and in response to the convergence of the first loss value, determining the matching probability of each of the multiple candidate partitioning parameters corresponding to the task to be processed for the target relationship graph by statistically analyzing the probability distribution of the sample partitioning parameters among multiple candidate partitioning parameters.
[0266] According to an embodiment of the present disclosure, during the training phase, the partitioning parameters of the feature partitioning module are first adjusted, so that a partitioning scheme that matches the task to be processed can be quickly screened out, thereby improving the training efficiency of the graph neural network.
[0267] According to an embodiment of the present disclosure, the training method of the above-mentioned neural network also includes: in response to the convergence of the first loss value, obtaining an intermediate graph neural network; using the intermediate graph neural network to process the target relationship graph to obtain the second area type information of the urban entity corresponding to the sample center node; based on the loss function, according to the second area type information and the label of the sample center node, obtaining the second loss value; based on the second loss value, fixing the partitioning parameters of the partitioning module, adjusting the model parameters of the feature update module and the model parameters of the feature recognition module, until the second loss value converges to obtain a trained graph neural network.
[0268] According to an embodiment of the present disclosure, when the first loss value converges, further based on the second loss value, the partitioning parameters of the partitioning module are fixed, and the model parameters of the feature updating module and the model parameters of the feature recognition module are adjusted until the second loss value converges, so as to obtain a trained graph neural network and improve the model accuracy.
[0269] According to an embodiment of the present disclosure, when the first loss value converges, the target partitioning parameters that match the target relationship graph and the task to be processed can be determined. At this time, fixing the partitioning parameters and adjusting the parameters of other modules can reduce the number of training rounds and improve the model training efficiency.
[0270] Fig. 9 A block diagram of a device for determining a region type based on graph data according to an embodiment of the present disclosure is schematically shown.
[0271] like Fig. 9 As shown, the device includes a first determination module 910 , a first division module 920 , a first update module 930 and a first generation module 940 .
[0272] The first determination module 910 is used to determine the target partition parameter from multiple candidate partition parameters based on the matching probability of each of the multiple candidate partition parameters with the task to be processed; wherein the matching probability is obtained by training the graph neural network using the area type information corresponding to the target node in the target relationship graph of the task to be processed as a label; the target relationship graph includes multiple nodes representing various types of entity areas.
[0273] The first partitioning module 920 is used to partition the target relationship graph based on the target partitioning parameter to obtain multiple target neighborhoods of the central node, each target neighborhood including at least one neighbor node.
[0274] The first updating module 930 is used to update the initial features of the central node based on the initial features of each target neighborhood to obtain the target features.
[0275] The first generating module 940 is used to identify the target features and generate the region type information of the central node.
[0276] According to an embodiment of the present disclosure, the target partitioning parameters include a neighborhood quantity parameter and a neighborhood boundary adjustment parameter; the first partitioning module 920 includes:
[0277] The first division acquisition submodule is used to divide the target relationship graph into a plurality of initial neighborhoods at equal intervals according to the domain quantity parameter.
[0278] The first adjustment submodule is used to adjust parameters according to neighborhood boundaries, adjust boundaries of multiple initial neighborhoods, and obtain multiple target neighborhoods.
[0279] According to an embodiment of the present disclosure, the first division submodule includes:
[0280] The first determining unit is used to determine the initial direction of the endpoint of the first initial segmentation line for dividing the target relationship graph relative to the central node according to the neighborhood quantity parameter.
[0281] The first division unit is used to divide the target relationship graph into a plurality of first initial neighborhoods at equal intervals along an initial direction using a first initial segmentation line, wherein the plurality of first initial neighborhoods are in a sector shape.
[0282] According to an embodiment of the present disclosure, the neighborhood boundary adjustment parameter includes a direction adjustment parameter and an angle adjustment parameter; the first adjustment submodule includes:
[0283] The second determining unit is used to determine the rotation direction and rotation angle of the boundary of each first target neighborhood relative to each first initial segmentation line according to the direction adjustment parameter and the angle adjustment parameter.
[0284] The first adjustment unit is used to adjust the boundary of each first initial neighborhood according to each rotation direction and each rotation angle to obtain multiple first target neighborhoods.
[0285] According to an embodiment of the present disclosure, the first division submodule includes:
[0286] The third determining unit is used to determine, according to the neighborhood quantity parameter, an initial distance of a second initial segmentation line for dividing the target relationship graph relative to the central node.
[0287] The second division unit is used to divide the target relationship graph into a plurality of second initial neighborhoods at equal intervals according to the initial distance and using a second initial segmentation line, wherein the plurality of second initial neighborhoods are ring-shaped.
[0288] According to an embodiment of the present disclosure, the domain adjustment parameter includes a distance adjustment parameter; the first adjustment acquisition submodule includes:
[0289] The fourth determining unit is used to determine the boundary adjustment distance of each second initial neighborhood according to the distance adjustment parameter.
[0290] The second adjustment unit is used to adjust the boundaries of the second initial neighborhoods according to the boundary adjustment distances corresponding to each second initial neighborhood, so as to obtain a plurality of second target neighborhoods.
[0291] According to an embodiment of the present disclosure, the first updating module 930 includes:
[0292] The common feature enhancement submodule is used to enhance the common features between each target neighborhood according to the initial features of each target neighborhood to obtain the first feature of each target neighborhood.
[0293] The difference feature enhancement submodule is used to enhance the difference features between each target neighborhood according to the initial features of each target neighborhood and the features of the central node, so as to obtain the second features of each target neighborhood.
[0294] The acquisition submodule is used to obtain the enhanced features of each target neighborhood according to each first feature and each second feature.
[0295] The updating submodule is used to update the initial features of the central node according to the enhanced features of each target neighborhood to obtain the target features.
[0296] According to an embodiment of the present disclosure, the common feature enhancer module includes:
[0297] The first calculation unit is used to calculate the first similarity between each target neighborhood according to the initial features of each target neighborhood.
[0298] The first obtaining unit is used to obtain each first feature according to each first similarity and the initial feature of each target neighborhood.
[0299] According to an embodiment of the present disclosure, the difference feature enhancer module includes:
[0300] The second calculation unit is used to calculate the second similarity between each target neighborhood and the first difference feature between each target neighborhood according to the initial feature of each target neighborhood.
[0301] The third calculation unit is used to calculate the third similarity between each target neighborhood and the central node and the second difference feature between each target neighborhood and the central node according to the initial features of each target neighborhood and the features of the central node.
[0302] The second obtaining unit is used to obtain each second feature according to each second similarity, each first difference feature, each third similarity and each second difference feature.
[0303] According to an embodiment of the present disclosure, obtaining a submodule includes:
[0304] The first weighting unit is used to weight each first feature and each second feature according to a predetermined proportional coefficient to obtain each enhanced feature.
[0305] According to an embodiment of the present disclosure, obtaining a submodule includes:
[0306] The fourth calculation unit is used to calculate a target ratio parameter according to the features of each first feature, each second feature and the central node; wherein the target ratio parameter represents the ratio between the first feature and the second feature in each target neighborhood.
[0307] The second weighting unit is used to weight each first feature and each second feature according to the target proportional coefficient to obtain each enhanced feature.
[0308] According to an embodiment of the present disclosure, the enhanced features include: enhanced features of a first target neighborhood and enhanced features of a second target neighborhood; the shapes of the first target neighborhood and the second target neighborhood are different; and the updating submodule includes:
[0309] The third obtaining unit is used to obtain the target enhancement feature according to the enhancement features of each first target neighborhood and the enhancement features of each second target neighborhood.
[0310] The splicing unit is used to splice the target enhanced feature with the initial feature of the central node to obtain the target feature.
[0311] According to an embodiment of the present disclosure, the third obtaining unit includes:
[0312] The first weighting subunit is used to weight the enhanced features of each first target neighborhood and the enhanced features of each second target neighborhood according to a predetermined weight parameter to obtain a target enhanced feature.
[0313] According to an embodiment of the present disclosure, the third obtaining unit includes:
[0314] The second weighted subunit is used to weight the enhanced features of each first target neighborhood and the enhanced features of each second target neighborhood according to the target weight parameter to obtain the target enhanced features; wherein the target weight parameter is obtained by training the graph neural network using the area type information corresponding to the target node in the target relationship graph of the task to be processed as a label.
[0315] Fig.10 A block diagram of a graph neural network training device according to an embodiment of the present disclosure is schematically shown.
[0316] like Fig.10 As shown, the training device of the graph neural network may include a second division module 1010, a second update module 1020, a second generation module 1030, a first loss calculation module 1040 and a first adjustment module 1050.
[0317] According to an embodiment of the present disclosure, the graph neural network includes: a partitioning module, a feature aggregation module, a feature updating module and a feature recognition module.
[0318] The second partitioning module 1010 is used to use the partitioning module to partition the target relationship graph based on the sample partitioning parameters to obtain multiple first sample target neighborhoods, each sample target neighborhood includes at least one sample neighbor node; the target relationship graph includes multiple nodes representing various types of entity areas.
[0319] The second updating module 1020 is used to utilize the feature updating module to update the initial features of the sample center node based on the respective initial features of the samples in each first sample target neighborhood to obtain the sample target features.
[0320] The second generating module 1030 is used to use the feature recognition module to recognize the sample target feature and generate the first region type information of the sample center node.
[0321] The first loss calculation module 1040 is used to obtain a first loss value based on the target loss function according to the first region type information and the label of the sample center node, where the label is the region type information of the sample center node.
[0322] The first adjustment module 1050 is used to adjust the model parameters of the graph neural network based on the first loss value to obtain a trained graph neural network.
[0323] According to an embodiment of the present disclosure, the first adjustment module 1050 includes:
[0324] The second adjustment submodule is used to fix the model parameters of the feature update module and the model parameters of the feature recognition module based on the first loss value, and adjust the sample partitioning parameters of the partitioning module until the first loss value converges to obtain a trained graph neural network.
[0325] A determination submodule is used to determine the matching probability of each of the multiple candidate partition parameters corresponding to the task to be processed for the target relationship graph by statistically analyzing the probability distribution of the sample partition parameter in multiple candidate partition parameters in response to the convergence of the first loss value.
[0326] According to an embodiment of the present disclosure, the above-mentioned graph neural network training device also includes:
[0327] The first acquisition module is used to obtain an intermediate graph neural network in response to the convergence of the first loss value.
[0328] The processing module is used to process the target relationship graph using the intermediate graph neural network to obtain the second region type information corresponding to the sample center node.
[0329] The second loss calculation module is used to obtain a second loss value based on the loss function, the second region type information and the label of the sample center node.
[0330] The second adjustment module is used to fix the partitioning parameters of the partitioning module, adjust the model parameters of the feature updating module and the model parameters of the feature recognition module based on the second loss value, until the second loss value converges to obtain a trained graph neural network.
[0331] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0332] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0333] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.
[0334] According to an embodiment of the present disclosure, a computer program product includes a computer program, and the computer program implements the above method when executed by a processor.
[0335] Fig.11 A block diagram of an electronic device suitable for implementing a method for determining a region type based on graph data according to an embodiment of the present disclosure is schematically shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0336] like Fig.11As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0337] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0338] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as a method for determining a region type based on graph data. For example, in some embodiments, the method for determining a region type based on graph data may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the method for determining a region type based on graph data described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured in any other appropriate manner (eg, by means of firmware) to execute the region type determination method based on graph data.
[0339] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0340] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0341] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0342] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0343] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0344] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.
[0345] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0346] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for determining a region type based on graph data, comprising: Based on the matching probability of each of the multiple candidate partition parameters and the task to be processed, determine the target partition parameter from the multiple candidate partition parameters; wherein the matching probability is obtained by training the graph neural network using the region type information corresponding to the target node in the target relationship graph of the task to be processed as a label; the target relationship graph includes multiple nodes representing each type of entity region; Dividing the target relationship graph based on the target partitioning parameter to obtain multiple target neighborhoods of a central node, each target neighborhood including at least one neighbor node; Based on the initial features of each target neighborhood, the initial features of the central node are updated to obtain the target features; and The target feature is identified to generate the region type information of the central node.
2. The method according to claim 1, wherein: The target partitioning parameters include a neighborhood quantity parameter and a neighborhood boundary adjustment parameter; The target relationship graph is divided based on the target division parameter to obtain a plurality of target neighborhoods, including: Dividing the target relationship graph into a plurality of initial neighborhoods at equal intervals according to the domain quantity parameter; and The boundaries of the multiple initial neighborhoods are adjusted according to the neighborhood boundary adjustment parameter to obtain the multiple target neighborhoods.
3. The method according to claim 2, wherein: The target relationship graph is divided into a plurality of initial neighborhoods at equal intervals according to the domain quantity parameter, including: Determining, according to the neighborhood quantity parameter, an initial direction of an endpoint of a first initial segmentation line for dividing the target relationship graph relative to the central node; Along the initial direction, the target relationship graph is divided into a plurality of first initial neighborhoods at equal intervals using the first initial segmentation line, wherein the plurality of first initial neighborhoods are in a fan shape.
4. The method according to claim 3, wherein: The neighborhood boundary adjustment parameters include direction adjustment parameters and angle adjustment parameters; The adjusting the boundaries of the multiple initial neighborhoods according to the neighborhood boundary adjustment parameter to obtain the multiple target neighborhoods includes: Determining, according to the direction adjustment parameter and the angle adjustment parameter, a rotation direction and a rotation angle of a boundary of each first target neighborhood relative to each first initial segmentation line; and According to each of the rotation directions and each of the rotation angles, the boundary of each of the first initial neighborhoods is adjusted respectively to obtain a plurality of first target neighborhoods.
5. The method according to claim 2, wherein: The target relationship graph is divided into a plurality of initial neighborhoods at equal intervals according to the domain quantity parameter, including: Determining, according to the neighborhood quantity parameter, an initial distance of a second initial segmentation line for dividing the target relationship graph relative to the central node; and According to the initial distance, the target relationship graph is divided into a plurality of second initial neighborhoods at equal intervals using the second initial segmentation line, wherein the plurality of second initial neighborhoods are ring-shaped.
6. The method according to claim 5, wherein: The field adjustment parameters include distance adjustment parameters; The adjusting the boundaries of the multiple initial neighborhoods according to the neighborhood boundary adjustment parameter to obtain the multiple target neighborhoods includes: Determining a boundary adjustment distance of each second initial neighborhood according to the distance adjustment parameter; and According to the boundary adjustment distance corresponding to each second initial neighborhood, the boundaries of the second initial neighborhood are adjusted respectively to obtain multiple second target neighborhoods.
7. The method according to claim 1, wherein: The updating of the initial features of the central node based on the initial features of each target neighborhood to obtain the target features includes: According to the initial features of each of the target neighborhoods, common features between the target neighborhoods are enhanced to obtain the first features of each of the target neighborhoods; According to the initial features of each target neighborhood and the features of the central node, the difference features between the target neighborhoods are enhanced to obtain the second features of each target neighborhood; Obtaining enhanced features of each of the target neighborhoods according to each of the first features and each of the second features; and The initial features of the central node are updated according to the enhanced features of each of the target neighborhoods to obtain the target features.
8. The method according to claim 7, wherein: The step of enhancing the common features between the target neighborhoods according to the initial features of the target neighborhoods to obtain the first features of the target neighborhoods includes: Calculating a first similarity between each of the target neighborhoods according to the initial features of each of the target neighborhoods; and The first features are obtained according to the first similarities and the initial features of the target neighborhoods.
9. The method according to claim 7, wherein: The step of enhancing the difference features between the target neighborhoods according to the initial features of the target neighborhoods and the features of the central node to obtain the second features of the target neighborhoods includes: According to the initial features of each of the target neighborhoods, respectively calculating the second similarities between each of the target neighborhoods and the first difference features between each of the target neighborhoods; According to the initial features of each of the target neighborhoods and the features of the central node, respectively calculating the third similarity between each of the target neighborhoods and the central node and the second difference features between each of the target neighborhoods and the central node; and The second features are obtained according to the second similarities, the first difference features, the third similarities and the second difference features.
10. The method according to claim 7, wherein: The step of obtaining enhanced features of each target neighborhood according to each of the first features and each of the second features includes: The first features and the second features are weighted respectively according to a predetermined proportional coefficient to obtain the enhanced features.
11. The method according to claim 7, wherein: The step of obtaining enhanced features of each target neighborhood according to each of the first features and each of the second features includes: Calculating a target ratio parameter according to the features of each of the first features, each of the second features, and the central node; wherein the target ratio parameter represents the ratio between the first feature and the second feature in each of the target neighborhoods; and According to the target proportional coefficient, each of the first features and each of the second features are weighted respectively to obtain each of the enhanced features.
12. The method according to claim 7, wherein: The enhanced features include: enhanced features of a first target neighborhood and enhanced features of a second target neighborhood; the first target neighborhood and the second target neighborhood have different shapes; The updating of the initial features of the central node according to the enhanced features of each of the target neighborhoods to obtain the target features includes: Obtaining a target enhancement feature according to the enhancement features of each of the first target neighborhoods and the enhancement features of each of the second target neighborhoods; and The target enhanced feature is concatenated with the initial feature of the central node to obtain the target feature.
13. The method according to claim 12, wherein: The obtaining target enhancement features according to the enhancement features of each of the first target neighborhoods and the enhancement features of each of the second target neighborhoods comprises: The enhanced features of each of the first target neighborhoods and the enhanced features of each of the second target neighborhoods are weighted according to a predetermined weight parameter to obtain the target enhanced features.
14. The method according to claim 12, wherein: The obtaining target enhancement features according to the enhancement features of each of the first target neighborhoods and the enhancement features of each of the second target neighborhoods comprises: According to the target weight parameter, the enhanced features of each of the first target neighborhoods and the enhanced features of each of the second target neighborhoods are weighted to obtain the target enhanced features; wherein the target weight parameter is obtained by training the graph neural network using the area type information corresponding to the target node in the target relationship graph of the task to be processed as a label.
15. A method for training a graph neural network, the graph neural network comprising: Division module, feature aggregation module, feature update module and feature recognition module; The method comprises: Using the partitioning module, the target relationship graph is partitioned based on the sample partitioning parameters to obtain a plurality of first sample target neighborhoods, each of which includes at least one sample neighbor node; the target relationship graph includes a plurality of nodes representing various types of entity regions; Using the feature updating module to update the initial features of the sample center node based on the respective initial features of the samples of each of the first sample target neighborhoods to obtain sample target features; Using the feature recognition module to recognize the sample target feature and generate first region type information of the sample center node; Based on the target loss function, obtaining a first loss value according to the first region type information and the label of the sample center node, wherein the label is the region type information of the sample center node; and The model parameters of the graph neural network are adjusted based on the first loss value to obtain a trained graph neural network.
16. The method according to claim 15, wherein: The adjusting the model parameters of the graph neural network based on the first loss value to obtain a trained graph neural network includes: Based on the first loss value, fixing the model parameters of the feature updating module and the model parameters of the feature recognition module, and adjusting the sample partitioning parameters of the partitioning module until the first loss value converges, thereby obtaining the trained graph neural network; and In response to the convergence of the first loss value, the probability distribution of the sample partition parameter in multiple candidate partition parameters is statistically analyzed to determine the matching probability of each of the multiple candidate partition parameters corresponding to the task to be processed for the target relationship graph.
17. The method according to claim 16, further comprising: In response to the first loss value converging, obtaining an intermediate graph neural network; Processing the target relationship graph using the intermediate graph neural network to obtain second region type information corresponding to the sample center node; Based on the loss function, obtaining a second loss value according to the second region type information and the label of the sample center node; and Based on the second loss value, the partitioning parameters of the partitioning module are fixed, and the model parameters of the feature updating module and the model parameters of the feature recognition module are adjusted until the second loss value converges to obtain the trained graph neural network.
18. A device for determining a region type based on graph data, comprising: A first determination module is used to determine a target partition parameter from a plurality of candidate partition parameters based on a matching probability between each of the plurality of candidate partition parameters and the task to be processed; wherein the matching probability is obtained by training a graph neural network using region type information corresponding to a target node in a target relationship graph for the task to be processed as a label; the target relationship graph includes a plurality of nodes representing various types of entity regions; A first partitioning module is used to partition the target relationship graph based on the target partitioning parameter to obtain multiple target neighborhoods of a central node, each target neighborhood including at least one neighbor node; A first updating module is used to update the initial features of the central node based on the initial features of each target neighborhood to obtain the target features; and The first generating module is used to identify the target feature and generate the area type information of the central node.
19. The device according to claim 18, wherein The target partitioning parameters include a neighborhood quantity parameter and a neighborhood boundary adjustment parameter; The first division module includes: A first division submodule, used for dividing the target relationship graph into a plurality of initial neighborhoods at equal intervals according to the domain quantity parameter; as well as The first adjustment submodule is used to adjust the boundaries of the multiple initial neighborhoods according to the neighborhood boundary adjustment parameters to obtain the multiple target neighborhoods.
20. The device according to claim 19, wherein The first division submodule includes: A first determining unit, configured to determine, according to the neighborhood quantity parameter, an initial direction of an endpoint of a first initial segmentation line for dividing the target relationship graph relative to the central node; The first dividing unit is used to divide the target relationship graph into a plurality of first initial neighborhoods at equal intervals along the initial direction using the first initial segmentation line, wherein the plurality of first initial neighborhoods are fan-shaped.
21. The device according to claim 20, wherein: The neighborhood boundary adjustment parameters include direction adjustment parameters and angle adjustment parameters; The first adjustment submodule includes: A second determining unit, configured to determine, according to the direction adjustment parameter and the angle adjustment parameter, a rotation direction and a rotation angle of a boundary of each first target neighborhood relative to each first initial segmentation line; as well as The first adjustment unit is used to adjust the boundary of each of the first initial neighborhoods according to each of the rotation directions and each of the rotation angles to obtain multiple first target neighborhoods.
22. The device according to claim 19, wherein The first division submodule includes: A third determining unit is used to determine, according to the neighborhood quantity parameter, an initial distance of a second initial segmentation line for dividing the target relationship graph relative to the central node; and The second dividing unit is used to divide the target relationship graph into a plurality of second initial neighborhoods at equal intervals according to the initial distance and using the second initial dividing line, wherein the plurality of second initial neighborhoods are ring-shaped.
23. The device according to claim 22, wherein: The field adjustment parameters include distance adjustment parameters; The first adjustment submodule includes: a fourth determining unit, configured to determine a boundary adjustment distance of each second initial neighborhood according to the distance adjustment parameter; as well as The second adjustment unit is used to adjust the boundaries of each second initial neighborhood according to the boundary adjustment distance corresponding to each second initial neighborhood, so as to obtain multiple second target neighborhoods.
24. The device according to claim 18, wherein The first update module includes: A common feature enhancement submodule, used for enhancing the common features between the target neighborhoods according to the initial features of the target neighborhoods to obtain the first features of the target neighborhoods; A difference feature enhancement submodule, used to enhance the difference features between the target neighborhoods according to the initial features of the target neighborhoods and the features of the central node, so as to obtain the second features of the target neighborhoods; an obtaining submodule, configured to obtain an enhanced feature of each of the target neighborhoods according to each of the first features and each of the second features; and The updating submodule is used to update the initial features of the central node according to the enhanced features of each target neighborhood to obtain the target feature.
25. The device according to claim 24, wherein: The common feature enhancer module comprises: A first calculation unit, configured to calculate a first similarity between each of the target neighborhoods according to an initial feature of each of the target neighborhoods; and The first obtaining unit is used to obtain each of the first features according to each of the first similarities and the initial features of each of the target neighborhoods.
26. The device according to claim 24, wherein: The differential feature enhancer module comprises: A second calculation unit, used for respectively calculating the second similarity between each of the target neighborhoods and the first difference feature between each of the target neighborhoods according to the initial feature of each of the target neighborhoods; a third calculation unit, configured to calculate, according to the initial features of each of the target neighborhoods and the features of the central node, a third similarity between each of the target neighborhoods and the central node and a second difference feature between each of the target neighborhoods and the central node; and The second obtaining unit is configured to obtain the second features according to the second similarities, the first difference features, the third similarities and the second difference features.
27. The device according to claim 24, wherein: The obtaining submodule comprises: The first weighting unit is used to weight each of the first features and each of the second features according to a predetermined proportional coefficient to obtain each of the enhanced features.
28. The device according to claim 24, wherein: The obtaining submodule comprises: a fourth calculation unit, configured to calculate a target ratio parameter according to the features of each of the first features, each of the second features, and the central node; wherein the target ratio parameter represents the ratio between the first feature and the second feature in each of the target neighborhoods; and The second weighting unit is used to weight each of the first features and each of the second features according to the target proportional coefficient to obtain each of the enhanced features.
29. The device according to claim 24, wherein: The enhanced features include: enhanced features of a first target neighborhood and enhanced features of a second target neighborhood; the first target neighborhood and the second target neighborhood have different shapes; the updating submodule includes: a third obtaining unit, configured to obtain a target enhancement feature according to the enhancement features of each of the first target neighborhoods and the enhancement features of each of the second target neighborhoods; and The splicing unit is used to splice the target enhanced feature with the initial feature of the central node to obtain the target feature.
30. The device according to claim 29, wherein: The third obtaining unit comprises: The first weighting subunit is used to weight the enhanced features of each of the first target neighborhoods and the enhanced features of each of the second target neighborhoods according to a predetermined weight parameter to obtain the target enhanced features.
31. The device according to claim 29, wherein: The third obtaining unit comprises: The second weighted subunit is used to weight the enhanced features of each of the first target neighborhoods and the enhanced features of each of the second target neighborhoods according to a target weight parameter to obtain the target enhanced features; wherein the target weight parameter is obtained by training the graph neural network using the area type information corresponding to the target node in the target relationship graph of the task to be processed as a label.
32. A training device for a graph neural network, the graph neural network comprising: Division module, feature aggregation module, feature update module and feature recognition module; The device comprises: A second partitioning module is used to partition the target relationship graph based on the sample partitioning parameters using the partitioning module to obtain a plurality of first sample target neighborhoods, each of which includes at least one sample neighbor node; the target relationship graph includes a plurality of nodes representing various types of entity regions; A second updating module, used for using the feature updating module to update the initial features of the sample center node based on the respective initial sample features of each of the first sample target neighborhoods to obtain sample target features; A second generating module, used for using the feature recognition module to recognize the sample target feature and generate the first region type information of the sample center node; A first loss calculation module, configured to obtain a first loss value based on a target loss function and according to the first region type information and a label of the sample center node, wherein the label is the region type information of the sample center node; and The first adjustment module is used to adjust the model parameters of the graph neural network based on the first loss value to obtain a trained graph neural network.
33. The device according to claim 32, wherein: The first adjustment module includes: a second adjustment submodule, configured to fix, based on the first loss value, the model parameters of the feature updating module and the model parameters of the feature identification module, and adjust the sample partitioning parameters of the partitioning module until the first loss value converges to obtain the trained graph neural network; and A determination submodule is used to determine, in response to the convergence of the first loss value, the matching probability corresponding to the task to be processed for the target relationship graph by statistically analyzing the probability distribution of the sample partition parameter in multiple candidate partition parameters.
34. The apparatus of claim 33, further comprising: A first acquisition module, configured to obtain an intermediate graph neural network in response to convergence of the first loss value; A processing module, used to process the target relationship graph using the intermediate graph neural network to obtain second region type information corresponding to the sample center node; A second loss calculation module, configured to obtain a second loss value based on the loss function and according to the second region type information and the label of the sample center node; as well as The second adjustment module is used to fix the partitioning parameters of the partitioning module, adjust the model parameters of the feature updating module and the model parameters of the feature recognition module based on the second loss value, until the second loss value converges to obtain the trained graph neural network.
35. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-14 or 15-17.
36. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-14 or 15-17.
37. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-14 or 15-17.
Citation Information
Cited By
Graph neural network-oriented block-based graph data partitioning method and system
CN120086024A
