Processing method and device
By constructing an encoder combined with Gaussian cloud distribution information, the problem of insufficient utilization of the real distribution of heterogeneous graphs is solved, and the accurate representation of low-dimensional vectors of heterogeneous graphs and efficient execution of downstream tasks is achieved.
Patent Information
- Application Number
- CN202510534010.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
The existing technology is difficult to effectively utilize the real distribution information of heterogeneous graphs, which leads to the low-dimensional embedding of graph nodes learned by the model that does not conform to the real situation, affecting the accuracy of graph network tasks.
By constructing an encoder, combining Gaussian cloud distribution information, the low-dimensional vector representation of the heterogeneous graph is determined, and the neural network is used to estimate the Gaussian cloud distribution parameters to enhance the utilization of the global data distribution characteristics of the heterogeneous graph.
The accuracy and quality of heterogeneous graph vector representation is improved, the robustness of the model is enhanced, the accuracy of downstream tasks is maintained, and the learning loss is reduced.
Smart Images

Figure CN120449926A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of graph deep learning technology, and in particular relates to a processing method and device. Background Art
[0002] In recent years, the popularity of graph neural networks has enabled many graph algorithms to achieve excellent results in preserving the structural and semantic features of the network. However, how to effectively model real complex and heterogeneous graphs to perform various downstream network tasks remains a challenge. Summary of the Invention
[0003] To this end, this application discloses the following technical solutions:
[0004] A processing method comprising:
[0005] Obtaining a heterogeneous graph to be processed;
[0006] Determining graph structure data of the heterogeneous graph;
[0007] Determining Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data;
[0008] Based on the Gaussian cloud distribution information, low-dimensional vectors corresponding to respective nodes in the heterogeneous graph are determined, so as to perform a graph network task for the heterogeneous graph based on the low-dimensional vectors.
[0009] Optionally, determining the graph structure data of the heterogeneous graph includes:
[0010] Determine substructure data corresponding to the heterogeneous graph at different semantic angles;
[0011] The substructure data corresponding to the heterogeneous graph at different semantic angles are fused to obtain the graph structure data of the heterogeneous graph.
[0012] Optionally, determining the substructure data corresponding to the heterogeneous graph at different semantic perspectives includes:
[0013] Initialize multiple different meta-paths; different meta-paths correspond to different semantic patterns and are used to represent different semantic perspectives;
[0014] Based on the semantic pattern of each meta-path, a random walk is performed in the heterogeneous graph to obtain a heterogeneous graph node sequence corresponding to each meta-path;
[0015] Converting the heterogeneous graph node sequence corresponding to each meta-path into a sub-adjacency matrix; the sub-adjacency matrix converted from the heterogeneous graph node sequence corresponding to each meta-path includes: adjacency relationship information between different nodes in the heterogeneous graph under the semantic perspective corresponding to the meta-path;
[0016] The fusing of the substructure data corresponding to different semantic angles of the heterogeneous graph to obtain the graph structure data of the heterogeneous graph includes:
[0017] The sub-adjacency matrices converted from the heterogeneous graph node sequences corresponding to the respective meta-paths are fused to obtain a heterogeneous adjacency matrix corresponding to the heterogeneous graph;
[0018] The graph structure data of the heterogeneous graph includes the heterogeneous adjacency matrix; the substructure data corresponding to the heterogeneous graph at different semantic angles include sub-adjacency matrices obtained by converting the heterogeneous graph node sequences corresponding to each meta-path into sub-adjacency matrices.
[0019] Optionally, determining Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data includes:
[0020] The graph structure data is input into an encoder so as to estimate Gaussian cloud distribution parameters of the heterogeneous graph through a neural network using the encoder.
[0021] Optionally, the estimating the Gaussian cloud distribution parameters of the heterogeneous graph by using the encoder through a neural network includes:
[0022] The encoder estimates Gaussian cloud distribution parameters of the heterogeneous graph through a single layer in a multilayer perceptron.
[0023] Optionally, determining the low-dimensional vectors corresponding to the respective nodes in the heterogeneous graph based on the Gaussian cloud distribution information includes:
[0024] Based on the Gaussian cloud distribution parameters, sampling processing is performed on each node in the heterogeneous graph to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph.
[0025] Optionally, the Gaussian cloud distribution parameters include expectation, entropy and hyperentropy;
[0026] The performing sampling processing on each node in the heterogeneous graph based on the Gaussian cloud distribution information includes:
[0027] The forward cloud generator algorithm based on the cloud model obtains random numbers by sampling from the first Gaussian distribution;
[0028] Sampling each node in the heterogeneous graph in a second Gaussian distribution to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph;
[0029] Among them, the mean and variance corresponding to the first Gaussian distribution are the squares of the entropy and the super entropy respectively, and the mean and variance corresponding to the second Gaussian distribution are the squares of the expectation and the random number respectively.
[0030] Optionally, the encoder construction process includes:
[0031] Obtain heterogeneous graph samples;
[0032] Determining first graph structure data of the heterogeneous graph sample;
[0033] Determine, using an encoder, Gaussian cloud distribution information of the heterogeneous graph sample based on the first graph structure data, determine low-dimensional vectors corresponding to respective nodes in the heterogeneous graph sample based on the Gaussian cloud distribution information of the heterogeneous graph sample, and constrain the prior distribution of the low-dimensional vectors to be a Gaussian cloud distribution;
[0034] Decoding the low-dimensional vectors corresponding to the nodes in the heterogeneous graph sample using a decoder to obtain second graph structure data;
[0035] Parameters of a processing model are adjusted based on the model loss until a model convergence condition of the processing model is met; the processing model includes the encoder and the decoder.
[0036] Optionally, the model loss includes a reconstruction loss between the second graph structure data and the first graph structure data, and a KL divergence loss constrained by a Gaussian cloud distribution in a latent space.
[0037] A processing device, comprising:
[0038] An acquisition module, used to obtain the heterogeneous graph to be processed;
[0039] A first determining module, configured to determine graph structure data of the heterogeneous graph;
[0040] A second determining module is configured to determine Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data;
[0041] The third determination module is used to determine the low-dimensional vectors corresponding to each node in the heterogeneous graph based on the Gaussian cloud distribution information, so as to perform the graph network task for the heterogeneous graph based on the low-dimensional vectors.
[0042] An electronic device comprising at least:
[0043] Memory, used to store computer instruction sets;
[0044] The processor is configured to implement any one of the above processing methods by executing the computer instruction set in the memory.
[0045] A storage medium carries one or more computer instruction sets, which, when executed by an electronic device, can enable the electronic device to implement any of the processing methods described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0047] Figure 1 This is a schematic diagram of the encoder construction process provided by this application;
[0048] Figure 2(a) and Figure 2(b) are the distribution characteristic diagrams of Gaussian distribution and Gaussian cloud distribution, respectively;
[0049] Figure 3 This is the model framework and encoding and decoding diagram provided by this application;
[0050] Figure 4 This is the overall implementation flow chart of the model training provided by this application and obtaining low-dimensional vector representations of graph nodes based on the encoder model to perform downstream tasks;
[0051] Figure 5 This is a schematic diagram of the distribution change of a heterogeneous graph before and after deleting some edges in the heterogeneous graph provided by the present application;
[0052] Figure 6 It is a flowchart of the processing method provided by this application;
[0053] Figure 7(a)-Figure 7(h) They are respectively schematic diagrams of the visualization results of the dimensionality reduction of heterogeneous graph node vector representations learned by various graph data representation algorithms in related technologies;
[0054] FIG7(i) is a schematic diagram of the visualization result of the dimensionality reduction of the heterogeneous graph node vector representation learned by the present application solution;
[0055] Figure 8 This is a schematic diagram comparing the visualization results of the sampling space corresponding to the related technology provided by this application and the solution of this application;
[0056] Figure 9 It is a structural diagram of the processing device provided by this application;
[0057] Figure 10 This is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0059] A heterogeneous graph, also known as a heterogeneous graph, can also be called a heterogeneous information network or heterogeneous information network. Unlike homogeneous graphs, heterogeneous graphs are graph data structures with multiple node or edge types. They are used to depict complex, heterogeneous objects and their interactions. They contain rich semantic information and provide an effective modeling tool and analysis method for graph data mining. Heterogeneous graph data is also a widely used data type, such as knowledge graphs and social network data.
[0060] Most of the graph data representation learning methods for heterogeneous graphs in the related art only consider the structural and semantic characteristics of the graph, and rarely consider the original true distribution information of the heterogeneous graph. The applicant's research has found that although some nodes in the real network of heterogeneous graphs are not directly connected, these nodes may still have high similarity or correlation. In fact, if the graph data distribution information of heterogeneous graphs is not effectively utilized, the low-dimensional embedding of graph nodes learned by the model may not conform to the actual graph network situation, thereby affecting the accuracy of subsequent graph network tasks targeting heterogeneous graphs.
[0061] To this end, embodiments of the present application provide a processing method and apparatus for enhancing the accuracy and quality of the heterogeneous graph vector representation by incorporating a Gaussian cloud distribution to enhance the utilization of the global data distribution characteristics of the heterogeneous graph. The processing method can be applied to electronic devices in a wide range of general-purpose or specialized computing environments or configurations, such as personal computers, server computers, handheld or portable devices, tablets, multi-processor devices, and the like.
[0062] Optionally, the processing method provided in the embodiment of the present application requires the use of an encoder constructed in advance based on the prior distribution of graph data to combine the data distribution characteristics of the heterogeneous graph to realize vector representation of heterogeneous graph data, so as to overcome the common problem of heterogeneous graph representation learning algorithms in related technologies that rely on graph structure information.
[0063] The following first describes the construction process of the encoder.
[0064] See also Figure 1 The construction process of the encoder includes the following steps 101 to 105, which are described in detail below.
[0065] Step 101: Obtain heterogeneous graph samples.
[0066] In this step, graph data such as nodes in the heterogeneous graph sample and edges between nodes can be obtained.
[0067] Optionally, the obtained heterogeneous graph samples include graph data in natural language form.
[0068] Step 102: Determine first graph structure data of the heterogeneous graph sample.
[0069] After obtaining the heterogeneous graph sample, graph structure data corresponding to the heterogeneous graph sample is further determined. In this embodiment, the graph structure data is referred to as first graph structure data of the heterogeneous graph sample.
[0070] Optionally, the process of determining the first graph structure data may be implemented as the following steps 11)-12):
[0071] 11) Determine the substructure data corresponding to the heterogeneous graph samples at different semantic angles.
[0072] When determining the substructure data corresponding to the heterogeneous graph samples at different semantic angles, it is optional to first initialize multiple different meta-paths, where different meta-paths correspond to different semantic patterns for representing different semantic angles.
[0073] Afterwards, random walks are performed in the heterogeneous graph samples based on the semantic pattern of each meta-path to obtain the heterogeneous graph node sequence corresponding to each meta-path.
[0074] On this basis, the heterogeneous graph node sequence corresponding to each meta-path is converted into a sub-adjacency matrix, and the converted sub-adjacency matrix is used as the sub-structure data corresponding to the heterogeneous graph sample from the semantic perspective represented by the meta-path. In other words, the sub-structure data corresponding to the heterogeneous graph sample at different semantic perspectives include the sub-adjacency matrices converted from the heterogeneous graph node sequence corresponding to each meta-path.
[0075] The sub-adjacency matrix converted from the heterogeneous graph node sequence corresponding to each meta-path includes: adjacency relationship information between different nodes in the heterogeneous graph sample under the semantic perspective corresponding to the meta-path.
[0076] Specifically, in this embodiment, a meta-path is defined as P, and I different meta-paths P are initialized. i(1≤i≤I, i and I are integers respectively), each meta-path represents a semantic pattern, such as ABA, BCB, etc., where A, B, and C represent different entity types respectively. Each meta-path is used to constrain random walks in heterogeneous graphs / heterogeneous graph samples according to the corresponding semantic pattern to obtain the corresponding node sequence. For example, random walks in heterogeneous graph samples based on the meta-path ABA obtain the corresponding heterogeneous graph node sequence "ABABABABA...", and random walks in heterogeneous graph samples based on the meta-path BCB obtain the corresponding heterogeneous graph node sequence "BCBCBCBCB...", etc.
[0077] By performing random walks in the original heterogeneous graph sample with multiple meta-path constraints, we can obtain multiple sets of corresponding heterogeneous graph node sequences. Each set of sequences can be expressed as in (1≤i≤m, i and m are integers) represents the nodes in the sequence. For the heterogeneous graph node sequence obtained based on the random walk of each meta-path, the embodiment of the present application converts it into the form of an adjacency matrix to obtain the sub-adjacency matrix corresponding to each meta-path, where if any two nodes in the heterogeneous graph node sequence corresponding to the meta-path are adjacent to each other, and nodes If the two nodes are adjacent in the sequence, that is, there is a connecting edge between them), then set the elements corresponding to the two nodes in the sub-adjacency matrix On the contrary, if there is no connecting edge between the two nodes, set Finally, we can get the sub-adjacency matrices G1, G2, ..., G under different perspectives of I element paths. I .
[0078] When performing random walks in a heterogeneous graph sample based on a meta-path, the walk can end when there are no more nodes to walk in the heterogeneous graph sample (that is, there are no untraveled nodes in the heterogeneous graph sample that conform to the meta-path semantic pattern). Alternatively, if the heterogeneous graph sample is too large, the walk can also end when the cutoff parameter is met. There is no restriction on this.
[0079] The cutoff parameter may include a preset maximum number of nodes in a heterogeneous graph node sequence, so as to terminate the walk when a node sequence reaching the maximum number of nodes is obtained based on the walk operation.
[0080] Optionally, the size of the sub-adjacency matrix corresponding to each meta-path is expressed as N*N, such as 10000*10000, where N is the number of nodes in the heterogeneous graph sample. For the missing nodes in the heterogeneous graph node sequence corresponding to the meta-path (that is, the nodes that the meta-path has not traveled to in the heterogeneous graph sample), the matrix elements at their corresponding positions in the sub-adjacency matrix are directly assigned to 0. In addition, for the non-missing nodes, if there is an edge between the nodes, the matrix elements at their corresponding positions are assigned to 1, and if there is no edge, they are assigned to 0.
[0081] 12) Fusing the substructure data corresponding to the heterogeneous graph samples at different semantic angles to obtain first graph structure data of the heterogeneous graph samples.
[0082] After obtaining the substructure data corresponding to the heterogeneous graph samples at different semantic angles, the substructure data corresponding to the heterogeneous graph samples at different semantic angles can be further linearly fused to obtain a heterogeneous adjacency matrix, which is the first graph structure data of the heterogeneous graph samples.
[0083] The fusion process can be formalized as Matrix G f represents the heterogeneous adjacency matrix, that is, the first graph structure data corresponding to the heterogeneous graph sample; G1, G2, ..., G I Respectively represent each sub-adjacency matrix, that is, the substructure data corresponding to the heterogeneous graph samples at different semantic angles; Represents a fusion operation on sub-adjacency matrices.
[0084] Optionally, the fusion operation can be specifically to perform an OR operation on the element values at the same position in the sub-adjacency matrix corresponding to each element path, thereby obtaining an N*N heterogeneous adjacency matrix G with unchanged dimension. f , for the heterogeneous adjacency matrix G f For example, if there is an edge relationship between the node X and other nodes Y, then in G f The element value of the corresponding position in the row is 1. If there is no edge relationship, the element value of the corresponding position is 0.
[0085] Step 103: Using an encoder, determine the Gaussian cloud distribution information of the heterogeneous graph sample based on the first graph structure data, determine the low-dimensional vectors corresponding to each node in the heterogeneous graph sample based on the Gaussian cloud distribution information of the heterogeneous graph sample, and constrain the prior distribution of the low-dimensional vectors to be a Gaussian cloud distribution.
[0086] The encoder here is specifically an encoder whose parameters are to be adjusted / optimized through the model training process.
[0087] The Gaussian cloud distribution information includes expectation, entropy and super entropy of heterogeneous graph samples.
[0088] After obtaining the first graph structure data of the heterogeneous graph sample, namely the heterogeneous adjacency matrix G f Afterwards, the heterogeneous adjacency matrix is used as the input data of the model encoder to utilize the encoder's neural network to estimate the Gaussian cloud distribution parameters such as expectation, entropy, and super entropy of the heterogeneous graph samples based on the input data.
[0089] Optionally, the encoder and the decoder mentioned below may be, but are not limited to, a neural network such as MLP (Multi-Layer Perceptron), GCN (Graph Convolutional Network), CNN (Convolutional Neural Networks), or Transfromer.
[0090] In order to ensure the versatility of graph data processing, preferably, the neural network of the encoder / decoder adopts MLP, so that the heterogeneous adjacency matrix G f After the input data is input to the encoder, the encoder's neural network MLP can be used to f Estimating vector representations of expectation, entropy, and hyperentropy of heterogeneous graph samples.
[0091] Furthermore, assuming that the heterogeneous graph sample contains N nodes, the heterogeneous adjacency matrix G f The corresponding N rows are each row, and each row represents the edge relationship between the corresponding node and all other nodes in the heterogeneous graph sample. f Specifically, the heterogeneous adjacency matrix G f Each row in is input as the node object information of the corresponding node (assuming it is represented as x), so that the model network of the encoder such as MLP estimates the vector representation of the expectation, entropy, and super entropy of the heterogeneous graph sample based on the input data.
[0092] For the input node object x, its encoding process in the encoder can be expressed as in represents the input node object x, f(·) is the ReLu activation function, c=1,2,...,C represents the number of encoder layers, W c and b c Represents the weight and bias parameters of the encoder model at layer c.
[0093] After obtaining the Gaussian cloud distribution information of the heterogeneous graph sample, such as expectation, entropy, and super entropy, sampling processing is further performed on each node in the heterogeneous graph sample based on the Gaussian cloud distribution parameters of the heterogeneous graph sample. Through this sampling processing, the low-dimensional vector corresponding to each node in the heterogeneous graph sample is obtained.
[0094] The sampling process includes subsampling, that is, obtaining a low-dimensional vector representation of each node in the heterogeneous graph sample through subsampling. At the same time, the prior distribution of the low-dimensional vector representation obtained by constraining the latent space with KL (Kullback-Leibler) divergence is a Gaussian cloud distribution.
[0095] Optionally, the subsampling process may be implemented as including the following steps 21)-22):
[0096] 21) A forward cloud generator algorithm based on a cloud model obtains random numbers by sampling from the first Gaussian distribution.
[0097] 22) Sampling each node in the heterogeneous graph in the second Gaussian distribution to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph;
[0098] Among them, the mean and variance corresponding to the first Gaussian distribution are the squares of the entropy and the super entropy, respectively, and the mean and variance corresponding to the second Gaussian distribution are the squares of the expectation and the random number, respectively. Assuming that the expectation, entropy and super entropy of the heterogeneous graph sample are expressed as Ex, En and He respectively, and the random number is expressed as En', then the corresponding mean and variance of the first Gaussian distribution are En and He respectively 2 The Gaussian distribution of the second Gaussian distribution is Ex and En′ respectively. 2 Gaussian distribution.
[0099] Specifically, low-dimensional vectors are usually obtained through Gaussian distribution sampling in related technologies. However, the applicant has found through research that simple Gaussian distribution has limitations in the sampling space, and it is difficult to obtain accurate low-dimensional vector representation of the graph data of heterogeneous graphs in the latent space. If the low-dimensional vector representation of the graph data in the heterogeneous graph can be obtained more accurately in the latent space, then the loss of the encoder model in the reconstruction process can be reduced, and the performance of downstream network tasks of the heterogeneous graph can be enhanced.
[0100] Based on this, the embodiment of the present application no longer uses the mean and variance of the Gaussian distribution to describe the low-dimensional representation of the graph data in the latent space, but uses the Gaussian cloud distribution parameters, namely the expectation Ex, entropy En, and super entropy He, to represent the low-dimensional vector of the graph data in the heterogeneous graph (such as the low-dimensional vector z representing the node in the heterogeneous graph). The characteristics of the Gaussian distribution and the Gaussian cloud distribution can be seen in Figure 2 (a) and Figure 2 (b), respectively. Compared with the original Gaussian distribution, the expectation Ex of the Gaussian cloud distribution can be compared to the mean of the Gaussian distribution, the entropy En can be compared to the variance of the Gaussian distribution, and the super entropy He can reflect the thickness of the Gaussian cloud distribution, which adds more fine-grained data points to the Gaussian distribution. Therefore, the use of Gaussian cloud distribution parameters can more accurately obtain the low-dimensional vector representation of the graph data in the heterogeneous graph in the latent space.
[0101] Furthermore, the three numerical features Ex, En, and He that describe the Gaussian cloud in the cloud model are usually obtained by the inverse Gaussian cloud algorithm, but this algorithm relies on the statistical characteristics of the data. For example, if the average age of users in a community is around 30 years old, then one possible scenario is Ex = 30 years old, En = 1 year old, and He = 0.1 years old, with a statistical range of 28.9-31.1 years old. This method requires an estimation method based on central moments, calculating the average value, first-order central moment, and second-order central moment within the sample to determine the parameters. However, the inverse Gaussian cloud algorithm is not suitable for the low-dimensional space of neural networks. It can only be estimated in the case of one-dimensional samples, while the low-dimensional vector z of the node in the heterogeneous graph is multidimensional, making it inapplicable. At the same time, in graph data, it is impossible to rely solely on statistical samples to describe graph information. For example, the various statistical information in the example above is meaningless to the graph structure data, which makes this method cannot be directly applied in the model optimization process. To address this issue, the present embodiment employs a single-layer MLP (i.e., a single layer in a multilayer perceptron) to calculate the Gaussian cloud distribution parameters of heterogeneous graph samples, namely, the expected value Ex, entropy En, and excess entropy He. This allows the model to automatically calculate the digital features required to compose the Gaussian cloud. Low-dimensional features can be easily transformed within the model, leveraging the advantages of neural networks to better capture the characteristics of the input matrix.
[0102] The Gaussian cloud distribution parameters calculated using a single-layer MLP, namely the expectation Ex, entropy En, and excess entropy He, can be expressed as follows:
[0103]
[0104] in, and Represent the weight and bias vector of the encoder model for Ex at layer c, respectively. and Represent the weight and bias vector of the encoder model for En at layer c, respectively, and Represent the weight and bias vector of the encoder model for He at layer c, respectively. The meaning of other parameters is described above.
[0105] After obtaining the expected Ex, entropy En, and super entropy He of the input data, refer to Figure 3 The model framework and encoding and decoding diagram shown in the figure, the embodiment of the present application follows the cloud model forward cloud generator algorithm idea, for the input matrix G f , first by the first Gaussian distribution N(En,He 2 ) to obtain the random number En′, and then the second Gaussian distribution N(Ex,En′ 2 ), which means that for the input heterogeneous graph node object x, its low-dimensional vector representation z can be obtained through two sampling steps. Here, Z contains the vector representations z corresponding to the N node objects x of the heterogeneous graph sample (that is, the N nodes in the heterogeneous graph sample).
[0106] Furthermore, since the above-mentioned digital features are calculated by the model and the sampling operation has a non-differentiable property, directly following the sampling steps of the forward cloud generator of the cloud model will make it impossible for the Gaussian cloud parameters to be back-propagated, resulting in the inability to train the entire model. In order to solve this problem, the embodiment of the present application combines the re-parameterization technique, so that the sampling operation originally directly from the Gaussian distribution given by the model is converted into sampling from the standard Gaussian distribution N(0,1), which makes the sampling operation no longer directly participate in the model training process, but becomes the result of sampling to participate in the model training process, and the sampling randomness process that cannot be described mathematically is transformed into an optimizable mathematical function, ensuring the differentiability during model optimization. Specifically, its formal description is as follows:
[0107] ε1~N(0,1)=En′~N(En,He 2 );
[0108] En′=ε1⊙He+En;
[0109] ε2~N(0,1)=Z~N(Ex,En′ 2 );
[0110] Z=ε2⊙En′+Ex。
[0111] Substituting the En′ equation into the Z expression yields:
[0112] Z=Ex+ε1⊙En+ε1⊙ε2⊙He.
[0113] Where ε1 and ε2 both represent noise variables sampled from a standard Gaussian distribution, and ⊙ represents element-by-element multiplication. Assuming that the low-dimensional vector representation z in the latent space follows a standard Gaussian distribution N(0,1), this application uses KL divergence to calculate the distance between the prior Gaussian cloud distribution and the latent space standard Gaussian distribution, constraining the low-dimensional vector representation in the latent space to align with the cloud model Gaussian cloud distribution. The corresponding loss function can be expressed as:
[0114]
[0115] Among them, D represents the dimension of the latent space vector, Ex d and En d are the d-dimensional components of Ex and En respectively.
[0116] Step 104: Decode the low-dimensional vectors corresponding to the nodes in the heterogeneous graph sample using a decoder to obtain second graph structure data.
[0117] After obtaining the low-dimensional vectors corresponding to each node in the heterogeneous graph sample, the low-dimensional vector of each node, namely Z, can be used as input data of the decoder to decode and restore the corresponding heterogeneous adjacency matrix through the decoder.
[0118] The second graph structure data includes a heterogeneous adjacency matrix restored by decoding through a decoder.
[0119] The restored heterogeneous adjacency matrix contains the node objects restored by the decoder For each restored node object It can be obtained by the following decoding process:
[0120]
[0121] The meaning of each character is described above.
[0122] At the same time, in order to overcome the impact of the sparsity of the heterogeneous adjacency matrix, the embodiment of the present application performs the input heterogeneous adjacency matrix G f The more meaningful non-zero elements in are given greater penalties, so the corresponding reconstruction error loss is expressed as follows:
[0123]
[0124] in, is the penalty factor. If the heterogeneous adjacency matrix G f The element in row i and column j of is 0, then B i,j =1, otherwise B i,j >1.
[0125] Step 105: Adjust parameters of a processing model based on the model loss until a model convergence condition of the processing model is met; the processing model includes the encoder and the decoder.
[0126] Based on step 104, the parameters of the processing model can be adjusted based on the model loss, wherein the model loss includes the reconstruction loss between the second graph structure data and the first graph structure data (i.e., the reconstruction error loss) and the KL divergence loss of the Gaussian cloud distribution constraint in the latent space. That is, the KL divergence loss and the reconstruction error loss function L are jointly optimized. total =L kl +L rec Until the model converges, the encoder training is completed, where L kl and L rec represent the KL divergence loss and reconstruction error loss respectively.
[0127] When the trained encoder is used for inference later, the heterogeneous adjacency matrix G of the heterogeneous graph can be obtained. f The corresponding latent space vector representation matrix Z is used as the final output of the encoder model network. For downstream network tasks targeting heterogeneous graphs, Z can be used as the input data of the downstream task model to perform the corresponding task processing. The overall implementation process of encoder model training and obtaining low-dimensional vector representations of nodes in the heterogeneous graph based on the trained encoder to perform the corresponding downstream tasks can be found in detail. Figure 4 shown.
[0128] Among them, the downstream network tasks of heterogeneous graphs may include but are not limited to node classification, node clustering, visualization task indicator measurement, etc., which can be determined according to actual application requirements.
[0129] Most graph representation algorithms in related technologies rely on graph structure information, that is, there must be an edge between two nodes. However, in the real world, in many cases, even if there is no edge relationship between nodes, they may still be similar or related. For example, two users do not know each other, and from the perspective of edges, they cannot reach each other. In other words, there is no edge relationship between the user nodes of these two users in a heterogeneous graph, but in fact, the two users may still be similar or related. This relationship cannot be perceived by pure graph structure learning. At the same time, when many points (edges between corresponding nodes) are removed from the overall data distribution of the heterogeneous graph, the distribution state of the nodes is often unchanged or not much changed. That is, the removal of points should have no effect or little effect on the global characteristics of the graph data. Figure 5However, graph representation algorithms based on graph structure information in related technologies rely heavily on the connection relationships between nodes. If the corresponding connections are destroyed, the global characteristics of the graph data (such as heterogeneous graphs) will be greatly affected, which in turn affects the results of downstream network tasks targeting heterogeneous graphs and other graph data.
[0130] In response to the above problems, the embodiment of the present application is based on the Gaussian cloud distribution of the cloud model, which overcomes the problem that the graph representation learning algorithm in the related technology generally relies on graph structure information. It can obtain the accurate low-dimensional vector representation of the graph data of the heterogeneous graph in the latent space. After randomly deleting the graph structure information, it can still maintain a high downstream task accuracy, while enhancing the robustness of the model.
[0131] In addition, the embodiment of the present application combines the idea of a forward cloud generator in the cloud model, and estimates the Gaussian cloud distribution that exists in probability statistics, which was originally difficult to apply directly, through a neural network, and constrains the prior distribution of the model sampling space to be a Gaussian cloud distribution, further expanding the sampling space of the model, improving the model's utilization of the global data distribution characteristics of heterogeneous graphs, reducing the loss of the learned graph data representation, and enhancing the downstream network task performance of heterogeneous graphs.
[0132] After completing the training of the encoder, the encoding processing function of the encoder can be used to vectorize the graph data of the heterogeneous graph based on the processing method provided in the embodiment of the present application, so as to provide a basis for the downstream graph network tasks of the heterogeneous graph.
[0133] See also Figure 6 As shown in the method flow chart, the processing method provided in the embodiment of the present application may include the following steps 601 to 604, and these steps are described in detail below.
[0134] Step 601: Obtain a heterogeneous graph to be processed.
[0135] Specifically, graph data such as nodes in the heterogeneous graph and edges between nodes can be obtained.
[0136] Optionally, the obtained heterogeneous graph may include graph data in natural language form.
[0137] Step 602: Determine the graph structure data of the heterogeneous graph.
[0138] After obtaining the heterogeneous graph to be processed, graph structure data corresponding to the heterogeneous graph is further determined.
[0139] Optionally, the process of determining the graph structure data corresponding to the heterogeneous graph can be implemented as the following steps 31)-32):
[0140] 31) Determine the substructure data corresponding to the heterogeneous graph at different semantic perspectives.
[0141] Specifically, first, multiple different meta-paths can be initialized, where different meta-paths correspond to different semantic patterns, which are used to represent different semantic perspectives; then, based on the semantic pattern of each meta-path, random walks are performed in the heterogeneous graph to obtain the heterogeneous graph node sequence corresponding to each meta-path; on this basis, the heterogeneous graph node sequence corresponding to each meta-path is converted into a sub-adjacency matrix, and the sub-adjacency matrix corresponding to each meta-path is used as the sub-structure data corresponding to the heterogeneous graph under the semantic perspective represented by the meta-path, that is, the sub-structure data corresponding to the heterogeneous graph at different semantic perspectives, including the sub-adjacency matrix converted from the heterogeneous graph node sequence corresponding to each meta-path.
[0142] The sub-adjacency matrix converted from the heterogeneous graph node sequence corresponding to each meta-path includes: adjacency relationship information between different nodes in the heterogeneous graph from the semantic perspective corresponding to the meta-path.
[0143] 32) Fusing the substructure data corresponding to the heterogeneous graph at different semantic angles to obtain graph structure data of the heterogeneous graph.
[0144] On the basis of step 31), this step 32) can specifically fuse the sub-adjacency matrices converted from the heterogeneous graph node sequences corresponding to each meta-path, for example, linearly fuse the sub-adjacency matrices corresponding to each meta-path to obtain the heterogeneous adjacency matrix corresponding to the heterogeneous graph, and use the heterogeneous adjacency matrix as the graph structure data of the heterogeneous graph.
[0145] For a more detailed implementation of the meta-path, sub-adjacency matrix, heterogeneous adjacency matrix, and related processing involved in determining the graph structure data of a heterogeneous graph, please refer to the above description of the first graph structure data determination process for the heterogeneous graph sample, which will not be repeated here.
[0146] Step 603: Determine Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data of the heterogeneous graph.
[0147] After obtaining the graph structure data of the heterogeneous graph, the graph structure data of the heterogeneous graph can be input into an encoder, and the encoder is used to estimate the Gaussian cloud distribution parameters of the heterogeneous graph through a neural network.
[0148] Specifically, a single-layer MLP, i.e., a single layer in a multi-layer perceptron, can be used in the encoder to estimate Gaussian cloud distribution parameters such as the expected Ex, entropy En, and hyperentropy He of the heterogeneous graph based on input graph structure data such as the heterogeneous adjacency matrix corresponding to the heterogeneous graph.
[0149] Step 604: Based on the Gaussian cloud distribution information, determine the low-dimensional vectors corresponding to the respective nodes in the heterogeneous graph, so as to perform the graph network task for the heterogeneous graph based on the low-dimensional vectors.
[0150] After obtaining the Gaussian cloud distribution parameters of the heterogeneous graph, sampling processing can be further performed on each node in the heterogeneous graph based on the Gaussian cloud distribution parameters of the heterogeneous graph, and the low-dimensional vector corresponding to each node in the heterogeneous graph can be obtained through the sampling processing.
[0151] The sampling process includes secondary sampling, that is, obtaining a low-dimensional vector representation of each node in the heterogeneous graph through secondary sampling.
[0152] The secondary sampling process can be implemented as follows: based on the forward cloud generator algorithm of the cloud model, sampling in the first Gaussian distribution to obtain random numbers; sampling each node in the heterogeneous graph in the second Gaussian distribution to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph.
[0153] Among them, the mean and variance corresponding to the first Gaussian distribution are the squares of the entropy and the super entropy respectively, and the mean and variance corresponding to the second Gaussian distribution are the squares of the expectation and the random number respectively; assuming that the expectation, entropy and super entropy of the heterogeneous graph are expressed as Ex, En and He respectively, and the random number is expressed as En', then the corresponding mean and variance of the first Gaussian distribution are En and He respectively 2 The Gaussian distribution of the second Gaussian distribution is Ex and En′ respectively. 2 Gaussian distribution.
[0154] It should be noted that the encoding process for heterogeneous graphs using a trained encoder during the model inference phase is identical to the encoding process for heterogeneous graph samples using the encoder during training during the model training phase. The only difference lies in the different encoder parameters and the heterogeneous graph data processed in the two phases (the inference phase processes the heterogeneous graph to be processed, while the training phase processes heterogeneous graph samples). Therefore, for a more detailed implementation of the encoding process for the heterogeneous graph to be processed using a trained encoder during the inference phase to obtain a low-dimensional vector representation of each node in the heterogeneous graph, please refer to the description of the encoding process for heterogeneous graph samples by the encoder during the model training phase above, and will not be repeated here.
[0155] After obtaining the low-dimensional vectors corresponding to each node in the heterogeneous graph to be processed, graph network tasks for the heterogeneous graph can be further performed based on the low-dimensional vectors corresponding to each node in the heterogeneous graph, including but not limited to node classification, node clustering, visualization task indicator measurement, etc., depending on actual application requirements.
[0156] To sum up, the processing method provided in the embodiment of the present application is based on the Gaussian cloud distribution of the cloud model, which overcomes the problem that the graph representation learning algorithm in the related technology generally relies on graph structure information. It can obtain the accurate low-dimensional vector representation of the graph data of the heterogeneous graph in the latent space. After randomly deleting the graph structure information, it can still maintain a high downstream task accuracy, while enhancing the robustness of the model.
[0157] In addition, the embodiment of the present application combines the idea of a forward cloud generator in the cloud model, and estimates the Gaussian cloud distribution that exists in probability statistics, which was originally difficult to apply directly, through a neural network, and constrains the prior distribution of the model sampling space to be a Gaussian cloud distribution, further expanding the sampling space of the model, improving the model's utilization of the global data distribution characteristics of heterogeneous graphs, reducing the loss of the learned graph data representation, and enhancing the downstream network task performance of heterogeneous graphs.
[0158] The following uses examples of various downstream tasks on heterogeneous graphs to verify and compare the effectiveness of the graph data representation algorithm of this application and related technologies.
[0159] This example conducts experiments on three public datasets: DBLP (DataBase systems and Logic Programming), AMiner, and Yelp.
[0160] 1. Node Classification Task
[0161] This example uniformly adopts the KNN (k-Nearest Neighbor) classifier with K=5 as the evaluation algorithm for the node classification task, and uses Micro-F1 and Macro-F1 as the evaluation indicators of the classification results. Higher values of the evaluation indicators indicate better classification results.
[0162] Specifically, this example repeats the classification task multiple times, such as 10 times, and takes the average of the evaluation indicators of each task as the final evaluation indicator value to avoid the instability of the results of a single experiment. The classifier selects the vector representation generated by the model in a random order of 30%, 50%, 70%, and 90%.
[0163] On the above three data sets, the classification result evaluation indicators corresponding to the algorithms of the present application and related technologies are shown in Tables 1, 2 and 3 below, where the row corresponding to Ours represents the classification result evaluation indicator generated by obtaining the heterogeneous graph node vector based on the present application and then performing the node classification task; the rows corresponding to algorithms other than Ours represent the classification result evaluation indicator generated by obtaining the heterogeneous graph node vector based on the corresponding algorithms in the related technologies and then performing the node classification task.
[0164] Table 1
[0165]
[0166] Table 2
[0167]
[0168] Table 3
[0169]
[0170]
[0171] 2. Node Clustering Task
[0172] The K-Means algorithm is uniformly adopted as the clustering algorithm, and NMI (Normalized Mutual Information) and ARI (Adjusted Rand Index) are used as clustering evaluation indicators. The higher the evaluation index value, the better the clustering effect. This example also performs multiple clustering tasks, such as 10 times, and calculates the average value of the task result evaluation index generated by each task as the final evaluation index value of the clustering task, as shown in Table 4.
[0173] Table 4
[0174]
[0175] Among them, the row corresponding to Ours represents the clustering result evaluation index generated by obtaining the heterogeneous graph node vector based on the solution of this application and then performing the node clustering task; the rows corresponding to other algorithms other than Ours represent the clustering result evaluation index generated by obtaining the heterogeneous graph node vector based on the corresponding algorithm in the related technology and then performing the node clustering task.
[0176] Based on Tables 1 to 4, it can be seen that compared with the graph data representation algorithms in related technologies, the solution of the present application can obtain accurate low-dimensional vector representation of the graph data of heterogeneous graphs in the latent space, thereby enhancing the downstream network task performance of heterogeneous graphs.
[0177] 3. Visualization Tasks
[0178] In order to visually observe the node vector representation learned by the model (such as the encoder) in this application and verify the visualization ability of the model, this example uses the T-SNE (t-Distributed Stochastic Neighbor Embedding) method to reduce the 128-dimensional node vector representation learned by each algorithm to 2 dimensions for the DBLP network with four different research fields. The visualization results of the node vector representation learned by each algorithm after dimensionality reduction are respectively referred to Figure 7(a)-Figure 7(i) As shown. Among them, Figure 7(a)-Figure 7(h) The various figures in the figure show the visualization results of the node vector representation after dimensionality reduction learned by the graph data representation algorithms such as Deepwalk, Node2vec, DEC, VGAE, Metapath2vec, HERec, SDCN, and HAN in the related art, and Figure 7(i) shows the visualization result of the node vector representation after dimensionality reduction learned by the solution of the present application. Different research fields in the dataset are marked with different grayscales. In the corresponding figures above, "Ours" also represents the solution of the present application. Other algorithms besides "Ours" are the corresponding graph data representation algorithms in the related art, such as Deepwalk, Node2vec, etc.
[0179] The following further performs sampling space analysis and robustness analysis on the graph data representation algorithms in the present application solution and related technologies.
[0180] 1. Sampling Space Analysis
[0181] This example primarily tests the effectiveness of the cloud model-enhanced sampling method used in this application through visualization. The primary comparison method is the original sampling VAE (Variational Autoencoder) algorithm. In the experiment, all generated node vectors are represented with a dimension of 2 to facilitate intuitive observation of the spatial differences between the original sampling (related technology) and the enhanced sampling (this application). The DBLP dataset is used as input data.
[0182] The visualization results of the sampling space are as follows Figure 8 As shown in the figure, the proposed sampling method based on the cloud model Gaussian cloud distribution enhancement has a larger sampling space than the original Gaussian distribution sampling. This shows that sampling in the Gaussian cloud distribution can more finely describe data points. However, the original sampling method, due to the limitation of spatial range, fails to capture more data in the latent space, which easily leads to the loss of graph structure information, affecting the quality of subsequent graph reconstruction, and further affecting the performance of downstream network tasks on heterogeneous graphs.
[0183] 2. Robustness Analysis
[0184] To verify the robustness of our solution after enhancing the graph data distribution using a Gaussian cloud distribution based on a cloud model, we randomly deleted 30% of the edges from the DBLP dataset. We then compared our solution with several classic algorithms in the related art, calculating the average reduction in each metric for each algorithm in the node classification and node clustering tasks. Table 5 shows the comparison results.
[0185] Table 5
[0186]
[0187] As can be seen from Table 5, compared with some classic algorithms in related technologies, the solution of this application can still maintain a high downstream task accuracy after randomly deleting part of the graph structure information of the heterogeneous graph, while enhancing the robustness of the model.
[0188] Corresponding to the above-mentioned processing method, the embodiment of the present application further provides a processing device, the composition structure of which is as follows: Figure 9 Shown, including:
[0189] An acquisition module 901 is used to obtain a heterogeneous graph to be processed;
[0190] A first determining module 902 is configured to determine graph structure data of the heterogeneous graph;
[0191] A second determining module 903 is configured to determine Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data;
[0192] The third determination module 904 is used to determine the low-dimensional vectors corresponding to each node in the heterogeneous graph based on the Gaussian cloud distribution information, so as to perform the graph network task for the heterogeneous graph based on the low-dimensional vectors.
[0193] In an optional implementation manner, the first determining module 902 is specifically configured to:
[0194] Determine substructure data corresponding to the heterogeneous graph at different semantic angles;
[0195] The substructure data corresponding to the heterogeneous graph at different semantic angles are fused to obtain the graph structure data of the heterogeneous graph.
[0196] In an optional implementation, when determining the substructure data corresponding to the heterogeneous graph at different semantic perspectives, the first determining module 902 is configured to:
[0197] Initialize multiple different meta-paths; different meta-paths correspond to different semantic patterns and are used to represent different semantic perspectives;
[0198] Based on the semantic pattern of each meta-path, a random walk is performed in the heterogeneous graph to obtain a heterogeneous graph node sequence corresponding to each meta-path;
[0199] Converting the heterogeneous graph node sequence corresponding to each meta-path into a sub-adjacency matrix; the sub-adjacency matrix converted from the heterogeneous graph node sequence corresponding to each meta-path includes: adjacency relationship information between different nodes in the heterogeneous graph under the semantic perspective corresponding to the meta-path;
[0200] When fusing the substructure data corresponding to the heterogeneous graph at different semantic angles to obtain the graph structure data of the heterogeneous graph, the first determining module 902 is configured to:
[0201] The sub-adjacency matrices converted from the heterogeneous graph node sequences corresponding to the respective meta-paths are fused to obtain a heterogeneous adjacency matrix corresponding to the heterogeneous graph;
[0202] The graph structure data of the heterogeneous graph includes the heterogeneous adjacency matrix; the substructure data corresponding to the heterogeneous graph at different semantic angles include sub-adjacency matrices obtained by converting the heterogeneous graph node sequences corresponding to each meta-path into sub-adjacency matrices.
[0203] In an optional implementation manner, the second determining module 903 is specifically configured to:
[0204] The graph structure data is input into an encoder so as to estimate Gaussian cloud distribution parameters of the heterogeneous graph through a neural network using the encoder.
[0205] In an optional implementation manner, when the second determining module 903 uses the encoder to estimate the Gaussian cloud distribution parameters of the heterogeneous graph through a neural network, it is configured to:
[0206] The encoder estimates Gaussian cloud distribution parameters of the heterogeneous graph through a single layer in a multilayer perceptron.
[0207] In an optional implementation manner, the third determining module 904 is specifically configured to:
[0208] Based on the Gaussian cloud distribution parameters, sampling processing is performed on each node in the heterogeneous graph to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph.
[0209] In an optional embodiment, the Gaussian cloud distribution parameters include expectation, entropy and hyperentropy;
[0210] When performing sampling processing on each node in the heterogeneous graph based on the Gaussian cloud distribution information, the third determining module 904 is configured to:
[0211] The forward cloud generator algorithm based on the cloud model obtains random numbers by sampling from the first Gaussian distribution;
[0212] Sampling each node in the heterogeneous graph in a second Gaussian distribution to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph;
[0213] Among them, the mean and variance corresponding to the first Gaussian distribution are the squares of the entropy and the super entropy respectively, and the mean and variance corresponding to the second Gaussian distribution are the squares of the expectation and the random number respectively.
[0214] In an optional embodiment, the apparatus further includes a construction module for constructing an encoder, wherein when constructing the encoder, the construction module is used to:
[0215] Obtain heterogeneous graph samples;
[0216] Determining first graph structure data of the heterogeneous graph sample;
[0217] Determine, using an encoder, Gaussian cloud distribution information of the heterogeneous graph sample based on the first graph structure data, determine low-dimensional vectors corresponding to respective nodes in the heterogeneous graph sample based on the Gaussian cloud distribution information of the heterogeneous graph sample, and constrain the prior distribution of the low-dimensional vectors to be a Gaussian cloud distribution;
[0218] Decoding the low-dimensional vectors corresponding to the respective nodes in the heterogeneous graph sample using a decoder to obtain second graph structure data;
[0219] Parameters of a processing model are adjusted based on the model loss until a model convergence condition of the processing model is met; the processing model includes the encoder and the decoder.
[0220] In an optional embodiment, the model loss includes a reconstruction loss between the second graph structure data and the first graph structure data, and a KL divergence loss constrained by a Gaussian cloud distribution in a latent space.
[0221] The present application also discloses an electronic device, the composition structure of the electronic device is as follows: Figure 10 As shown, including at least:
[0222] Memory 10, for storing a computer instruction set;
[0223] A set of computer instructions can be implemented in the form of a computer program.
[0224] The processor 20 is configured to implement the processing method provided in any of the above method embodiments by executing the computer instruction set in the memory.
[0225] The processor 20 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a neural network processor (NPU), a deep learning processor (DPU) or other programmable logic devices, etc.
[0226] Optionally, the electronic device also includes storage resources such as memory and cache.
[0227] Optionally, the electronic device further includes a camera assembly, and / or is connected to an external camera assembly.
[0228] In addition, the electronic device may also include components such as a communication interface and a communication bus. The memory, processor, and communication interface communicate with each other via the communication bus.
[0229] Communication interfaces are used for communication between electronic devices and other devices. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, and a control bus.
[0230] An embodiment of the present application further discloses a storage medium, which carries one or more computer instruction sets. When the one or more computer instruction sets are executed by an electronic device, the electronic device can implement the processing method described in any of the method embodiments above.
[0231] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other.
[0232] For the convenience of description, the above systems or devices are described as being divided into various modules or units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0233] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application can be essentially or the part that makes a creative contribution in the form of a software product. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present application.
[0234] Finally, it should be noted that, in this document, relational terms such as first, second, third, and fourth are used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0235] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A processing method comprising: Obtaining a heterogeneous graph to be processed; Determining graph structure data of the heterogeneous graph; Determining Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data; Based on the Gaussian cloud distribution information, low-dimensional vectors corresponding to respective nodes in the heterogeneous graph are determined, so as to perform a graph network task for the heterogeneous graph based on the low-dimensional vectors.
2. The processing method according to claim 1, wherein determining the graph structure data of the heterogeneous graph comprises: Determine substructure data corresponding to the heterogeneous graph at different semantic angles; The substructure data corresponding to the heterogeneous graph at different semantic angles are fused to obtain the graph structure data of the heterogeneous graph.
3. The processing method according to claim 2, wherein determining the substructure data corresponding to the heterogeneous graph at different semantic perspectives comprises: Initialize multiple different meta paths; Different meta-paths correspond to different semantic patterns and are used to represent different semantic perspectives; Based on the semantic pattern of each meta-path, a random walk is performed in the heterogeneous graph to obtain a heterogeneous graph node sequence corresponding to each meta-path; Convert the heterogeneous graph node sequence corresponding to each meta-path into a sub-adjacency matrix; The sub-adjacency matrix converted from the heterogeneous graph node sequence corresponding to each meta-path includes: adjacency relationship information between different nodes in the heterogeneous graph under the semantic perspective corresponding to the meta-path; The fusing of the substructure data corresponding to different semantic angles of the heterogeneous graph to obtain the graph structure data of the heterogeneous graph includes: The sub-adjacency matrices converted from the heterogeneous graph node sequences corresponding to the respective meta-paths are fused to obtain a heterogeneous adjacency matrix corresponding to the heterogeneous graph; The graph structure data of the heterogeneous graph includes the heterogeneous adjacency matrix; the substructure data corresponding to the heterogeneous graph at different semantic angles include sub-adjacency matrices obtained by converting the heterogeneous graph node sequences corresponding to each meta-path into sub-adjacency matrices.
4. The processing method according to claim 1, wherein determining Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data comprises: The graph structure data is input into an encoder so as to estimate Gaussian cloud distribution parameters of the heterogeneous graph through a neural network using the encoder.
5. The processing method according to claim 4, wherein the estimating the Gaussian cloud distribution parameters of the heterogeneous graph by using the encoder through a neural network comprises: The encoder estimates Gaussian cloud distribution parameters of the heterogeneous graph through a single layer in a multilayer perceptron.
6. The processing method according to claim 4, wherein determining the low-dimensional vector corresponding to each node in the heterogeneous graph based on the Gaussian cloud distribution information comprises: Based on the Gaussian cloud distribution parameters, sampling processing is performed on each node in the heterogeneous graph to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph.
7. The processing method according to claim 6, wherein the Gaussian cloud distribution parameters include expectation, entropy and super entropy; The performing sampling processing on each node in the heterogeneous graph based on the Gaussian cloud distribution information includes: The forward cloud generator algorithm based on the cloud model obtains random numbers by sampling from the first Gaussian distribution; Sampling each node in the heterogeneous graph in a second Gaussian distribution to obtain a low-dimensional vector corresponding to each node in the heterogeneous graph; Among them, the mean and variance corresponding to the first Gaussian distribution are the squares of the entropy and the super entropy respectively, and the mean and variance corresponding to the second Gaussian distribution are the squares of the expectation and the random number respectively.
8. The processing method according to claim 4, wherein the encoder construction process comprises: Obtain heterogeneous graph samples; Determining first graph structure data of the heterogeneous graph sample; Determine, using an encoder, Gaussian cloud distribution information of the heterogeneous graph sample based on the first graph structure data, determine low-dimensional vectors corresponding to respective nodes in the heterogeneous graph sample based on the Gaussian cloud distribution information of the heterogeneous graph sample, and constrain the prior distribution of the low-dimensional vectors to be a Gaussian cloud distribution; Decoding the low-dimensional vectors corresponding to the respective nodes in the heterogeneous graph sample using a decoder to obtain second graph structure data; Parameters of a processing model are adjusted based on the model loss until a model convergence condition of the processing model is met; the processing model includes the encoder and the decoder.
9. The processing method according to claim 8, wherein the model loss includes a reconstruction loss between the second graph structure data and the first graph structure data, and a KL divergence loss constrained by a Gaussian cloud distribution in a latent space.
10. A processing device comprising: An acquisition module, used to obtain the heterogeneous graph to be processed; A first determining module, configured to determine graph structure data of the heterogeneous graph; A second determining module is configured to determine Gaussian cloud distribution information of the heterogeneous graph based on the graph structure data; The third determination module is used to determine the low-dimensional vectors corresponding to each node in the heterogeneous graph based on the Gaussian cloud distribution information, so as to perform the graph network task for the heterogeneous graph based on the low-dimensional vectors.