Structure retrieval method, device, framework, system and readable storage medium
Through the pre-trained structure retrieval framework, the target graph neural network structure is directly determined, which solves the problem of low efficiency of graph neural network structure search in the existing technology and improves the performance and efficiency of the recommendation system.
Patent Information
- Application Number
- CN202310806969.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2024-08-30
AI Technical Summary
When the existing technology processes a new recommendation data set, the graph neural network structure search efficiency is low and the performance is poor. It requires multiple sampling and training, resulting in a waste of computing resources.
Using a pre-trained structure retrieval framework, through meta-feature extraction, data set encoding, structure encoding and hybrid encoding, it predicts the degree of correlation between the data set and the graph neural network structure, directly determines the target graph neural network structure, and avoids repeated search and training steps. .
It improves the efficiency and performance of graph neural network structure retrieval, reduces computing resource overhead, and provides GNN structures with good performance for new recommendation scenarios.
Smart Images

Figure CN118568299A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of graph data processing, and more specifically, to a structure retrieval method, device, framework, system, and readable storage medium. Background Art
[0002] In the recommendation scenario, the interaction between users and items (e.g., products) can usually be viewed as a bipartite graph data structure. Graph neural network (GNN), as a means of modeling graph data structures, is widely used in recommendation scenarios.
[0003] Generally, the design preferences of GNNs in different recommendation scenarios are also different. Although there is already a graph neural architecture search (GNAS) technology to automatically design different graph neural networks based on different recommendation data characteristics to solve different recommendation scenarios. For example, when processing new recommendation data sets, existing technical solutions need to re-execute the graph neural network structure search. The sampling and training in the search algorithm require a lot of computing resources, which leads to low efficiency and poor performance. Summary of the invention
[0004] The present disclosure provides a method, device, framework, system, and readable storage medium for structure retrieval, which can solve the problems of low efficiency and poor performance in determining the structure of graph neural networks used to process graph data in the prior art to a certain extent.
[0005] According to a first aspect of the present disclosure, a structure retrieval method is provided, the method comprising: obtaining a target data set; processing the target data set using a pre-trained structure retrieval framework to obtain a target graph neural network structure, wherein the structure retrieval framework is used to predict the degree of correlation between the target data set and the graph neural network structure, and determine the target graph neural network structure based on the degree of correlation.
[0006] Optionally, the structural retrieval framework may include: a meta-feature extraction module for extracting meta-features of a data set; a data set encoder for encoding meta-features to obtain a data set representation vector; a structure encoder for encoding a graph neural network structure to obtain a structure representation vector; a splicing module for splicing the data set representation vector and the structure representation vector to obtain a splicing vector; a hybrid encoder for encoding the splicing vector to obtain a degree of correlation; and an output module for determining and outputting a target graph neural network structure based on the degree of correlation.
[0007] Optionally, the meta-features may include graph features and distribution features; wherein the graph features are used to characterize the overall graph-level situation of the graph data, and the distribution features are used to characterize the distribution of nodes in the graph data.
[0008] Optionally, when the data set is a recommendation data set, the graph features may include: at least one of the space, shape, density, correlation coefficient between nodes, number of linked tuples, user average degree and item average degree of the data set; the distribution features may include: at least one of the user Gini coefficient and the item Gini coefficient.
[0009] Optionally, the method may further include: iteratively training the structure retrieval framework based on the sample data set and the search space of the preset graph neural network structure.
[0010] Optionally, the method may also include: obtaining initial samples based on the search space of the sample data set and the graph neural network structure, the initial samples including: k groups of data set-structure pairs and correlation labels corresponding to each data set-structure pair; k is an integer greater than 0; interpolating and enhancing the initial samples to obtain interpolated samples; the interpolated samples include k interpolated splicing vectors; and iteratively training the structure retrieval framework using the initial samples and the interpolated samples.
[0011] Optionally, obtaining an initial sample based on the sample data set and the search space of the graph neural network structure may include: randomly sampling the sample data set to obtain a candidate data set; randomly searching the graph neural network structure in the search space to obtain a candidate structure; pairing the data set with the candidate structure and determining corresponding correlation labels to obtain an initial sample.
[0012] Optionally, the initial sample includes a first initial sample and a second initial sample, and based on the initial sample, the initial sample is interpolated and enhanced to obtain an interpolated sample, which may include: processing the data set of the first initial sample and the data set of the second initial sample respectively through a structure retrieval framework, and obtaining a first data set representation vector and a first structure representation vector corresponding to the first initial sample, and obtaining a second data set representation vector and a second structure representation vector corresponding to the second initial sample; and based on the first data set representation vector, the first structure representation vector, the second data set representation vector and the second structure representation vector, obtaining k interpolation splicing vectors to obtain the interpolated sample.
[0013] Optionally, obtaining an interpolated splicing vector based on the first data set representation vector, the first structure representation vector, the second data set representation vector and the second structure representation vector may include: splicing the first data set representation vector and the first structure representation vector to obtain a first splicing vector, splicing the second data set representation vector and the second structure representation vector to obtain a second splicing vector, and obtaining an interpolated splicing vector by interpolating the first splicing vector and the second splicing vector.
[0014] Optionally, obtaining an interpolation splicing vector based on the first data set representation vector, the first structure representation vector, the second data set representation vector and the second structure representation vector may include: interpolating the first data set representation vector and the second data set representation vector to obtain a data set interpolation vector, interpolating the first structure representation vector and the second structure representation vector to obtain a structure interpolation vector, and obtaining an interpolation splicing vector by splicing the data set interpolation vector and the structure interpolation vector.
[0015] Optionally, during any round of iterative training, the target training sample is used to iteratively train the structure retrieval framework, including: using the current structure retrieval framework to process the initial sample to obtain a first prediction result corresponding to the initial sample; and determining a list loss based on the first prediction result, wherein the list loss is used to measure the overall ranking loss of the list composed of all data set-structure pairs in the initial sample; using the current structure retrieval framework to process the interpolation sample and / or the initial sample to obtain a corresponding second prediction result; and determining a pairing loss based on the second prediction result, wherein the pairing loss is used to measure the relative ranking loss between any two data set-structure pairs; determining a target loss based on the list loss and the pairing loss; and adjusting the current structure retrieval framework based on the target loss.
[0016] Optionally, determining the list loss based on the first prediction result includes: obtaining the degree of similarity between the first list and the second list corresponding to the initial sample, to obtain the list loss, wherein the first list is a list obtained by sorting the correlation labels of each data set-structure pair in the initial sample, and the second list is a list obtained by sorting each data set-structure pair based on the first prediction result.
[0017] Optionally, determining the pairing loss based on the second prediction result includes: for the i-th splicing vector corresponding to the initial sample, based on the prediction results of the i-th splicing vector and the j-th splicing vector, determining a sorting label of the i-th splicing vector relative to the j-th splicing vector, the sorting label being used to characterize the sorting order relationship between the splicing vectors; wherein i is not equal to j and is any integer value in k; obtaining an average value of each sorting label to obtain the pairing loss corresponding to the initial sample.
[0018] Optionally, determining the sorting label of the ith splicing vector relative to the jth splicing vector based on the prediction results of the ith splicing vector and the jth splicing vector includes: when the prediction result of the ith splicing vector is greater than the prediction result of the jth splicing vector, determining that the sorting label of the ith splicing vector relative to the jth splicing vector is 1; when the prediction result of the ith splicing vector is equal to the prediction result of the jth splicing vector, determining that the sorting label of the ith splicing vector relative to the jth splicing vector is 0.5; when the prediction result of the ith splicing vector is less than the prediction result of the jth splicing vector, determining that the sorting label of the ith splicing vector relative to the jth splicing vector is 0.
[0019] According to a second aspect of the present disclosure, a structure retrieval device is provided, the device comprising:
[0020] An input unit, configured to obtain a target data set;
[0021] A processing unit is configured to process the target data set using a pre-trained structure retrieval framework to obtain a target graph neural network structure, wherein the structure retrieval framework is used to predict the degree of correlation between the target data set and the graph neural network structure, and determine the target graph neural network structure based on the degree of correlation.
[0022] According to a third aspect of the present disclosure, there is provided a structure retrieval system, comprising:
[0023] Structure retrieval framework;
[0024] A structure retrieval device, wherein the structure retrieval device can call the structure retrieval framework to execute the method described in any embodiment of the first aspect.
[0025] According to a fourth aspect of the present disclosure, a structure retrieval framework is provided, comprising:
[0026] Meta-feature extraction module, used to extract meta-features of data sets;
[0027] A dataset encoder, used to encode meta-features to obtain a dataset representation vector;
[0028] Structure encoder, used to encode the graph neural network structure to obtain a structure representation vector;
[0029] A splicing module, used for splicing the data set representation vector and the structure representation vector to obtain a splicing vector;
[0030] a hybrid encoder for encoding the concatenated vector to obtain a correlation degree;
[0031] The output module is used to determine and output the target graph neural network structure according to the degree of relevance.
[0032] According to a fifth aspect of the present disclosure, a computer-readable storage medium storing instructions is provided, wherein, when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute a method as described in any embodiment of the first aspect.
[0033] According to a sixth aspect of the present disclosure, a system is provided comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, prompt the at least one computing device to execute a method as described in any embodiment of the first aspect.
[0034] The present disclosure provides a search method and a search device for a graph neural network based on neural retrieval. The degree of correlation between a data set and a graph neural network structure in a predetermined search space is obtained through a pre-trained structure retrieval framework, and at least one graph neural network matching the recommendation scenario is determined according to the degree of correlation. Because a pre-trained structure retrieval framework is adopted, the search / training steps that need to be re-executed each time a new scene is changed in the traditional GNAS technology are omitted, thereby providing a GNN structure with good performance for the new recommendation scenario, reducing computing resource overhead and improving the performance of the recommendation system. This solution has achieved good results in product networks and film review networks, and has excellent universality.
[0035] In addition, the present disclosure uses meta-features to encode the data set to obtain a representation vector for representing the data set, and further provides a structure retrieval method based on meta-learning and a related system and device. By balancing the model performance and meta-feature extraction time of the structure retrieval framework, on the one hand, it is ensured that the meta-features of the data set with more expressiveness can be provided; on the other hand, it is ensured that the feature extraction time of the data set is acceptable, thereby further reducing the computing resource overhead.
[0036] In addition, the search method and search device of the graph neural network provided by the present disclosure adopts a task-level data augmentation method, thereby solving the problem of insufficient recommended data sets for training. The loss function adopted by the present disclosure not only considers the pairing loss, but also the list loss, thereby avoiding the problem of being unable to return the optimal graph neural network structure due to performance calibration problems, and in the process of optimizing the structure retrieval framework, providing a larger optimization gradient for the graph neural network structure with the highest performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] These and / or other aspects and advantages of the present invention will become more clear and easier to understand from the following detailed description of the embodiments of the present invention in conjunction with the accompanying drawings, in which:
[0038] Figure 1 It is a flowchart of the graph neural network structure search in the prior art;
[0039] Figure 2 is a flowchart of a structure retrieval method according to an exemplary embodiment of the present disclosure;
[0040] Figure 3 It is a schematic diagram of a comparative example of a graph neural network structure search in the prior art and an example embodiment of the operation of the graph neural network structure retrieval method according to the present disclosure;
[0041] Figure 4 is a schematic diagram of a structure retrieval framework according to an exemplary embodiment of the present disclosure;
[0042] Figure 5 is a flowchart of training a structure retrieval framework according to an exemplary embodiment of the present disclosure;
[0043] Figure 6 is an example of training a structure retrieval framework according to an exemplary embodiment of the present disclosure;
[0044] Figure 7 is an example of a pairing loss function according to an exemplary embodiment of the present disclosure;
[0045] Figure 8 is a block diagram of a structure retrieval apparatus according to an exemplary embodiment of the present disclosure; and
[0046] Fig. 9 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of the embodiments of the present disclosure as defined by the claims and their equivalents. Various specific details are included to assist in understanding, but these details are considered to be exemplary only. Therefore, one of ordinary skill in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. In addition, descriptions of well-known functions and structures are omitted for clarity and brevity.
[0048] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0049] Graph data (hereinafter also referred to as “graph”) can be represented as G=(A, H), where is the adjacency matrix of the graph, N is the number of nodes in the graph, represents the node feature and can be a node vector representation, and d refers to the feature dimension. Taking the dataset of the recommendation scenario as an example, graph data is usually represented as in is a set of users, I is a set of items (for example, items can be specifically products), and ε represents a set of edges. If there is an interaction relationship between users and products, it exists in the edge set. In recommendation tasks, it is necessary to infer the possible interactions between users and products in the future based on historical interaction relationships. With the development of graph neural networks (GNNs) for graph representation learning, GNN-based models have been proposed and widely used in collaborative filtering by modeling user-item interactions as bipartite graphs to capture graph structure information and obtain better user / item representations. With the explosive growth of data and scenarios, how to quickly design the best performing GNN architecture given a new recommendation scenario has become a challenging problem.
[0050] In the prior art, Graph Neural Architecture Search (GNAS) is a method to automatically discover suitable graph neural network (GNN) structures for different tasks, thereby achieving the purpose of automatically designing different graph neural networks to solve different recommendation scenarios based on different recommendation data characteristics. Figure 1 , Figure 1It is a flowchart of the graph neural network structure search in the prior art. The existing GNAS consists of two parts: the search space and the search algorithm. The search algorithm includes selecting a search strategy and evaluating the performance of each structure. Common search strategies include random search, Bayesian optimization, evolutionary algorithms, reinforcement learning, and gradient optimization-based methods. When processing a new recommendation data set, the existing GNAS solution needs to perform sampling in the search space to generate a graph neural network structure. Subsequently, the graph neural network structure is trained on the training sample set, and then its performance is evaluated on the validation set. The performance of the graph neural network structure can be measured by predetermined indicators such as accuracy and speed. The search algorithm is gradually optimized until the optimal neural network structure is found. Since the sampling and training steps need to be performed multiple times in the automatic structure search step, a large amount of computing resources are required (for example, the computational complexity of performing search / training of a new graph neural network structure in real time is O(N)), which makes the search algorithm part still inefficient and poor in performance.
[0051] To this end, the present disclosure provides a structure retrieval method that can perform retrieval of graph neural network structures through a pre-trained structure retrieval framework, avoiding the need to perform multiple model execution sampling and training steps. Therefore, the complexity of retrieving graph neural network structures can be reduced.
[0052] Figure 2 is a flowchart of a structure retrieval method according to an exemplary embodiment of the present disclosure.
[0053] like Figure 2 As shown, in step S201, a target data set is obtained. For example, the target data set can be obtained in real time in step S201.
[0054] The target dataset as input may be in the form of graph data (G = (A, H)) as described above. Taking the dataset of the recommendation scenario as an example, the target dataset may have a recommendation dataset For example, in a dataset for a recommendation scenario, item I can represent an object to be recommended, such as a product, book, music, movie, web page, or piece of information. It can represent people who rate item I and people who accept items recommended by the recommendation system. Edge ε can represent the expression of user preference for item I. For example, edge ε can be represented as a rating, which can be binary (such as like and dislike), or an integer value (such as 1 to 5 stars) or a continuous value (any value in a certain interval). In addition, edge ε can also represent whether a user has interacted with an item. For example, an interaction can be a user Whether to browse, click, comment, or purchase item I.
[0055] In addition, the target data set can also be a social network analysis scenario, a node classification scenario, a graph classification scenario, a knowledge graph scenario, etc. For example, in a social network analysis scenario, the target data set may include graph data consisting of users (nodes) and behaviors between users (e.g., following, liking, disliking, etc.) (edges). In a node classification scenario, the target data set may include graph data consisting of nodes and edges. For example, a node may be a piece of text, and an edge may be established by word frequency, text frequency, co-occurrence information of words in different texts, etc. However, it should be understood that the above scenarios are only examples, and the structure retrieval method and system provided by the present disclosure can also be applied to various other graph data related application scenarios.
[0056] In addition, if the target data set does not have the form of graph data or the form of a recommendation data set, the target data set can be converted. As an example, when the target data set is a traditional relational database, the attributes of the table in the relational database can be abstracted into entities (for example, users and projects in the recommendation scenario) and relationships (for example, edges in the recommendation scenario), and then the relational data is converted into the form of graph data based on the entities and edges. In other words, in the present disclosure, graph data with entity and edge relationships can be directly obtained, and the graph data can be used as the graph data in the target data set; alternatively, the initial data (such as table data) can be first obtained, and the entity and edge relationships therein can be extracted through technical means such as entity recognition and relationship recognition, and the initial data can be converted into graph data accordingly, thereby obtaining the graph data in the target data set.
[0057] In step S202, the target data set is processed using a pre-trained structure retrieval framework to obtain a target graph neural network structure, wherein the structure retrieval framework is used to predict the degree of correlation between the target data set and the graph neural network structure, and determine the target graph neural network structure based on the degree of correlation.
[0058] Here, the structure retrieval framework may also be referred to as a structure retrieval engine, an architecture retrieval model, a structure retrieval service or other names, and the present disclosure has no particular limitation on this. Exemplarily, the pre-trained structure retrieval framework may specifically be a neural retrieval approach of Graph neural networks for Collaborative Filtering (RGCF for short). For example, within the scope of a predetermined search space of a graph neural network framework, the structure retrieval framework may be trained based on a training set including meta-features-graph neural network structures-correlation labels, so that the pre-trained structure retrieval framework can learn the mapping relationship between the meta-features and the graph neural network structures in the search space of the predetermined graph neural network framework, thereby predicting the degree of correlation between the data set and the graph neural network structure in the predetermined search space based on the meta-features of the data set.
[0059] Among them, the graph neural network framework refers to the framework of the graph neural network model for processing graph data, which may specifically include multiple data processing modules and their connection relationships, that is, it constitutes a framework of a framework-type graph data processing model, and there are data processing modules in the graph neural network framework whose data processing methods are to be determined. Among them, the specific structure of each data processing module is related to the data processing method it can adopt, and different data processing methods correspond to different module structures. In the graph neural network framework, the types and number of data processing modules, the connection relationships between data processing modules, and the corresponding scenarios can be customized according to the scenarios. Compared with the graph neural network framework, the target graph neural network structure finally determined by the structural retrieval in the present disclosure is the model structure that determines the processing method of the data processing module.
[0060] For the data processing modules whose data processing methods are to be determined, the data processing methods of each data processing module can be determined by artificial design or automatic search. Exemplarily, when the data processing method is determined by automatic search, a preset search method (such as a reinforcement learning method) can be used to search in the search space corresponding to the data processing module to automatically match the data processing method with a higher degree of adaptability. Among them, for any data processing module, the search space can be regarded as a set of data processing methods corresponding to the data processing module. In actual application scenarios, the data processing method can be encapsulated as an operator, so the search space contains at least one operator corresponding to the data processing module. The process of automatic search is to automatically search in the search space corresponding to the data processing module through a preset search method to determine the operator corresponding to the data processing module that matches the corresponding training data. It should be understood that when different operators are selected in the data processing module, different graph neural network structures can be obtained. The search space involved in the present disclosure can be composed of operator sets for various modules in the graph neural network framework.
[0061] It should be noted that the present disclosure has no special restrictions on the search scope applicable to the structural retrieval framework. In actual scenarios, the structural retrieval framework can be trained using a training data set containing multiple graph neural network frameworks, and the structural retrieval framework can be applicable to the retrieval of one or more graph neural network frameworks. In addition, the present disclosure has no special restrictions on the specific structure of the graph neural network framework, as long as a search space composed of operator sets of various modules can be constructed through a predetermined graph neural network framework. In an exemplary embodiment, the graph neural network framework may include at least one graph data processing module such as a layer module, an inter-layer processing module, a merging operation module, an aggregation module, and a pooling module, which are not exhaustive here.
[0062] The degree of correlation can represent the degree of match between the graph neural network structure and the target data set. In specific implementation, the degree of match can be characterized by the performance data or score (e.g., accuracy, speed, etc.) of the graph neural network structure processing the target data set. For example, the accuracy 1 obtained by graph neural network structure A processing the target data set, and the accuracy 2 obtained by graph neural network structure B processing the target data set, if accuracy 1 is greater than accuracy 2, then the correlation between the target data set and graph neural network structure A is higher. It should be noted that the present disclosure has no special restrictions on the calculation of the degree of correlation. In the present disclosure, the degree of correlation is the relationship between a data set and a graph neural network structure learned by the structure retrieval framework through training that conforms to the internal natural laws between data. Based on this ability learned through training, the structure retrieval framework has the ability to predict other data sets and structures. The present disclosure is implemented based on this ability of the structure retrieval framework. Details are described later.
[0063] In the present disclosure, the number of target graph neural network structures can be one or more, and can be customized based on actual needs in actual scenarios.
[0064] In an embodiment, the target graph neural network structure returned by the structure retrieval framework may be one. In this case, only one graph neural network structure with a higher ranking may be returned, that is, the only result of the top 1 may be returned. In an exemplary scenario, in this case, the retrieval process may be as follows:
[0065]
[0066] in, represents the optimal GNN returned, the function arg max is the value of the variable when the formula reaches the maximum value, and Ω represents the search space of the graph neural network structure. represents the trained structure retrieval framework, Represents the target dataset 200.
[0067] It should be noted that the above embodiments are only examples, and the scope of the present disclosure is not limited thereto. For example, the target graph neural network structure returned by the structure retrieval framework may be multiple. In this case, the top m graph neural network structures may be returned, that is, the top m results may be returned. Exemplarily, in this case, a list of m graph neural network structures may be output. m is an integer greater than 1.
[0068] Figure 3 Schematic diagram of a comparative example of graph neural network structure search in the prior art and an example embodiment of the operation of the graph neural network structure retrieval method according to the present disclosure. Figures 2 to 3 The operation of the graph neural network structure retrieval method is described.
[0069] Reference Figure 3 The comparison example on the left shows that in the prior art, graph neural network structure search methods can be divided into manual design methods performed by experts and automatic design methods performed by GNAS. When it is specifically necessary to determine the graph neural network structure for processing the target data set, the manual design method requires human experts to design and train the graph neural network structure multiple times, while the automatic design method requires GNAS to sample the search space multiple times and perform automatic search to obtain the graph neural network structure. When automatically searching for the target graph neural network structure, it takes a large amount of computational overhead and time overhead to perform the automatic structure search steps in real time. Moreover, because it is necessary to perform multiple designs and training, or multiple sampling and searches, its computational complexity is linearly related to the amount of data N. That is, the computational complexity is O(N).
[0070] Reference Figure 3The example embodiment provided by the present disclosure on the right side, when there is a specific need to determine the graph neural network structure for processing the target data set, the target data set can be regarded as the query data of the structure retrieval framework RGCF, and the acquired target data set can be input into the pre-trained structure retrieval framework RGCF. The structure retrieval framework RGCF can then process the target data set and directly obtain the Top 1 or Top m target graph neural network structures, i.e., the GNN structure, as its output.
[0071] In the present disclosure, the structure retrieval framework can learn the correlation between the data set and the graph neural network structure through pre-training, so that the predicted correlation degree between the target data set and each graph neural network structure in the search space can be predicted based on the meta-features, and one or more target graph neural network structures can be returned according to the predicted correlation degree. Thus, it is possible to quickly retrieve the graph neural network structure adapted to the target data set.
[0072] In the disclosed embodiment, the structure retrieval framework is pre-trained in advance. Based on this, when retrieving the target graph neural network structure, there is no need to go through complex automatic structure search steps. Instead, it is only necessary to use the structure retrieval framework to process the target data set and the graph neural network structure in the preset search space, so as to quickly obtain the target graph neural network structure fed back by the structure retrieval framework, thereby saving computational overhead and time overhead.
[0073] Compared with the implementation in the prior art (such as Figure 3 Compared with the comparative example on the left), in the exemplary embodiment of the structure retrieval method provided in the present disclosure, since the corresponding one or more search spaces or their subspaces have been determined in the stage of pre-training the structure retrieval framework, and the structure retrieval framework is configured to be able to be used to predict the degree of correlation between the target data set and the graph neural network structure in the search space (for example, predicting the performance score), and based on this, determine the target graph neural network structure. Therefore, in the search space of the predetermined graph neural network framework, the pre-trained structure retrieval framework can be used to return the target graph neural network structure without re-executing the training steps of the structure retrieval framework (for example, RGCF). That is, in step S202, when processing a new scenario (for example, for a new target data set as a query), the structure retrieval framework provided in the present disclosure can obtain the degree of correlation of the target data set with respect to each graph neural network structure by performing a retrieval on the new target data set, and determine the target graph neural network structure based on this. In this case, because the step of automatic structure search in the existing GNAS scheme is omitted, the computational complexity of the structure retrieval method provided in the present disclosure is a constant. That is, the computational complexity is O(1). This can provide a GNN structure with good performance for new recommendation scenarios, reduce computational complexity, reduce computing resource overhead, and improve the efficiency and performance of the recommendation system.
[0074] Below, a structure retrieval framework provided by the present disclosure is first described.
[0075] Please refer to Figure 4 , Figure 4 is a schematic diagram of a structure retrieval framework according to an exemplary embodiment of the present disclosure.
[0076] like Figure 4 As shown, the structure retrieval framework 400 may include: a meta-feature extraction module 401, a data set encoder 402, a structure encoder 403, a splicing module 404, a hybrid encoder 405, and an output module 406.
[0077] The meta-feature extraction module 401 is configured to extract meta-features of a data set.
[0078] Meta-features refer to structured data extracted from a data set to describe its features and content. Meta-features are used to organize, describe, retrieve, save, and manage data sets. The data in a data set is discrete and messy, and the use of meta-features can accurately characterize the data set.
[0079] Different graph neural network structures are suitable for datasets with different meta-features. Therefore, the key to retrieving a well-fitting graph neural network structure from the search space is to represent the dataset through more detailed meta-features. However, it is necessary to balance the representativeness of the dataset and the meta-feature extraction time. On the one hand, the meta-features to be used need to be sufficient to characterize all aspects of the graph neural network structure, that is, the more the number and types of meta-features, the better they can represent the dataset. On the other hand, the extraction time of the meta-features of the dataset should be acceptable, that is, if the number of meta-features is too large, it will lead to an increase in the meta-feature extraction time.
[0080] In a possible embodiment of the present disclosure, meta-features may include two levels: graph features and distribution features. Graph features are used to characterize the overall graph-level situation of graph data, and may include but are not limited to: graph-level statistical features; distribution features are used to characterize the distribution of nodes in graph data.
[0081] As an example, when extracting meta-features for such a dataset, taking a recommendation dataset as an example, meta-features for characterizing structured features and / or data distribution features of the dataset can be obtained based on a set of users, a set of items, and a set of edges in the dataset.
[0082] Taking the scenario where the dataset is a recommended dataset as an example, the dataset can have a recommended dataset of the form, in which is the user set, I is the item set, and ε is the edge set. Graph features may include but are not limited to: shape density At least one of the correlation coefficient between nodes (Pearson correlation coefficient between nodes), the number of connected components, user average degree and item average degree; distribution characteristics may include but are not limited to: user Gini coefficient and the project Gini coefficient At least one of represents the number of users in the user set, |I| is the number of items in the item set, and |ε| is the number of edges in the edge set.
[0083] In addition, in other exemplary embodiments, different meta-features should be selected for different scenarios according to the relevant fields to which they belong. For example, in a social network analysis scenario and / or a node classification scenario, the meta-features may include but are not limited to at least one of the number of nodes, the number of features, the number of categories, the dimension of a data set, the average degree of nodes, the sparsity, the clustering coefficient, the standard deviation, the correlation coefficient, the asymmetry coefficient, the kurtosis, etc. This disclosure does not make an exhaustive list of these.
[0084] According to an exemplary embodiment of the present disclosure, on the one hand, because meta-features include not only graph features at the graph level so as to characterize the data set from aspects such as space, shape, mean, etc., but also distribution features at the distribution level, the distribution characteristics of the data are also included, so that the selected meta-features can more accurately describe the data set. On the other hand, there are many types of meta-features, but the extraction of some meta-features requires a long time cost. In some cases, the extraction time of some meta-features is equivalent to the calculation time of calculating the degree of correlation through meta-features (for example, at the same order of magnitude), so meta-features that require a long extraction time should be avoided to reduce the calculation overhead and time overhead of meta-feature extraction. It has been verified that the extraction time of the above 9 meta-features is short and the expression of the data is more sufficient. Therefore, in a specific implementation scenario, all the above 9 meta-features can be selected, or at least one of the above 9 meta-features can be selected to achieve a balance between the representativeness of the data set and the time for extracting the meta-features.
[0085] The data set encoder 402 is used to encode the meta-features to obtain a data set representation vector.
[0086] As an example, the dataset encoder 402 may be implemented using a multi-layer perceptron (MLP) and use a rectified linear unit (ReLU) as an activation function.
[0087] The structure encoder 403 is used to encode the graph neural network structure to obtain a structure representation vector.
[0088] As an example, the structure encoder 403 may be implemented using an inner product-based neural network (PNN).
[0089] The concatenation module 404 is used to concatenate the data set representation vector and the structure representation vector to obtain a concatenated vector.
[0090] Here, splicing can be understood as gluing, bonding or cascading. For example, when the data set representation vector is (D arg_1 , D arg_2 , ...D arg_n ) and the structural representation vector is (A arg_1 , A arg_2 , ... A arg_m ), the concatenation vector can be expressed as (D arg_1 , D arg_2 , ...D arg_n , A arg_1 , A arg_2 , ... A arg_m ).
[0091] The hybrid encoder 405 is used to encode the concatenated vector to obtain the correlation degree.
[0092] As an example, the hybrid encoder 405 may be implemented using a multi-layer perceptron (MLP).
[0093] The output module 406 is used to determine and output the target graph neural network structure according to the degree of correlation.
[0094] In a specific implementation, one or more graph neural network structures with a higher degree of correlation may be determined as the target graph neural network structure based on the degree of correlation output by the hybrid encoder 405. For example, the dataset-structure pairs consisting of the predicted target dataset and the graph neural network structure in the search space are sorted according to the degree of correlation, and one or more graph neural network structures with a higher degree of correlation are determined as the target graph neural network structure.
[0095] Therefore, in the example embodiments of the present disclosure, the structure retrieval framework performs meta-feature extraction on the target dataset as input by adopting a meta-feature extraction module, thereby enabling a dataset encoder to obtain a dataset representation vector that can represent the dataset, and a structure encoder to obtain a structure representation vector that can represent the graph neural network structure, and a hybrid encoder to encode the concatenated vector to obtain the degree of relevance, and the output module performs sorting and screening based on the degree of relevance, and finally determines the target graph neural network structure.
[0096] In the structure retrieval framework provided by the present disclosure, the parameters of the neural networks of the dataset encoder 402, the structure encoder 403 and the hybrid encoder 405 are determined by training. For example, the multi-layer perceptron (MLP) used by the dataset encoder 402, the dot product-based neural network (PNN) used by the structure encoder 403 and the multi-layer perceptron (MLP) used by the hybrid encoder 405 all include trainable and adjustable network parameters. The neural networks in the dataset encoder 402, the structure encoder 403 and the hybrid encoder 405 can be trained based on the dataset-structure pairs and their corresponding correlation labels, so that the trained dataset encoder 402 and the structure encoder 403 can obtain the dataset representation vector and the structure representation vector respectively, and the trained hybrid encoder 405 can output the correlation degree of the dataset-structure pair according to the splicing vector, and determine the target graph neural network structure according to the correlation degree. Therefore, in the search space of the predetermined graph neural network framework, the pre-trained structure retrieval framework can be used to return the target graph neural network structure without re-executing the training steps of the structure retrieval framework. That is to say, compared with the existing GNAS scheme, when processing new scenarios (for example, queries for target data sets), the structure retrieval framework provided by the present disclosure can obtain the relevance degree of the target data set for each graph neural network structure by performing a search on the target data set, and determine the target graph neural network structure based on this. Because the step of automatic structure search in the prior art is omitted, the computational complexity of the structure retrieval method provided by the present disclosure is constant. In this case, for each data set-structure pair, only the structure retrieval framework needs to calculate their relevance degree, and the calculation process of each relevance degree consumes very little computing resources. On the other hand, there is no data dependency between the calculation processes for each relevance degree, which facilitates parallel computing. Even if all the graph neural network structures in the search space as described above are calculated, the time consumption is also very short. For example, when using parallel computing, it only takes tens of milliseconds to a few seconds to perform the calculation of all the graph neural network structures in the search space shown in Tables 1 and 2. Therefore, there is no need to consider tailoring the search space. Thereby providing a GNN structure with good performance for new recommendation scenarios, reducing computing resource overhead and improving the efficiency and performance of the recommendation system.
[0097] Based on the aforementioned structure retrieval framework, when executing Figure 1 Before using the structure retrieval method shown, the structure retrieval framework needs to be trained. The details are as follows.
[0098] In an example embodiment according to the present disclosure, the method may further include: iteratively training the structure retrieval framework based on the sample data set and the search space of the preset graph neural network structure.
[0099] In a possible embodiment of the present disclosure, a sample data set can be directly input into a structure retrieval framework, and a loss function is determined based on the prediction results output by the structure retrieval framework and the relevance labels corresponding to each data set-structure pair in the sample data set, and then the structure retrieval framework is iteratively trained, so that the prediction results of the structure retrieval framework obtained by training (the prediction values and ranking results of the data set-structure pairs) are closer to the label results.
[0100] In another possible embodiment of the present disclosure, the sample data set may be further enhanced. Specifically, interpolation enhancement may be used to iteratively train the structure retrieval framework. Figure 5 and Figure 6 This is explained in detail, Figure 5 is a flowchart of training a structure retrieval framework according to an exemplary embodiment of the present disclosure, Figure 6 is an example of training a structure retrieval framework according to an exemplary embodiment of the present disclosure.
[0101] like Figure 5 As shown, in step S510, based on the search space of the sample data set and the graph neural network structure, an initial sample is obtained, and the initial sample includes: k groups of data set-structure pairs and correlation labels corresponding to each data set-structure pair; k is an integer greater than 0.
[0102] For ease of understanding, step S510 may be referred to as a pre-preparation stage.
[0103] In step S520, the initial samples are interpolated and enhanced to obtain interpolated samples, where the interpolated samples include k interpolated splicing vectors.
[0104] Step S520 can be called the data enhancement stage. The interpolated splicing vector is a mixed splicing vector containing a dataset representation vector and a structure representation vector. The interpolated splicing vector is not obtained by directly splicing the representation vectors corresponding to the dataset-structure pair in the initial sample, but is obtained by interpolation. The vector is different from the dataset-structure pair represented by the initial sample. By means of interpolation, the interpolated splicing vector can make up for the shortcomings of the initial sample to a certain extent, which is conducive to training a more applicable and robust structure retrieval framework.
[0105] It should be noted that this step, when implemented, needs to rely on the intermediate results of the structure retrieval framework, that is, the intermediate output results of the dataset encoder, structure encoder, splicing module, etc. This will be explained in detail later in conjunction with the structure of the structure retrieval framework.
[0106] In this step, in addition to obtaining the interpolated splicing vector, the interpolation correlation degree of each interpolation splicing vector pair may also be obtained. The interpolation correlation degree may be obtained by interpolating the correlation degree through the hybrid encoder 405 .
[0107] In step S530, the structure retrieval framework is iteratively trained using the initial samples and the interpolated samples.
[0108] Step S530 may be referred to as a meta-training phase. In the meta-training phase, the structure retrieval framework may be iteratively trained using the target training sample to determine the parameters of the neural networks of the dataset encoder 402, the structure encoder 403, and the hybrid encoder 405. For example, the target training sample may be used for training to determine the neural network parameters in the multi-layer perceptron (MLP) used by the dataset encoder 402, the dot-product-based neural network (PNN) used by the structure encoder 403, and the multi-layer perceptron (MLP) used by the hybrid encoder 405.
[0109] In such Figure 5 In the embodiment shown, the deficiencies of the initial samples and the limitations on the data set and structure can be supplemented through interpolation enhancement, so that the structural retrieval framework trained in this way has a wider range of learning samples and retrieval capabilities, which is conducive to improving the retrieval accuracy and retrieval scope of the structural retrieval framework.
[0110] The implementation of the above steps is described in detail below.
[0111] Pre-preparation stage
[0112] Step S510 as a preliminary preparation stage may include step S511 , step S512 , and step S513 .
[0113] S511, randomly sample the sample data set to obtain a candidate data set.
[0114] For example, the candidate dataset may be a subset of the sample dataset.
[0115] S512, randomly search / sample graph neural network structures in a preset search space to obtain candidate structures.
[0116] S513, pairing the candidate data set with the candidate structure and determining corresponding correlation labels to obtain an initial sample.
[0117] As mentioned above, in the present disclosure, an initial sample may include k sets of data set-structure pairs and k corresponding correlation labels (for ease of explanation, the data set-structure pairs and their correlation labels may be referred to as a set of sample pairs, i.e., an initial sample includes k sets of sample pairs). k is an integer greater than 0. In actual scenarios, the value of k may be customized based on the actual scenario, and the present disclosure has no particular limitation on this.
[0118] In a possible embodiment, a triple consisting of a data set, a structure, and a correlation label may be constructed to characterize a set of sample pairs in the form of a triple.
[0119] When executing this step, the candidate data sets and the candidate structures can be randomly combined to obtain different data set-structure pairs.
[0120] In addition, the present disclosure also involves a way of dividing samples. In actual scenarios, there are also multiple ways to divide samples. Exemplarily, a custom combination can be performed according to certain rules. For example, data set-structure pairs with the same data set can be divided into an initial sample, so that the initial sample contains multiple different structure pairing methods with the same data set.
[0121] It should be noted that sampling can be performed multiple times. For example, sampling can be performed tens of thousands to hundreds of thousands of times depending on the task type. In this way, there is a possibility of data duplication. Therefore, in a further possible embodiment, data deduplication processing can also be performed to make each sample pair in the initial sample different. The step of data deduplication can be performed at Figure 5 After any step, for example, after S511, duplicate data sets may be removed, after S512, duplicate structures may be removed, and after S513, duplicate data set-structure pairs may be removed. Of course, in actual scenarios, there is no need to repeatedly perform data deduplication processing, and it can be selected based on actual needs. For example, in a possible embodiment, data deduplication processing may be performed only once after S513.
[0122] Let’s take an example. Figure 6 As shown, in the pre-preparation stage (step S510), first, the sample data set and the search space are randomly sampled respectively, so as to obtain a data set-structure pair formed by the data set and the graph neural network structure. Then, the data set-structure pair is evaluated to obtain the corresponding correlation label of the graph neural network structure. In this way, multiple sample pairs can be obtained. In the specific implementation, data deduplication processing can also be performed before determining the correlation label. And, as Figure 6 As shown, all initial samples can be obtained through this series of processing.
[0123] For ease of processing, the present disclosure may further divide the sample pairs. Figure 6 That is, three initial samples are shown as examples, each of which contains k sample pairs. Each sample pair contains a specific dataset-structure pair and its related labels. For ease of understanding, Figure 6 is the result of sample division based on the same data set. Therefore, different GNN structures (GNN1-GNNk) and their corresponding correlation labels (i.e. Figure 6 ).
[0124] Data augmentation phase
[0125] In the present disclosure, data enhancement is achieved by interpolation enhancement, so this stage can also be called the interpolation enhancement stage.
[0126] It should be noted that after the processing in the pre-preparation stage, multiple initial samples can be obtained, and each initial sample can include k sample pairs. Based on this, when performing interpolation enhancement, at least two initial samples are required to achieve accurate and effective interpolation. Therefore, the implementation method of the interpolation enhancement stage is described below using the interpolation of two initial samples as an example.
[0127] like Figure 6 As shown, when the first initial sample needs to be interpolated and enhanced, another initial sample, namely the second initial sample, can be used to implement interpolation enhancement and obtain an interpolated sample. At this time, the second initial sample is equivalent to an auxiliary sample for implementing interpolation enhancement. The first initial sample and the second initial sample are both real samples determined in the preparatory stage, and for the first initial sample, there is no special restriction on the selection of the second initial sample, which can be any initial sample different from the first initial sample; or, the second initial sample can also be selected based on certain custom rules, and the present disclosure has no special restrictions on this.
[0128] Please refer to Figure 5 , step S520 as the data enhancement stage may include step S521 and step S522.
[0129] S521, respectively process the data set of the first initial sample and the data set of the second initial sample through a structure retrieval framework to obtain a representation vector of the data set and the structure.
[0130] Specifically, the data set of the first initial sample and the data set of the second initial sample are processed separately through the structural retrieval framework to obtain a first data set representation vector and a first structure representation vector corresponding to the first initial sample, and to obtain a second data set representation vector and a second structure representation vector corresponding to the second initial sample.
[0131] At this time, you can refer to Figure 6, the characterization vectors of the data set and the structure can come from the intermediate results of the structure retrieval framework. Specifically, the corresponding data set characterization vector can be obtained by the data set encoder 402, and the corresponding structure characterization vector can be obtained by the structure encoder 403. Specifically, the first initial sample is input into the structure retrieval framework, the data set encoder 402 outputs the first data set characterization vector D1, and the structure encoder 403 outputs the first structure characterization vector A1. The second initial sample is input into the structure retrieval framework, the data set encoder 402 outputs the second data set characterization vector D2, and the data set encoder 402 outputs the second structure characterization vector A2.
[0132] S522, by performing interpolation and splicing processing on the representation vectors of the data set and the structure, k interpolation splicing vectors are obtained to obtain interpolation samples.
[0133] In this step, an interpolated splicing vector is obtained based on the first data set representation vector, the first structure representation vector, the second data set representation vector and the second structure representation vector.
[0134] In the embodiment of the present disclosure, the interpolation and splicing processing includes: interpolation processing and splicing processing. The present disclosure has no special restrictions on the execution order of the interpolation processing and the splicing processing, and the design can be customized in actual scenarios.
[0135] At this time, there are two interpolation methods:
[0136] In an exemplary embodiment, the splicing process may be performed before the interpolation process. In this case, S522 may be implemented in the following manner: splicing the first data set representation vector and the first structure representation vector to obtain a first splicing vector (for example, the first data set representation vector and the first structure representation vector may be spliced by the splicing module to obtain the first splicing vector), splicing the second data set representation vector and the second structure representation vector to obtain a second splicing vector (for example, the second data set representation vector and the second structure representation vector may be spliced by the splicing module to obtain the second splicing vector), and interpolating the first splicing vector and the second splicing vector to obtain the interpolated splicing vector.
[0137] like Figure 6 As shown, the first data set representation vector D1 and the first structure representation vector A1 are spliced into a first splicing vector J1, and the second data set representation vector D2 and the second structure representation vector A2 are spliced into a second splicing vector J2. Then, the first splicing vector J1 and the second splicing vector J2 are interpolated to obtain an interpolated splicing vector. Furthermore, the interpolated splicing vector is input into the hybrid encoder 405, and the hybrid encoder 405 encodes the interpolated splicing vector to obtain a second prediction result of the structure retrieval framework for the interpolated splicing vector (in order to unify the description of the whole text, this prediction result is recorded as the second prediction result).
[0138] In an embodiment, the interpolated splicing vector J Mix It can be expressed as: Mix =J1+(1-λ)×J2;
[0139] Interpolate correlation labels Y Mix It can be expressed as: Mix =Y1+(1-λ)×Y2.
[0140] Where J1 represents the first concatenation vector, J2 represents the second concatenation vector, Y1 represents the first correlation label, Y2 represents the second correlation label, and λ is called the mixing ratio, whose value is obtained randomly (for example, random sampling) from the Beta distribution function, and its value range is [0,1]. When λ is 1, the interpolation J Mix =J1,Y Mix =Y1; when λ is 0, J Mix =J2,Y Mix =Y2. That is, by selecting an appropriate λ value, the interpolated samples can include all the initial samples.
[0141] In another exemplary embodiment, the splicing process may be performed after the interpolation process. In this case, S522 may be implemented by interpolating the first data set representation vector and the second data set representation vector to obtain a data set interpolation vector, interpolating the first structure representation vector and the second structure representation vector to obtain a structure interpolation vector, and splicing the data set interpolation vector and the structure interpolation vector to obtain an interpolation splicing vector (for example, the data set interpolation vector and the structure interpolation vector may be spliced by a splicing module to obtain an interpolation splicing vector).
[0142] Still borrowing Figure 6 In this implementation, the first data set representation vector D1 and the second data set representation vector D2 may be interpolated to obtain a data set interpolation vector G1; and the first structure representation vector A1 and the second structure representation vector A2 may be interpolated to obtain a structure interpolation vector G2. Furthermore, the data set interpolation vector G1 and the structure interpolation vector G2 may be spliced to obtain an interpolation splicing vector.
[0143] By executing step S520, two of the triples sampled from step S510 can be sampled, and interpolation can be performed between the two sampled samples. By adjusting the value of λ, the distribution space between the two samples can be filled to obtain a sample set that is approximately continuously distributed, thereby improving the diversity of training samples. This also solves the problem of discrete sampling results after multiple samplings are performed in step S510, and also makes up for the problem of insufficient sampling data to a certain extent, thereby facilitating the continuous distribution of data set-structure pairs. After executing step S520, the structure retrieval framework can not only obtain the mapping relationship represented by the data set-structure pair sampled in step S510, but also mine knowledge from the existing data set-structure pair and learn the data set-structure mapping relationship that has not been sampled. When facing a new data set retrieval, the structure retrieval framework can return a graph neural network structure with a high degree of relevance (e.g., prediction performance score) to the target data set, rather than matching the data set-structure pair in step S510, so that it has stronger adaptability.
[0144] It should be noted that although the structure retrieval framework is trained in the meta-training stage (i.e., the pre-training process), when the pre-trained structure retrieval framework is actually applied for retrieval, the pre-trained structure retrieval framework can be used to return the target graph neural network structure. At this time, the retrieval overhead only involves the numerical calculation of the function and will not bring about the overhead related to training / iteration, which greatly reduces the computational overhead.
[0145] Meta-training phase
[0146] like Figure 6 As shown, in the meta-training stage, i.e., the process of iterative training based on the previously processed data, at this time, at least one round of training process may be included. In any round of training process, the target loss of the training process is calculated, and the hyperparameters of the structure retrieval framework (including the hyperparameters of each encoder) are adjusted based on the target loss, and the next round of iterative training is entered. Figure 6 As shown, the target loss of the current round of training process can be calculated based on the preset loss function.
[0147] There are many different possible ways that the target loss can be achieved.
[0148] For example, in one embodiment described above, data enhancement may be ignored and only the initial samples may be used to train the structure retrieval framework. In this case, the target loss may be measured by calculating the difference (or similarity) between the predicted relevance value of the structure retrieval framework for each data set-structure pair in each initial sample and the true label value, that is, the loss of the predicted value. Alternatively, the target loss may be measured by calculating the similarity between the first list and the second list corresponding to the initial sample of the structure retrieval framework, wherein the first list is a list obtained by sorting the relevance labels of each data set-structure pair in the initial sample, and the second list is a list obtained by sorting each data set-structure pair based on the first prediction result, that is, the loss of the predicted order (i.e., list loss). Alternatively, the target loss may be obtained by calculating the predicted value loss and the list loss, and then mixing the two (for example, averaging, weighting, summing, custom function calculation, etc., without special restrictions).
[0149] In the implementation scenario of interpolation enhancement mentioned above, it is necessary to further consider the loss of the interpolation concatenation vector. Specifically, the target loss can include list loss and pair loss.
[0150] The following is an explanation of the implementation of any round of iterative training process. At this time, any round of iterative training process includes the following steps:
[0151] S710, using the current structure retrieval framework to process the initial sample, obtain a first prediction result corresponding to the initial sample; and determine the list loss based on the first prediction result, the list loss is used to measure the overall ranking loss of the list composed of all data set-structure pairs in the initial sample.
[0152] In the present disclosure, list loss can also be called list dimension loss, calculated as: list loss or list-wise loss. In the present disclosure, list loss is used to measure the overall ranking loss of the initial sample. That is, from the perspective of overall ranking, the structure retrieval framework learns the ranking relationship between the real data set and the graph neural network structure. This is because the output of the target graph neural network structure by the structure retrieval framework is based on the ranking result. Therefore, learning the real ranking relationship is a core point that affects the accuracy of the structure retrieval framework. Therefore, by optimizing the list loss, the distance between the predicted ranking and the real ranking is shortened, so that the predicted ranking is as close to the real ranking as possible.
[0153] In a possible embodiment, the list loss can be obtained by obtaining the similarity between the first list and the second list corresponding to the initial sample, wherein the first list is a list obtained by sorting the correlation labels of each data set-structure pair in the initial sample (i.e., a real sorted list), and the second list is a list obtained by sorting each data set-structure pair based on the first prediction result (i.e., a predicted sorted list). In specific implementation, the similarity can be obtained by a variety of calculation methods, and there is no mandatory restriction on this.
[0154] S720, using the current structure retrieval framework to process the interpolated sample and / or the initial sample to obtain a corresponding second prediction result; and determining the pairing loss based on the second prediction result, the pairing loss is used to measure the relative ranking loss between any two data set-structure pairs.
[0155] The pairing loss is related to the relative ranking relationship between any two sets of data sets and structures. In this case, there is no need to consider the overall ranking loss, and the initial samples and / or interpolated samples can be used to learn the relative ranking relationship. This will be described in detail later.
[0156] S730, determining a target loss based on the list loss and the pairing loss.
[0157] For example, the loss of the structure retrieval framework can be expressed as a weighted sum of the pairing loss and the list loss structure, and can be expressed as follows:
[0158]
[0159] in, represents the target loss, is the pair-wise loss, is the list loss (list-wise loss), and β is the pair-wise loss weight.
[0160] S740, adjusting the current structure retrieval framework based on the target loss.
[0161] As mentioned above, here the structure retrieval framework is automatically trained and adjusted based on the target loss, so that the trained structure retrieval framework can learn more accurate dataset-structure correlation and achieve high-accuracy structure retrieval.
[0162] It should be noted that in the embodiments shown in S710-S740, the list loss is determined based on the overall ranking of all data set-structure pairs in the initial sample, and there is no need to consider the interpolated samples. This can provide a larger optimization gradient for graph neural network structures with higher correlation levels (higher performance scores), thereby avoiding the inability to return the optimal graph neural network structure due to performance calibration problems. For interpolated samples, on the one hand, the interpolation correlation labels in the interpolated samples cannot be aligned or calibrated with the correlation labels of the initial samples, making the interpolated samples incomparable to the initial samples; on the other hand, the purpose of the list loss is to return a graph neural network structure with a higher performance score, and the correlation level of the interpolated samples will not be higher than the highest correlation level score in the initial sample. Therefore, when determining the list loss, it is only necessary to sort the data set-structure pairs in the initial sample without sorting the data set-structure pairs in the interpolated samples.
[0163] Based on this, in the embodiments shown in S710-S740, not only the overall ranking relationship is learned based on the real data, but also the relative ranking relationship between each pair of samples is learned based on the interpolated enhanced data and the real data, so that the accuracy of the structure retrieval framework is higher.
[0164] For different GNN tasks, due to differences in data sets, the absolute values of the degree of correlation are not comparable (i.e., differences in evaluation indicators). In the embodiments of the present disclosure, since the loss uses the degree of correlation ranking rather than the absolute value of the degree of correlation, it is possible to return a graph neural network structure with a high degree of correlation (e.g., performance score) with the target data set. On the other hand, by adopting the data enhancement stage described in reference step S520, the structure retrieval framework can mine knowledge from existing data set-structure pairs and learn unsampled data set-structure mapping relationships, rather than matching with sampled data set-structure pairs. Therefore, the technical solution disclosed in the present disclosure has excellent scalability.
[0165] Specifically, the pairing loss involved in S720 can be obtained by comparing the prediction results of the sample pairs, marking them based on the order of the pairwise comparisons, and then statistically analyzing the marking results to obtain the pairing loss. Specifically, the marking method can be the marking of positive and negative samples, or the marking of specific values.
[0166] In an exemplary possible embodiment, S720 may be implemented by the following means:
[0167] For the i-th splicing vector corresponding to the initial sample, based on the prediction results of the i-th splicing vector and the j-th splicing vector, determine the sorting label of the i-th splicing vector relative to the j-th splicing vector, and the sorting label is used to characterize the sorting order relationship between the splicing vectors; wherein i is not equal to j, and both are any integer values in k; then, obtain the statistical value (such as the average value) of each sorting label to obtain the pairing loss corresponding to the initial sample.
[0168] The splicing vectors involved here include: interpolated splicing vectors (corresponding to interpolated samples) and / or initial splicing vectors (corresponding to initial samples).
[0169] For example, among the k samples included in the initial sample, for splicing vector No. 1, if the predicted correlation value of splicing vector No. 1 is greater than the predicted correlation value of splicing vector No. 2 (the second prediction result), then the sorting label of splicing vector No. 1 relative to splicing vector No. 2 is the first label; or, if the predicted correlation value of splicing vector No. 1 is equal to the predicted correlation value of splicing vector No. 2, then the sorting label of splicing vector No. 1 relative to splicing vector No. 2 is the second label; or, if the predicted correlation value of splicing vector No. 1 is less than the predicted correlation value of splicing vector No. 2, then the sorting label of splicing vector No. 1 relative to splicing vector No. 2 is the third label.
[0170] There are many different designs for sorting labels. In this application, they can be identified by numerical values. Thus, statistical calculations can be performed based on the sorting labels to obtain corresponding statistical values as pairing losses.
[0171] In an exemplary embodiment, the sorting tags may be assigned as follows:
[0172] When the prediction result of the i-th splicing vector is greater than the prediction result of the j-th splicing vector, determining that the ranking label of the i-th splicing vector relative to the j-th splicing vector is 1;
[0173] When the prediction result of the i-th splicing vector is equal to the prediction result of the j-th splicing vector, determine that the ranking label of the i-th splicing vector relative to the j-th splicing vector is 0.5;
[0174] When the prediction result of the i-th splicing vector is less than the prediction result of the j-th splicing vector, the ranking label of the i-th splicing vector relative to the j-th splicing vector is determined to be 0.
[0175] Pairing loss can be expressed as Figure 7 Here, σ(·) represents the sigma function, f w Represents the structure retrieval framework, A T Represents the set of graph neural network structures, GT represents the data set, r i 、r j Represent the order of sample i and sample j, y i,j It represents the pairwise preference between sample i and sample j.
[0176] It should be understood that the first label can be regarded as a positive label, and the third label can be regarded as a negative label. The specific values of the first label, the second label, and the third label can be custom designed, and there may be other possible situations in actual scenarios. For example, in another embodiment other than the above embodiment, the first label can be 1, the second label can be 0, and the third label can be -1. The present application has no special restrictions on the specific values of the first label, the second label, and the third label.
[0177] In summary, paired loss is a pairwise comparison between sample pairs. When one sample is ranked higher than the other, it is a positive example, otherwise it is a negative example. Paired loss, a pairwise comparison method, is more conducive to the sequential learning of the structure retrieval framework.
[0178] On the basis of any of the aforementioned embodiments, in actual application scenarios, the target graph neural network structure retrieved in real time and the user feedback data can also be used to perform feedback training on the structure retrieval framework. For example, user feedback data can be collected by collecting and analyzing user feedback forms, output sorting of the target graph neural network structure selected by the user, and using A / B testing methods to measure user experience. Based on this, the correlation labels corresponding to the data set-structure pairs can be updated to achieve feedback training for the structure retrieval framework, which is conducive to improving the real-time and accuracy of the structure retrieval framework. In addition, labels can be assigned to user feedback to obtain a structure retrieval framework-user feedback training set for feedback training or real-time updating.
[0179] It should be noted that in the present disclosure, the relevance label can be reflected in the form of specific numerical values or data levels, so it can also be called a relevance score or a matching score, etc., and there is no special limitation on its name in the present disclosure.
[0180] Retrieval stage (application stage)
[0181] like Figure 6 As shown in Figure 2, after the training is completed, a trained structure retrieval framework can be obtained. In the retrieval stage (i.e., the application stage), the reference Figure 3 According to the operation of the graph neural network structure retrieval method disclosed in the present invention, the structure retrieval framework is able to return one (Top 1) or multiple (Top m) target graph neural network structures for a target data set (new data set).
[0182] It should be understood that in the retrieval stage, there is no need to perform interpolation processing. The target data set can be directly used as the query target for structural retrieval to feedback the target graph neural network structure.
[0183] Redundant description is omitted here.
[0184] The present disclosure also provides a structure retrieval device.
[0185] Figure 8 is a block diagram of a structure retrieval apparatus according to an exemplary embodiment of the present disclosure.
[0186] like Figure 8 As shown, the structure retrieval device 800 includes: an input unit 810 and a processing unit 820.
[0187] The input unit 810 is configured to obtain a target data set. The input unit 810 is configured to process the target data set using a pre-trained structure retrieval framework to obtain a target graph neural network structure, wherein the structure retrieval framework is used to predict the degree of correlation between the target data set and the graph neural network structure, and determine the target graph neural network structure based on the degree of correlation.
[0188] In a possible embodiment, the structure retrieval framework includes:
[0189] Meta-feature extraction module, used to extract meta-features of data sets;
[0190] A dataset encoder, used to encode meta-features to obtain a dataset representation vector;
[0191] Structure encoder, used to encode the graph neural network structure to obtain a structure representation vector;
[0192] A splicing module, used for splicing the data set representation vector and the structure representation vector to obtain a splicing vector;
[0193] a hybrid encoder for encoding the concatenated vector to obtain a correlation degree;
[0194] The output module is used to determine and output the target graph neural network structure according to the degree of relevance.
[0195] In a possible embodiment, the meta-features include graph features and distribution features; wherein the graph features are used to characterize the overall graph-level situation of the graph data, and the distribution features are used to characterize the distribution of nodes in the graph data.
[0196] In a possible embodiment, when the data set is a recommendation data set, the graph features include: at least one of the space, shape, density, correlation coefficient between nodes, number of linked tuples, user average degree and item average degree of the data set; the distribution features include: at least one of the user Gini coefficient and the item Gini coefficient.
[0197] In a possible embodiment, the device further includes:
[0198] The training unit is configured to iteratively train the structure retrieval framework based on the sample data set and the search space of the graph neural network structure.
[0199] In a possible embodiment, the training unit includes:
[0200] A pre-preparation unit is configured to obtain an initial sample based on a sample data set and a search space of a preset graph neural network structure, wherein the initial sample includes: k sets of data set-structure pairs and correlation labels corresponding to each data set-structure pair; k is an integer greater than 0;
[0201] An interpolation enhancement unit is configured to perform interpolation enhancement on the initial sample to obtain an interpolation sample, wherein the interpolation sample includes k interpolation splicing vectors;
[0202] The meta-training unit is configured to iteratively train the structure retrieval framework using the initial samples and the interpolated samples.
[0203] In a possible embodiment, the pre-preparation unit is configured as follows:
[0204] Randomly sampling the sample data set to obtain a candidate data set;
[0205] Randomly searching for graph neural network structures in the search space to obtain candidate structures; and
[0206] The data set is paired with the candidate structure and corresponding correlation labels are determined to obtain the initial sample.
[0207] In a possible embodiment, the initial sample includes a first initial sample and a second initial sample, and the interpolation enhancement unit is configured as follows:
[0208] Processing the data sets of the first initial sample and the second initial sample respectively, and obtaining a first data set representation vector and a first structure representation vector corresponding to the first initial sample and a second data set representation vector and a second structure representation vector corresponding to the second initial sample;
[0209] Based on the first data set representation vector, the first structure representation vector, the second data set representation vector and the second structure representation vector, k interpolation splicing vectors are obtained to obtain the interpolation sample.
[0210] In a possible embodiment, the interpolation enhancement unit is further configured to:
[0211] splicing the first data set representation vector and the first structure representation vector to obtain a first splicing vector, splicing the second data set representation vector and the second structure representation vector to obtain a second splicing vector, and interpolating the first splicing vector and the second splicing vector to obtain the interpolated splicing vector; or,
[0212] The first data set characterization vector and the second data set characterization vector are interpolated to obtain a data set interpolation vector, the first structure characterization vector and the second structure characterization vector are interpolated to obtain a structure interpolation vector, and the data set interpolation vector and the structure interpolation vector are spliced to obtain the interpolation splicing vector.
[0213] In a possible embodiment, during any round of iterative training, the meta-training unit is configured as follows:
[0214] Processing the initial sample using the current structure retrieval framework to obtain a first prediction result corresponding to the initial sample; and determining a list loss based on the first prediction result, wherein the list loss is used to measure the overall ranking loss of a list composed of all data set-structure pairs in the initial sample;
[0215] Processing the interpolation sample and / or the initial sample using the current structure retrieval framework to obtain a corresponding second prediction result; and determining a pairing loss based on the second prediction result, wherein the pairing loss is used to measure the relative ranking loss between any two data set-structure pairs;
[0216] Determining a target loss based on the list loss and the pairing loss;
[0217] The current structure retrieval framework is adjusted based on the target loss.
[0218] In a possible embodiment, the meta-training unit is specifically configured as follows:
[0219] Obtain the similarity between the first list and the second list corresponding to the initial sample to obtain the list loss, wherein the first list is a list obtained by sorting the correlation labels of each data set-structure pair in the initial sample, and the second list is a list obtained by sorting each data set-structure pair based on the first prediction result.
[0220] In a possible embodiment, the meta-training unit is specifically configured as follows:
[0221] For the i-th splicing vector corresponding to the initial sample, based on the prediction results of the i-th splicing vector and the j-th splicing vector, determine the sorting label of the i-th splicing vector relative to the j-th splicing vector, wherein the sorting label is used to characterize the sorting order relationship between the splicing vectors; wherein i is not equal to j and is any integer value in k;
[0222] The average value of each sorting label is obtained to obtain the pairing loss corresponding to the initial sample.
[0223] In a possible embodiment, the meta-training unit is specifically configured as follows:
[0224] When the prediction result of the i-th splicing vector is greater than the prediction result of the j-th splicing vector, determining that the ranking label of the i-th splicing vector relative to the j-th splicing vector is 1;
[0225] When the prediction result of the i-th splicing vector is equal to the prediction result of the j-th splicing vector, determine that the ranking label of the i-th splicing vector relative to the j-th splicing vector is 0.5;
[0226] When the prediction result of the i-th splicing vector is less than the prediction result of the j-th splicing vector, the ranking label of the i-th splicing vector relative to the j-th splicing vector is determined to be 0.
[0227] Redundant descriptions are omitted here, and please refer to the previous text for the relevant parts.
[0228] Although not shown in the drawings, another aspect of the present disclosure provides a structure retrieval system, characterized by comprising:
[0229] Structure retrieval framework;
[0230] The structure retrieval device 800 can call the structure retrieval framework to execute the structure retrieval method described in any of the above embodiments.
[0231] Another aspect of the present disclosure provides a structure retrieval system, which can be referred to Figure 4 and Figure 6 , the structure retrieval framework, including:
[0232] Meta-feature extraction module, used to extract meta-features of data sets;
[0233] A dataset encoder, used to encode meta-features to obtain a dataset representation vector;
[0234] Structure encoder, used to encode the graph neural network structure to obtain a structure representation vector;
[0235] A splicing module, used for splicing the data set representation vector and the structure representation vector to obtain a splicing vector;
[0236] a hybrid encoder for encoding the concatenated vector to obtain a correlation degree;
[0237] The output module is used to determine and output the target graph neural network structure according to the degree of relevance.
[0238] Redundant descriptions are omitted here, and please refer to the previous text for the relevant parts.
[0239] Fig. 9 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure.
[0240] Reference Fig. 9 The electronic device 900 includes at least one memory 901 and at least one processor 902, wherein the at least one memory 901 stores computer executable instructions, and when the computer executable instructions are executed by the at least one processor 902, the at least one processor 902 is prompted to execute the structure retrieval method according to an embodiment of the present disclosure.
[0241] As an example, the electronic device 900 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instructions. Here, the electronic device 900 is not necessarily a single electronic device, but may also be any device or circuit capable of executing the above instructions (or instruction sets) individually or in combination. The electronic device 900 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0242] In the electronic device 900, the processor 902 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0243] The processor 902 may execute instructions or codes stored in the memory 901, wherein the memory 901 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.
[0244] The memory 901 may be integrated with the processor 902, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 901 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 901 and the processor 902 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 902 can read files stored in the memory.
[0245] In addition, the electronic device 900 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 900 may be connected to each other via a bus and / or a network.
[0246] According to an embodiment of the present disclosure, a computer-readable storage medium may also be provided, wherein, when the instructions stored in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the structure search method involved in any embodiment provided above according to the present disclosure.
[0247] Examples of computer-readable storage media include read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, nonvolatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0248] According to an embodiment of the present disclosure, a computer program product may also be provided, including computer instructions, which, when executed by at least one processor, implement the structure retrieval method involved in any of the embodiments provided above in the present disclosure.
[0249] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0250] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A structure retrieval method, characterized in that: The method comprises: Obtaining a target dataset; and The target data set is processed using a pre-trained structure retrieval framework to obtain a target graph neural network structure, wherein the structure retrieval framework is used to predict the degree of correlation between the target data set and the graph neural network structure, and determine the target graph neural network structure based on the degree of correlation.
2. The method according to claim 1, characterized in that The structure retrieval framework includes: Meta-feature extraction module, used to extract meta-features of data sets; A dataset encoder, used to encode meta-features to obtain a dataset representation vector; Structure encoder, used to encode the graph neural network structure to obtain a structure representation vector; A splicing module, used for splicing the data set representation vector and the structure representation vector to obtain a splicing vector; a hybrid encoder for encoding the concatenated vector to obtain a correlation degree; The output module is used to determine and output the target graph neural network structure according to the degree of relevance.
3. The method according to claim 2, characterized in that The meta-features include graph features and distribution features; wherein the graph features are used to characterize the overall graph-level situation of the graph data, and the distribution features are used to characterize the distribution of nodes in the graph data.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Based on the sample data set and the search space of the preset graph neural network structure, the structure retrieval framework is iteratively trained.
5. The method according to claim 4, characterized in that The search space based on the sample data set and the graph neural network structure, iteratively training the structure retrieval framework, includes: Based on the search space of the sample data set and the graph neural network structure, an initial sample is obtained, wherein the initial sample includes: k sets of data set-structure pairs and correlation labels corresponding to each data set-structure pair; k is an integer greater than 0; Performing interpolation enhancement on the initial sample to obtain an interpolated sample; the interpolated sample includes k interpolated splicing vectors; The structure retrieval framework is iteratively trained using the initial samples and the interpolated samples.
6. The method according to claim 5, characterized in that In any round of iterative training, the structure retrieval framework is iteratively trained using the target training samples, including: Processing the initial sample using the current structure retrieval framework to obtain a first prediction result corresponding to the initial sample; and determining a list loss based on the first prediction result, wherein the list loss is used to measure the overall ranking loss of a list composed of all data set-structure pairs in the initial sample; Processing the interpolated sample and / or the initial sample using the current structure retrieval framework to obtain a second prediction result corresponding to the interpolated sample; and determining a pairing loss based on the second prediction result, wherein the pairing loss is used to measure the relative ranking loss between any two data set-structure pairs; Determining a target loss based on the list loss and the pairing loss; The current structure retrieval framework is adjusted based on the target loss.
7. A structure retrieval device, characterized in that: The device comprises: An input unit configured to obtain a target data set; and A processing unit is configured to process the target data set using a pre-trained structure retrieval framework to obtain a target graph neural network structure, wherein the structure retrieval framework is used to predict the degree of correlation between the target data set and the graph neural network structure, and determine the target graph neural network structure based on the degree of correlation.
8. A structure retrieval framework, characterized in that: include: Meta-feature extraction module, used to extract meta-features of data sets; A dataset encoder, used to encode meta-features to obtain a dataset representation vector; Structure encoder, used to encode the graph neural network structure to obtain a structure representation vector; A splicing module, used for splicing the data set representation vector and the structure representation vector to obtain a splicing vector; a hybrid encoder for encoding the concatenated vector to obtain a correlation degree; The output module is used to determine and output the target graph neural network structure according to the degree of relevance.
9. A computer-readable storage medium storing instructions, wherein: When the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the method according to any one of claims 1 to 6.
10. A system comprising at least one computing device and at least one storage device storing instructions, wherein: When the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the method of any one of claims 1-6.
Citation Information
Patent Citations
Neural network structure searching method and device, computer equipment and storage medium
CN113408721A
Graph neural network structure searching method and system
CN114022274A
Method for providing an agent for creating a graph neural network architecture and method for creating, by an agent, a graph neural network architecture
US20220284296A1
Cited By
Interview video behavior feature analysis and sorting method based on multi-modal fusion
CN120997744A
