A graph data self-supervised training method and device
By using masked autoencoders and scaled cosine error functions in graph data self-supervised training, the problem of low accuracy in graph node classification and graph classification tasks is solved, and higher graph network data classification accuracy is achieved.
Patent Information
- Application Number
- CN202210530942.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-05-16
AI Technical Summary
The existing self-supervised learning technology has low accuracy in graph node classification and graph classification tasks, and the performance of generative learning on graphs, especially graph autoencoders, has not yet achieved good results.
By processing the input sample data, the first training data is obtained and input to the autoencoder, the second training data is obtained, and the similarity between the second training data and the input sample data is calculated using the reconstruction evaluation function, using mask identification and scaling cosine Error functions are used for data training, avoiding trivial solutions and relying on structural data augmentation.
Significantly improves the accuracy of graph network data classification, outperforming traditional contrastive learning and generative learning methods, and even surpassing the performance of supervised learning in some cases.
Smart Images

Figure CN115115920B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of deep learning and graph network data mining, and in particular to a method and device for self-supervised training of graph data. Background Art
[0002] With the development of artificial intelligence, deep learning as a powerful technology has begun to change every aspect of our lives. Self-supervised learning is a representative branch of deep unsupervised learning, which uses the information of the graph network itself to construct a pseudo-label training model without the need for data annotation.
[0003] However, the existing self-supervised learning techniques have low accuracy in node classification and graph classification tasks. Summary of the invention
[0004] The present invention provides a method, device, electronic device and storage medium for self-supervised training of graph data.
[0005] According to a first aspect of the present disclosure, a method for self-supervised training of graph data is provided. The method comprises: processing input sample data to obtain first training data, inputting the first training data into an autoencoder to obtain second training data, performing a similarity comparison between the second training data and the input sample data, and performing data training according to the comparison result.
[0006] In some embodiments, processing the input sample data to obtain the first training data includes: acquiring the input sample data, sampling the nodes in the input sample data, masking the original features of the sampled nodes in the input sample data with a first mask identifier, and determining the input sample data masked by the first mask identifier as the first training data.
[0007] In some embodiments, the autoencoder includes an encoder, which is a first graph neural network. The first training data is input into the autoencoder, and obtaining the second training data includes: inputting the first training data into the encoder to obtain implicit representations of all nodes in the input sample data.
[0008] In some embodiments, the autoencoder also includes a decoder, which is a second graph neural network. The first training data is input into the autoencoder, and obtaining the second training data includes: inputting the implicit representation of the sampled node into the decoder to output the second training data.
[0009] In some embodiments, inputting the implicit representation of the sampled node into the decoder to output the second training data includes: masking the implicit representation of the sampled node in the input sample data with a second mask identifier, and using the input sample data masked by the second mask identifier as the second training data.
[0010] In some embodiments, comparing the second training data with the input sample data for similarity includes: calculating the similarity between the second training data and the input sample data by reconstructing an evaluation function.
[0011] In some embodiments, the method further comprises: constructing a reconstruction evaluation function based on a scaling factor, wherein the reconstruction evaluation function is a scaled cosine error function, and the scaling factor is greater than or equal to 1.
[0012] According to the embodiments of the present disclosure, by processing the input sample data, first training data is obtained, the first training data is input into the autoencoder, second training data is obtained, the second training data is compared with the input sample data for similarity, and data training is performed according to the comparison result. Data learning is achieved through a self-supervised algorithm, which greatly improves the accuracy of graph network data classification.
[0013] According to a second aspect of the present disclosure, a graph data self-supervised training device is provided, including: a processing unit, used to process input sample data to obtain first training data; an input unit, used to input the first training data into an automatic encoder to obtain second training data; a comparison unit, used to compare the similarity between the second training data and the input sample data, and perform data training based on the comparison result.
[0014] According to an embodiment of the present disclosure, the device implements data learning through a self-supervised algorithm through a processing unit, an input unit, and a comparison unit, thereby greatly improving the accuracy of graph network data classification.
[0015] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0016] at least one processor; and
[0017] a memory communicatively connected to at least one processor; wherein,
[0018] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to execute the method of the first aspect described above.
[0019] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method of the aforementioned first aspect.
[0020] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, and when the computer program is executed by a processor, the computer program implements the method of the aforementioned first aspect.
[0021] According to the embodiments of the present disclosure, by processing the input sample data, first training data is obtained, the first training data is input into the autoencoder, second training data is obtained, the second training data is compared with the input sample data for similarity, and data training is performed according to the comparison result. Data learning is achieved through a self-supervised algorithm, which greatly improves the accuracy of graph network data classification.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0024] Figure 1 A schematic diagram of a flow chart of a graph data self-supervised training method provided in an embodiment of the present disclosure;
[0025] Figure 2 A schematic diagram of a flow chart of a graph data self-supervised training method provided in an embodiment of the present disclosure;
[0026] Figure 3 A schematic diagram of a flow chart of a graph data self-supervised training method provided in an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram of a generative self-supervised learning based on a graph autoencoder provided in an embodiment of the present disclosure;
[0028] Figure 5 A schematic diagram of the structure of a graph data self-supervised training device provided in an embodiment of the present disclosure;
[0029] Figure 6 A schematic block diagram of an exemplary electronic device 600 provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0031] The following describes a graph data self-supervised training method, device, electronic device and storage medium according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0032] With the development of artificial intelligence, deep learning as a powerful technology has begun to change every aspect of our lives. Self-supervised learning is a representative branch of deep unsupervised learning. It uses the information of the graph itself to construct a pseudo-label training model without data annotation. Self-supervised learning has received great attention and has been widely explored in recent years. Self-supervised learning algorithms can learn the intrinsic characteristics of data in scenarios without manually annotated data and apply them to a variety of downstream tasks. In recent years, generative learning has achieved success in fields such as natural language processing.
[0033] In recent years, pre-training or self-supervised learning methods can be applied in natural language processing, computer vision, speech recognition and other fields. Pre-training refers to obtaining a set of feature representations or model parameters by training the model on a larger data set. The feature representation can be directly applied to downstream tasks, and the obtained model parameters can be fine-tuned according to the downstream tasks to obtain gains. It can learn the characteristics of the data itself from massive unlabeled data, so that downstream tasks can better use the knowledge obtained in the self-supervised learning stage according to the characteristics of the task itself. In the field of graph learning, how to perform pre-training is still an open question, and the existing technology has already conducted some exploration.
[0034] At present, contrastive learning has always been the mainstream paradigm of graph pre-training, which aims to learn label-invariant factors in different data enhancements. It relies on the careful design of components such as negative sample selection, model architecture design, and data enhancement. Negative samples can make the learned sample representations evenly distributed in space, thereby preventing the model from falling into trivial solutions. In the prior art, DGI and GCC based on mutual information maximization explored different negative sample selection methods. High-quality data enhancement plays a key role in the success of contrastive learning. Contrastive learning aims to learn label-invariant features of the same data in different forms. Therefore, effective data enhancement requires not only retaining the label-invariant information of the downstream tasks of the data, but also making differences between different enhancement results. Therefore, the prior art explores the effectiveness of various data enhancement strategies in the graph, including feature masking, structure destruction, random subgraph sampling, node deletion, etc. Since effective negative sample selection and data enhancement are very difficult to implement in the field of graph learning, the development of contrastive learning in the field of graph learning is severely restricted.
[0035] In addition to contrastive learning, generative self-supervised learning is also widely used in various fields. The purpose of generative learning is to restore the missing parts of the input data. The prior art proposes a GPT-GNN model based on the autoregressive method, which uses a self-supervised learning method to pre-train the GNN and capture the graph node features and graph structure information at the same time. Since most graphs do not show obvious node order characteristics, the autoregressive method does not show significant significance in the pre-training of graphs. Autoencoders are designed to reconstruct certain inputs in a given context and do not force decoding in a certain order like autoregressive methods. The earliest work can be traced back to graph autoencoders and variational graph autoencoders. Although graph autoencoders have been successfully applied in link prediction and graph clustering, their results on node classification and graph classification tasks are usually unsatisfactory. In the fields of natural language processing and computer vision, generative self-supervised learning shows greater potential than contrastive learning.
[0036] Therefore, in the related technologies, the accuracy of self-supervised learning technology in node classification and graph classification tasks is relatively low. In the field of self-supervised learning of graphs, existing contrastive learning methods rely heavily on structural data augmentation and complex training strategies, while the progress of generative learning on graphs, especially graph autoencoders, has not yet achieved good performance. Therefore, a mask-based graph autoencoder is needed to alleviate the problem of generative self-supervised graph learning.
[0037] In order to solve the relevant technical problems in the prior art, the present disclosure proposes a self-supervised training method for graph data, which obtains first training data by processing input sample data, inputs the first training data into an automatic encoder to obtain second training data, compares the similarity between the second training data and the input sample data, and performs data training based on the comparison results, thereby realizing data learning through a self-supervised algorithm, greatly improving the accuracy of graph network data classification.
[0038] The following describes in detail with reference to the accompanying drawings a method, device, electronic device, storage medium, and program product for implementing the self-supervised training of graph data proposed in the present disclosure.
[0039] Figure 1 The flowchart of a self-supervised training method for graph data provided by the embodiment of the present disclosure is shown in FIG. The method proposed in the present disclosure can be applied to at least the fields of natural language processing, computer vision, speech recognition, etc., and can be applied to products in the fields of natural language processing, computer vision, speech recognition, etc., such as electronic devices such as smart terminals. Figure 1 As shown, the method comprises the following steps:
[0040] Step 101: Process input sample data to obtain first training data.
[0041] In one implementation of the present disclosure, the embodiment of the present disclosure mainly adopts a masked autoencoder as a pre-training model.
[0042] Specifically, input sample data, that is, a graph G = (V, A, X). Randomly sample a certain proportion of nodes from graph G The node features are replaced by a common mask identifier [MASK]. Thus, the first training data is obtained, namely in is the result after masking X.
[0043] Here, let G = (V, A, X) represent a graph, V represents the set of all nodes, N = |V| represents the number of nodes, and A∈{0,1} N×N is the adjacency matrix, X∈R N×d is the feature matrix of the input node. In the present disclosure, X is also referred to as the original feature. G′ represents the reconstructed graph, which can be either the reconstructed node feature or the reconstructed structure, or both. In the present disclosure, the reconstructed node feature is specifically used as the training target as an example.
[0044] Those skilled in the art can understand that masking is equivalent to replacing part of the original data in the input sample data, which is equivalent to adding noise. The mask identifier [MASK] can be understood as a learnable vector. The feature matrix of the node on the graph after masking is expressed as Given some observed node features and the input adjacency matrix A, the goal of the graph autoencoder is to reconstruct the features of the obscured nodes in the node set V.
[0045] Step 102: input the first training data into the autoencoder to obtain second training data.
[0046] In one embodiment of the present disclosure, the first training data is processed through the encoding and decoding process in an automatic encoder.
[0047] Among them, autoencoder (AE) is a type of artificial neural network (ANNs) used in semi-supervised learning and unsupervised learning. Its function is to perform representation learning on the input information by taking the input information as the learning target.
[0048] The autoencoder includes an encoder, a coded representation, and a decoder. The encoder maps the input data to the coded representation, i.e., the obtained sample representation. The decoder maps the coded representation to the input data under the supervision of the reconstruction criterion to reconstruct the input data. Further, in the embodiment of the present disclosure, f E The encoder representing the graph, f D Represents a decoder, represents the result of the graph G after passing through the encoder, that is, the node representation. Therefore, the reconstruction target of GAE is expressed as H = f E (A,X),G ′ =f D (A,H).
[0049] Step 103: perform a similarity comparison between the second training data and the input sample data, and perform data training based on the comparison result.
[0050] In one embodiment of the present disclosure, for mask autoencoders in different fields, the function for measuring the reconstruction quality is different. In the embodiment of the present disclosure, the original features of each covered node are directly reconstructed, and the cosine error is used as the error function for reconstructing the original node features, thereby reducing the influence of the dimension and vector norm.
[0051] Therefore, according to the embodiments of the present disclosure, by processing the input sample data, the first training data is obtained, the first training data is input into the autoencoder to obtain the second training data, the similarity between the second training data and the input sample data is compared, and data training is performed based on the comparison result, thereby realizing data learning through a self-supervised algorithm, thereby greatly improving the accuracy of network graph data classification.
[0052] Figure 2 A flowchart of a method for self-supervised training of graph data provided in an embodiment of the present disclosure. Figure 2 based on Figure 1 In the embodiment shown, step 102 is further defined. Figure 2 In the illustrated embodiment, step 102 includes step 201 and step 202 .
[0053] like Figure 2 As shown, the method includes the following steps.
[0054] Step 201: input first training data into an encoder to obtain implicit representations of all nodes in the input sample data.
[0055] In some embodiments of the present disclosure, the image after adding noise As input, a multi-layer graph neural network is used as an encoder
[0056] Among them, when the dimension of the node representation obtained by the encoder is much larger than the dimension of the input, the autoencoder is likely to learn the "identity mapping function", that is, a trivial solution, which makes the encoder's role very small. Denoising autoencoders can avoid trivial solutions by adding noise to the input data.
[0057] Step 202: input the implicit representation of the sampled node into a decoder to output second training data.
[0058] In some embodiments of the present disclosure, this step specifically includes: masking the implicit representation of the sampled nodes in the input sample data by a second mask identifier, and using the input sample data masked by the second mask identifier as the second training data.
[0059] Specifically, a "re-masking" strategy is used to replace the implicit representation of the selected node in the input sample data with another mask identifier [DMASK], that is, the decoder mask identifier vector. The re-masked implicit representation is used as input, and another single-layer graph neural network is used as a decoder to reconstruct the input features of the node. The identifier [DMASK] is shared by all masked nodes and is different from the mask tag used in the encoding stage. Through re-masking and using the graph neural network decoder, the masked nodes are "required" to reconstruct their input features from the adjacent uncovered node representations. The feature matrix after re-masking is recorded as
[0060] Among them, the role of the graph decoder f D The node representation H obtained by the encoder is mapped back to the input node feature X. Its design will depend on the semantic level of the reconstruction target X. In the figure, the decoder reconstructs high-dimensional node features with relatively small information. The graph neural network decoder can recover its own input features based on the node distribution around a node, not limited to the node itself, which can help the encoder learn high-level information.
[0061] In summary, according to an embodiment of the present disclosure, by inputting the first training data into the encoder to obtain implicit representations of all nodes in the input sample data, and inputting the implicit representations of the sampled nodes into the decoder to output the second training data, it is achieved that when the dimension of the node representation obtained by the encoder is much larger than the dimension of the input, noise is added to the input data, avoiding the "identical mapping function" (i.e., a trivial solution) and alleviating the problem of heavy reliance on structural data enhancement and complex training strategies.
[0062] Figure 3 A flowchart of a method for self-supervised training of graph data provided in an embodiment of the present disclosure. Figure 3 based on Figure 1In the illustrated embodiment, steps 101 , 102 , and 103 are further defined, wherein step 101 may specifically include step 301 , step 302 , and step 303 , and step 102 includes step 303 and step 304 .
[0063] like Figure 3 As shown, the method includes the following steps.
[0064] Step 301, obtaining input sample data.
[0065] In one embodiment of the present disclosure, the input sample data includes: a set of all nodes, the number of nodes, an adjacency matrix, and a feature matrix of the input nodes.
[0066] Step 302: sampling nodes in the input sample data.
[0067] In one embodiment of the present disclosure, a uniform random sampling strategy without replacement is used to select nodes that need to be covered. In a graph neural network, each node can rely on its neighboring nodes to enhance or restore its features.
[0068] Step 303: mask the original features of the sampled nodes in the input sample data by using the first mask identifier, and determine the input sample data masked by the first mask identifier as the first training data.
[0069] In one embodiment of the present disclosure, X in the input sample data, that is, the input node feature matrix, is mainly processed. Using [MASK] may cause a mismatch between training and reasoning, because the [MASK] identifier does not appear during the reasoning process. In order to reduce this difference, the embodiment of the present disclosure keeps the node feature unchanged or replaces it with another random identifier with a smaller probability, that is, 15% or less. Among them, the specific value is not limited in the embodiment of the present disclosure. The image after adding the mask is recorded as
[0070] Step 304: input the first training data into the encoder to obtain implicit representations of all nodes in the input sample data.
[0071] Step 305: input the implicit representation of the sampled node into a decoder to output second training data.
[0072] Step 304 and step 305 have the same or similar functions as the above-mentioned step 201 and step 202, and their implementation methods can be performed with reference to the above-mentioned embodiment, which will not be described in detail here.
[0073] Step 306: perform a similarity comparison between the second training data and the input sample data, and perform data training based on the comparison result.
[0074] In one embodiment of the present disclosure, the step includes: calculating the similarity between the second training data and the input sample data by a reconstruction evaluation function. Based on a scaling factor, a reconstruction evaluation function is constructed, wherein the reconstruction evaluation function is a scaled cosine error function, and the scaling factor is greater than or equal to 1.
[0075] Specifically, the L2 normalization in the cosine error maps the vector to a "unit hypersphere", which can improve the training stability of representation learning. At the same time, the scalable cosine error is introduced to further improve the cosine error. The contribution of simple samples in training can be reduced by adjusting the cosine error to a power less than 1. For predictions with high confidence, the corresponding cosine error is usually less than 1, and when the scaling factor is greater than 1, it decays to zero faster. Formally speaking, given the original feature X and the reconstructed output The definition of the scaled cosine error can be defined as:
[0076]
[0077] Among them, X represents the original feature, that is, the input node feature matrix, x i is the vector represented by the i-th row of matrix X, Z represents the output of the decoder, z i is the vector represented by the i-th row of the matrix Z, γ represents the scaling factor, is the set of nodes masked in the aforementioned input data, is the size of the collection.
[0078] The final error calculation is the average of the errors of all covered nodes. The scaling factor is a hyperparameter that can be adjusted on different datasets.
[0079] In summary, according to an embodiment of the present disclosure, by obtaining input sample data, sampling nodes in the input sample data, masking the original features of the sampled nodes in the input sample data by a first mask identifier, and determining the input sample data masked by the first mask identifier as the first training data, the first training data is input into the encoder to obtain implicit representations of all nodes in the input sample data, and the implicit representations of the sampled nodes are input into the decoder to output second training data, and the second training data is compared with the input sample data for similarity, and data training is performed based on the comparison results. This achieves the addition of noise to the input data when the dimension of the node representation obtained by the encoder is much larger than the dimension of the input, avoiding the "identical mapping function" (i.e., a trivial solution), alleviating the problem of heavy reliance on structural data enhancement and complex training strategies, and greatly improving the accuracy of graph network data classification when data learning is performed through a self-supervised algorithm.
[0080] Regarding the above Figure 3 The embodiment shown in the present disclosure provides a schematic diagram of a specific graph data self-supervised training. Figure 4 A schematic diagram of a generative self-supervised learning based on a graph autoencoder is shown. The above method is only used as an example of the present disclosure and does not constitute a limitation of the present disclosure.
[0081] In view of the above graph data self-supervised training method, the present disclosure verifies the effectiveness of the above method on node classification and graph classification tasks. Table 1 shows the experimental results of a node classification task, and Table 2 shows the experimental results of a graph classification task.
[0082] Table 1 Experimental results of node classification task
[0083] Dataset Cora Ogbn-arxiv PPI Reddit # Number of nodes 2,708 169,343 56,944 232,965 #Number of edges 5,429 1,166,243 818,736 11,606,919 GCN 81.5% 70.3% 75.7% 95.3% DGI 82.3% 70.3% 63.8% 94.0% BGRL 82.7% 71.6% 73.6% 94.2% The disclosed method 84.2% 71.8% 74.5% 96.0%
[0084] Table 2 Experimental results of image classification task
[0085] IMDB-B IMDB-M PROTEINS NCI1 #Number of images 1,000 1,500 1,113 4,110 WL 72.30% 46.95% 72.92% 80.31% GraphCL 71.14% 48.58% 74.39% 77.87% This patented method 75.52% 51.63% 75.30% 80.40%
[0086] Among them, experiments on node classification are conducted on networks of different types and sizes. The purpose of node classification is to predict the types of nodes in the network, such as the topic of a paper in an academic network, the interests of users in a social network, etc. The experiment uses academic networks Cora and Ogbn-arxiv, social network Reddit, and protein network PPI. The scale of the network and the experimental results are shown in the table above. The experimental results show the accuracy of data classification. On networks of different types and sizes, the proposed generative self-supervised learning method based on mask prediction is superior to the previous contrastive learning and generative learning methods. On some data sets, the performance of the unsupervised method even exceeds the GCN model under supervised learning.
[0087] The purpose of graph classification is to obtain a vector representation of the entire graph level and distinguish the type of a graph, such as the chirality of a molecular graph, the properties of a protein, etc., which tests the network's ability to abstract and extract the structure and features of the entire graph. The experiment evaluated the ability of this method on the social network IMDB, the biochemical network PREOTEINS and NCI1. As shown in the table above, the accuracy of data classification of this method exceeds that of the traditional kernel method WL and the contrastive learning-based method GraphCL, which shows the effectiveness of this method.
[0088] Corresponding to the above-mentioned graph data self-supervised training method, the present disclosure also proposes a graph data self-supervised training device. Figure 5 Schematic diagram of a graph data self-supervised training device 500 provided in an embodiment of the present disclosure. Figure 5As shown, it includes: a processing unit 510, used to process input sample data to obtain first training data; an input unit 520, used to input the first training data into the automatic encoder to obtain second training data; a comparison unit 530, used to compare the similarity between the second training data and the input sample data, and perform data training according to the comparison result.
[0089] In some embodiments, the processing unit 510 is specifically used to obtain input sample data, sample nodes in the input sample data, cover the original features of the sampled nodes in the input sample data through a first mask identifier, and determine the input sample data covered by the first mask identifier as the first training data.
[0090] In some embodiments, the input unit 520 also includes: an encoding unit, used to input the first training data into an encoder to obtain implicit representations of all nodes in the input sample data, wherein the encoder is a first graph neural network.
[0091] In some embodiments, the input unit 520 also includes: a decoding unit, used to input the implicit representation of the sampled node into a decoder to output second training data, wherein the decoder is a second graph neural network; a re-masking unit, used to mask the implicit representation of the sampled node in the input sample data through a second mask identifier, and use the input sample data masked by the second mask identifier as the second training data.
[0092] In some embodiments, the comparison unit 530 also includes: a calculation unit, used to calculate the similarity between the second training data and the input sample data through a reconstruction evaluation function; and a construction unit, used to construct a reconstruction evaluation function based on a scaling factor, wherein the reconstruction evaluation function is a scaled cosine error function, and the scaling factor is greater than or equal to 1.
[0093] In summary, according to the embodiments of the present disclosure, the device implements data learning through a self-supervised algorithm through the corresponding functions of the processing unit, the input unit, and the comparison unit, thereby greatly improving the accuracy of graph data classification.
[0094] It should be noted that since the device embodiment of the present disclosure corresponds to the above-mentioned method embodiment, the above-mentioned explanation of the method embodiment is also applicable to the device of the present embodiment, and the principle is the same. For details not disclosed in the device embodiment, reference can be made to the above-mentioned method embodiment, and they will not be repeated in this disclosure.
[0095] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0096] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0097] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 602 or a computer program loaded from a storage unit 608 to a RAM (Random Access Memory) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 803 are connected to each other via a bus 604. An I / O (Input / Output) interface 605 is also connected to the bus 604.
[0098] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0099] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the self-supervised training method for graph data. For example, in some embodiments, the self-supervised training method for graph data may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the aforementioned graph data self-supervised training method in any other appropriate manner (for example, by means of firmware).
[0100] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0102] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0105] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0106] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the present disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and this document is not limited here. The above specific implementation methods do not constitute limitations on the scope of protection of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A graph data self-supervised training method, characterized in that: include: Get input sample data, the input sample data is a graph G = (V, A, X), where V represents the set of all nodes, N = |V| represents the number of nodes, A∈{0,1} N×N is the adjacency matrix, X∈R N×d is the feature matrix of the input node, Sampling nodes in the input sample data, Using a first mask identifier to mask original features of sampled nodes in the input sample data, and determining the input sample data masked by the first mask identifier as first training data; The first training data is input into an encoder to obtain implicit representations of all nodes in the input sample data, the autoencoder comprising the encoder, the encoder being a first graph neural network, Inputting the implicit representation of the sampled node into a decoder, masking the implicit representation of the sampled node in the input sample data by a second mask identifier, and using the input sample data masked by the second mask identifier as second training data, wherein the autoencoder further includes a decoder, and the decoder is a second graph neural network; The similarity between the second training data and the input sample data is calculated by reconstructing an evaluation function, and the similarity between the second training data and the input sample data is compared, and data training is performed according to the comparison result, wherein the reconstruction evaluation function is constructed based on a scaling factor, the scaling factor is greater than or equal to 1, and the reconstruction evaluation function is a scaled cosine error function, and the scaled cosine error function is defined as: Where X represents the input node feature matrix, x i is the vector represented by the i-th row of the node feature matrix X, Z represents the output of the decoder, z i To reconstruct the vector represented by the i-th row of the output matrix Z, γ represents the scaling factor, is the set of nodes masked in the aforementioned input data, is the size of the collection.
2. A graph data self-supervised training device, characterized in that: include: A processing unit is used to obtain input sample data, wherein the input sample data is a graph G=(V, A, X), where V represents the set of all nodes, N=|V| represents the number of nodes, and A∈{0,1} N×N is the adjacency matrix, X∈R N×d is the feature matrix of the input node, Sampling nodes in the input sample data, Using a first mask identifier to mask original features of sampled nodes in the input sample data, and determining the input sample data masked by the first mask identifier as first training data; An input unit is used to input the first training data into an encoder to obtain implicit representations of all nodes in the input sample data, the autoencoder includes the encoder, and the encoder is a first graph neural network, Inputting the implicit representation of the sampled node into a decoder, masking the implicit representation of the sampled node in the input sample data by a second mask identifier, and using the input sample data masked by the second mask identifier as second training data, wherein the autoencoder further includes a decoder, and the decoder is a second graph neural network; A comparison unit is used to calculate the similarity between the second training data and the input sample data through a reconstruction evaluation function, perform a similarity comparison between the second training data and the input sample data, and perform data training according to the comparison result, wherein the reconstruction evaluation function is constructed based on a scaling factor, the scaling factor is greater than or equal to 1, and the reconstruction evaluation function is a scaled cosine error function, and the scaled cosine error function is defined as: Where X represents the input node feature matrix, x i is the vector represented by the i-th row of the node feature matrix X, Z represents the output of the decoder, z i To reconstruct the vector represented by the i-th row of the output matrix Z, γ represents the scaling factor, is the set of nodes masked in the aforementioned input data, is the size of the collection.
3. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, wherein the instructions are executed by the at least one processor so as to enable the at least one processor to perform the method of claim 1 .
4. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to claim 1.
5. A computer program product comprising a computer program which, when executed by a processor, implements the method according to claim 1.
