CN113515519A - Training method, device, device and storage medium for graph structure estimation model - Google Patents
Training method, device, device and storage medium for graph structure estimation model Download PDFInfo
- Publication number
- CN113515519A CN113515519A CN202011574363.8A CN202011574363A CN113515519A CN 113515519 A CN113515519 A CN 113515519A CN 202011574363 A CN202011574363 A CN 202011574363A CN 113515519 A CN113515519 A CN 113515519A
- Authority
- CN
- China
- Prior art keywords
- graph
- candidate
- node
- probability
- prediction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
- G06F16/285—Clustering or classification
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开了一种图结构估计模型的训练方法、装置、设备及存储介质,其中方法包括:获取初始图以及初始图对应的标签信息;初始图包含多个节点,标签信息用于指示初始图中目标节点所属类别,目标节点为初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对初始图进行预测处理,得到初始图对应的观测信息;调用图结构估计模型包括的图估计器基于标签信息和观测信息进行估计处理得到估计图;并调用图预测模型对估计图进行预测处理,得到估计图对应的预测信息;基于估计图对应的预测信息和标签信息对图预测模型进行优化。采用本发明实施例可提供图结构估计模型的准确度。
Embodiments of the present invention disclose a training method, device, device and storage medium for a graph structure estimation model, wherein the method includes: acquiring an initial graph and label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate The category of the target node in the initial graph, and the target node is any one or more of the multiple nodes in the initial graph; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call The graph estimator included in the graph structure estimation model performs estimation processing based on label information and observation information to obtain an estimated graph; and calls the graph prediction model to perform prediction processing on the estimated graph to obtain the prediction information corresponding to the estimated graph; based on the prediction information corresponding to the estimated graph and The label information optimizes the graph prediction model. By adopting the embodiments of the present invention, the accuracy of the graph structure estimation model can be provided.
Description
技术领域technical field
本申请涉及图处理领域,尤其涉及一种图结构估计模型的训练方法、装置、设备及存储介质。The present application relates to the field of graph processing, and in particular, to a training method, apparatus, device and storage medium for a graph structure estimation model.
背景技术Background technique
从化学和生物信息学研究到图像和社交网络分析,图无处不在。所谓图,是用于描述社区关系链最直接的工具,由节点和边组成,节点代表社区中的对象,边代表两个对象之间的联系紧密程度。由于图的普遍性,学习图的有效表示并将其应用于下游任务尤其重要。最近,用于图表示学习的图处理模型引起了广泛关注,比如图神经网络(Graph NeuralNetworks)GNN模型、图卷积网络(Graph Convolutional Network)GCN模型等;以图神经网络GNN模型为例,该模型大致遵循递归消息传递机制,即邻域信息被聚合并传递给邻居。Graphs are everywhere, from chemical and bioinformatics research to image and social network analysis. The so-called graph is the most direct tool used to describe the community relationship chain. It consists of nodes and edges. The nodes represent the objects in the community, and the edges represent the closeness of the connection between the two objects. Due to the ubiquity of graphs, it is especially important to learn efficient representations of graphs and apply them to downstream tasks. Recently, graph processing models for graph representation learning have attracted widespread attention, such as Graph Neural Networks (GNN) model, Graph Convolutional Network (Graph Convolutional Network) GCN model, etc. The model roughly follows a recursive message passing mechanism, i.e., neighborhood information is aggregated and passed to neighbors.
目前使用的图处理模型通常是基于图训练样本进行训练得到的,在训练时一般假设图训练样本的图结构是正确,并且符合图处理模型的模型性质。但是图训练样本一般是抽取自实际应用中复杂的交互系统,由于实际应用的交互系统中存在一些错误可能导致图训练样本存在一些缺失、无意义、甚至错误的边,这导致图训练样本与GNN的性质不匹配,从而影响GNN模型的准确度。因此,在图处理领域,如何对用于对图处理的模型进行训练以提高模型的准确度成为研究的热点问题。Currently used graph processing models are usually obtained by training based on graph training samples. During training, it is generally assumed that the graph structure of the graph training samples is correct and conforms to the model properties of the graph processing model. However, the graph training samples are generally extracted from complex interactive systems in practical applications. Due to some errors in the interactive system of practical applications, there may be some missing, meaningless, or even wrong edges in the graph training samples, which leads to the graph training samples and GNN. The properties do not match, thus affecting the accuracy of the GNN model. Therefore, in the field of graph processing, how to train the model for graph processing to improve the accuracy of the model has become a hot research issue.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种图结构估计模型的训练方法、装置、设备及存储介质,可提高图结构估计模型的准确性。The embodiments of the present invention provide a training method, apparatus, device and storage medium for a graph structure estimation model, which can improve the accuracy of the graph structure estimation model.
一方面,本发明实施例提供了一种图结构估计模型的训练方法,包括:On the one hand, an embodiment of the present invention provides a method for training a graph structure estimation model, including:
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. any one or more of the nodes;
调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;Calling the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph;
调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;Calling the graph estimator included in the graph structure estimation model to perform estimation processing based on the label information and the observation information to obtain an estimated graph; and calling the graph prediction model to perform prediction processing on the estimated graph to obtain the estimated graph Corresponding prediction information, where the prediction information corresponding to the estimation graph is used to indicate the category to which each node in the estimation graph belongs;
基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。The graph prediction model is optimized based on the prediction information corresponding to the estimated graph and the label information.
一方面,本发明实施例还提供了一种图结构估计模型的训练装置,包括:On the one hand, an embodiment of the present invention also provides a training device for a graph structure estimation model, including:
获取单元,用于获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;an obtaining unit, configured to obtain an initial graph and label information corresponding to the initial graph; the initial graph includes a plurality of nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is the any one or more of the multiple nodes of the initial graph;
处理单元,用于调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;a processing unit, configured to call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph;
所述处理单元,还用于调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;The processing unit is further configured to call a graph estimator included in the graph structure estimation model to perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform an estimation on the estimated graph. Prediction processing to obtain prediction information corresponding to the estimation graph, where the prediction information corresponding to the estimation graph is used to indicate the category to which each node in the estimation graph belongs;
所述处理单元,还用于基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。The processing unit is further configured to optimize the graph prediction model based on the prediction information corresponding to the estimation graph and the label information.
一方面,本发明实施例提供了一种图结构估计模型的训练设备,其特征在于,包括:处理器,适用于实现一条或多条计算机程序;以及计算机存储介质,计算机存储介质存储有一条或多条计算机程序,一条或多条计算机程序适于由处理器加载并执行:On the one hand, an embodiment of the present invention provides a training device for a graph structure estimation model, which is characterized by comprising: a processor adapted to implement one or more computer programs; and a computer storage medium, which stores one or more computer programs. Computer programs, one or more of which are adapted to be loaded and executed by a processor:
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. Any one or more of the nodes; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call the graph estimator included in the graph structure estimation model Perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph, and the prediction corresponding to the estimated graph The information is used to indicate the category to which each node in the estimation graph belongs; the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information.
一方面,本发明实施例提供了一种计算机存储介质,计算机存储介质存储有计算机程序,计算机程序被处理器执行时,用于执行:On the one hand, an embodiment of the present invention provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed by a processor, is used to execute:
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. Any one or more of the nodes; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call the graph estimator included in the graph structure estimation model Perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph, and the prediction corresponding to the estimated graph The information is used to indicate the category to which each node in the estimation graph belongs; the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information.
一方面,本发明实施例提供了一种计算机程序产品或计算机程序,计算机程序产品包括计算机程序,计算机程序存储在计算机存储介质中;模型处理设备的处理器从计算机存储介质中读取计算机程序,处理器执行计算机程序,使得模型处理设备执行:On the one hand, an embodiment of the present invention provides a computer program product or a computer program, the computer program product includes a computer program, and the computer program is stored in a computer storage medium; the processor of the model processing device reads the computer program from the computer storage medium, The processor executes the computer program, causing the model processing device to execute:
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. Any one or more of the nodes; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call the graph estimator included in the graph structure estimation model Perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph, and the prediction corresponding to the estimated graph The information is used to indicate the category to which each node in the estimation graph belongs; the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information.
本发明实施例中,提出了一种新对图进行处理的模型,即图结构估计模型,该图结构估计模型由图预测模型和图估计器组成。在对图结构估计模型进行优化的过程中,可调用图结构估计模型中的图预测模型对初始图进行预测处理,得到所述初始图对应的观测信息,所述观测信息包括所述初始图对应的预测信息;然后调用图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;进一步的,调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息;基于所述估计图对应的预测信息和所述初始图对应的标签信息对所述图预测模型进行优化。In the embodiment of the present invention, a new model for processing graphs, that is, a graph structure estimation model is proposed, and the graph structure estimation model is composed of a graph prediction model and a graph estimator. In the process of optimizing the graph structure estimation model, the graph prediction model in the graph structure estimation model can be invoked to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes the corresponding initial graph. The prediction information of Prediction information; optimize the graph prediction model based on the prediction information corresponding to the estimated graph and the label information corresponding to the initial graph.
通过上述过程可见,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图预测模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的。换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen from the above process that the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also optimizes the graph prediction model based on the estimated graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is to say, the estimated graph better matches the properties of the graph prediction model than the initial graph, which is more in line with the graph structure. Estimate the properties of the model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
附图说明Description of drawings
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention, which are of great significance to the art For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1是本发明实施例提供的一种社交网络的图的示意图;1 is a schematic diagram of a diagram of a social network provided by an embodiment of the present invention;
图2是本发明实施例提供的一种图结构估计模型的示意图;2 is a schematic diagram of a graph structure estimation model provided by an embodiment of the present invention;
图3是本发明实施例提供的一种图结构估计模型的训练方法的流程示意图;3 is a schematic flowchart of a training method for a graph structure estimation model provided by an embodiment of the present invention;
图4a是本发明实施例提供的一种初始图的示意图;4a is a schematic diagram of an initial diagram provided by an embodiment of the present invention;
图4b是本发明实施例提供的一种初始图对应的邻接矩阵的示意图;4b is a schematic diagram of an adjacency matrix corresponding to an initial graph provided by an embodiment of the present invention;
图5是本发明实施例提供的另一种图结构估计模型的训练处理方法的流程示意图;5 is a schematic flowchart of another training processing method for a graph structure estimation model provided by an embodiment of the present invention;
图6是本发明实施例提供的一种确定估计邻接矩阵的示意图;6 is a schematic diagram of determining an estimated adjacency matrix provided by an embodiment of the present invention;
图7是本发明实施例提供的一种图结构估计模型的训练的示意图;7 is a schematic diagram of training of a graph structure estimation model provided by an embodiment of the present invention;
图8a是本发明实施例提供的一种GCN模型和GEN模型对各个节点的预测值的箱型图;8a is a box plot of the predicted values of each node by a GCN model and a GEN model provided by an embodiment of the present invention;
图8b是本发明实施例提供的一种GEN模型在两个不同数据集上true-positive概率和false-positive概率的变化曲线;Fig. 8b is the variation curve of true-positive probability and false-positive probability on two different data sets of a kind of GEN model that the embodiment of the present invention provides;
图9a是本发明实施例提供的一种GEN模型和其他图处理模型的准确率曲线示意图;9a is a schematic diagram of the accuracy curve of a GEN model and other graph processing models provided by an embodiment of the present invention;
图9b是本发明实施例提供的一种可视化的初始图和估计图;FIG. 9b is a visualized initial graph and estimation graph provided by an embodiment of the present invention;
图9c是本发明实施例提供的一种初始图和估计图的社区间的概率矩阵;9c is a probability matrix between communities of an initial graph and an estimated graph provided by an embodiment of the present invention;
图9d是本发明实施例提供的一种第一数量和节点对之间的关系图;9d is a relationship diagram between a first quantity and a node pair provided by an embodiment of the present invention;
图9e是本发明实施例提供的一种不同社区的边置信度在对GEN模型进行训练的训练数据集上、验证数据集上以及测试数据集上的归一化直方图;Fig. 9e is the normalized histogram of the edge confidence of a kind of different communities provided by the embodiment of the present invention on the training data set, the verification data set and the test data set for training the GEN model;
图10是本发明实施例提供的一种图结构估计模型的训练装置的结构示意图;10 is a schematic structural diagram of a training device for a graph structure estimation model provided by an embodiment of the present invention;
图11是本发明实施例提供的一种图结构估计模型的训练设备的结构示意图。FIG. 11 is a schematic structural diagram of a training device for a graph structure estimation model provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
图是用于描述社区关系链最直接的工具,由节点和边组成,节点代表社区中的对象,边代表两个对象之间的联系紧密程度。在狭义上,社区是具有某种互动关系的和共同文化维系力的,在一定领域内相互关联的人群形成的共同体及其互动区域,比如一个空手道俱乐部可以看成是一个社区,再如一个公司可以看成是一个社区;在广义上,社区可以包括社交网络、生物网络以及基础设施网络比如能源、交通、互联网和通信。图可以包括有向图和无向图,有向图中的各个边是有方向的,无向图中各个边是无方向的。A graph is the most direct tool used to describe the community relationship chain. It consists of nodes and edges. Nodes represent objects in the community, and edges represent the degree of connection between two objects. In a narrow sense, a community has a certain interactive relationship and a common cultural tie. A community and its interactive area formed by interrelated people in a certain field. For example, a karate club can be regarded as a community, or a company. It can be thought of as a community; in a broad sense, a community can include social networks, biological networks, and infrastructure networks such as energy, transportation, the Internet, and communications. Graphs can include directed graphs and undirected graphs. Each edge in a directed graph is directed, and each edge in an undirected graph is undirected.
例如,参见图1为本发明实施例提供的一种社交网络的图,该图可以是一个有向图。该社交网络的对象可以包括用户、学校以及公司,这些对象作为图的节点;如果两个对象之间存在关联,则这两个对象之间存在边,比如用户101与用户102之间是好友关系,那么用户101和用户102之间存在一条边100;再如,用户101在公司103就职,那么用户101和公司103之间存在边104。以此类推,得到如图1所示的社交网络的图。For example, referring to FIG. 1 , which is a graph of a social network provided by an embodiment of the present invention, the graph may be a directed graph. The objects of the social network may include users, schools, and companies, and these objects are used as nodes of the graph; if there is an association between two objects, there is an edge between the two objects, for example,
在当今社会,由于图的普遍存在,对图进行高效准确的处理对下游任务尤其重要。基于深度学习的不断发展,对图进行处理的图处理模型应运而生。现有技术中所述图处理模型是指基于图神经网络(GNN)构造的模型。在过去的几年中,图神经网络GNN在解决图的机器学习问题上取得了巨大的成功,当前大多数的图神经网络的模型可以分为两类,一类基于频谱方法的图处理模型,另一类是基于空间方法的图处理模型。In today's society, due to the ubiquity of graphs, efficient and accurate processing of graphs is especially important for downstream tasks. Based on the continuous development of deep learning, a graph processing model for graph processing emerges as the times require. The graph processing model in the prior art refers to a model constructed based on a graph neural network (GNN). In the past few years, the graph neural network GNN has achieved great success in solving graph machine learning problems. Most of the current graph neural network models can be divided into two categories, one is the graph processing model based on the spectral method, Another category is graph processing models based on spatial methods.
基于频谱方法的图处理模型是利用图谱理论学习图中节点表示。例如,有的研究中使用傅里叶基提出了图上的基于谱域的卷积网络扩展;还有的研究中基于chebyshev多项式的图卷积,以消除计算量大的Laplacian特征分解;再有,一种典型的基于频谱方法的图神经网络是图卷积网络GCN,GCN是通过使用其一阶近似来进一步简化了基于chebyshev多项式的图卷积。Spectral-based graph processing models use graph theory to learn node representations in graphs. For example, some studies use the Fourier basis to propose a spectral domain-based convolution network extension on graphs; other studies use graph convolution based on chebyshev polynomials to eliminate computationally expensive Laplacian feature decomposition; , a typical spectral-based graph neural network is the graph convolutional network GCN, which further simplifies the chebyshev polynomial-based graph convolution by using its first-order approximation.
基于空间方法的图处理模型是直接在空间域中定义图卷积,以聚集和转换局部信息。例如,有的研究中通过采样和聚合邻居信息来学习聚合其;有的是研究中在聚合期间根据节点特征分配不同的边权重;还有的研究中为了提高效率,在每一层上执行重要性采样以采样固定数量的节点。Graph processing models based on spatial methods define graph convolutions directly in the spatial domain to aggregate and transform local information. For example, some studies learn to aggregate neighbor information by sampling and aggregating it; some studies assign different edge weights according to node features during aggregation; others perform importance sampling at each layer to improve efficiency to sample a fixed number of nodes.
上述这些图处理模型中,所有的图处理模型都是通过大量的图训练样本和图训练样本对应的标签信息训练得到,在训练过程中假设每个图训练样本均是正确的。但是图训练样本都是来自于复杂的交互系统,由于实际应用中各种交互系统中通常包含不确定性或者错误,例如,在描述蛋白质相互作用的图中,传统的实验误差是导致该图错误的主要来源,另一个原因是数据缺失;再如,因特网图是通过检查路由或跟踪路由路径进确定的,而路由表和跟踪路由路径集合只给出了边的子集。这就导致上述假设不成立,也就是说训练用的图训练样本不一定是正确的。Among the above graph processing models, all graph processing models are obtained by training a large number of graph training samples and the label information corresponding to the graph training samples. In the training process, it is assumed that each graph training sample is correct. However, graph training samples are all from complex interactive systems. In practical applications, various interactive systems usually contain uncertainties or errors. For example, in a graph describing protein interactions, traditional experimental errors lead to errors in the graph. Another reason is missing data; another example, the Internet graph is determined by examining routing or tracerouting paths, while routing tables and tracerouting path sets only give a subset of edges. This makes the above assumption not valid, that is to say, the graph training samples used for training are not necessarily correct.
基于不正确的图训练样本对图处理模型进行训练,可能会导致图处理模型的表示能力受到限制,从而影响图处理模型在实际应用中的准确性。一个典型的例子是图处理模型的性能会在同质性(即同一个社区内的节点倾向于相互连接)差的图上大大降低。简而言之,由于图训练样本中普遍存在缺失、无意义甚至错误的边,这导致其与图处理模型的性质不匹配,从而影响图处理模型的准确性。Training a graph processing model based on incorrect graph training samples may limit the representation capability of the graph processing model, thereby affecting the accuracy of the graph processing model in practical applications. A typical example is that the performance of graph processing models can degrade significantly on graphs with poor homogeneity (i.e. nodes within the same community tend to be connected to each other). In short, due to the prevalence of missing, meaningless, or even wrong edges in the graph training samples, this leads to a mismatch with the nature of the graph processing model, which affects the accuracy of the graph processing model.
基于此,发明人发现探索适合图处理模型的图训练样本是迫切需要的。然而,目前有效地学习适合于图处理模型的图训练样本在技术上具有挑战性。网络科学的很多文献中已经证明图的生成可能受某些基于原则的约束,例如配置模型。考虑这些原则,可以从根本驱使学得的图保持规则的全局结构,并对于实际观测中的噪声更鲁棒。但是,大多数上述方法对图的每条边进行参数化,没有考虑全局结构和图的基础生成机制。因此,学得的图对噪声和稀疏性的容忍度较低。另外,从一个信息源学习图不可避免地导致偏差和不确定性,合理的假设是如果一条边多次测量中存在,则该边存在的置信度会更大。Based on this, the inventors found that it is urgent to explore graph training samples suitable for graph processing models. However, it is currently technically challenging to efficiently learn graph training samples suitable for graph processing models. Much literature in network science has demonstrated that graph generation may be subject to certain principle-based constraints, such as configuration models. Considering these principles, the learned graph can be fundamentally driven to maintain a regular global structure and be more robust to noise in real observations. However, most of the above methods parameterize each edge of the graph without considering the global structure and the underlying generation mechanism of the graph. Therefore, the learned graph is less tolerant to noise and sparsity. In addition, learning a graph from one information source inevitably leads to bias and uncertainty, and it is reasonable to assume that if an edge exists in multiple measurements, the confidence that the edge exists will be greater.
综上所述,本发明实施例中提出了一种新的图处理模型,称为图结构估计模型。参见图2,为本发明实施例提供的一种图结构估计模型的结构示意图,图2所示的图处理模型200可以又可以称为图结构估计神经网络(GEN),图2所述的图处理模型200中包括图预测模型201和图估计器202,图预测模型201用于预测输入至所述图预测模型中的任一图中各个节点所属类别,图预测模型可以是基于图神经网络构建的模型,比如图预测模型是基于图神经网络中的图卷积网络GCN构建的模型;所述图估计器202用于根据输入至所述图估计器的观测信息进行估计,得到估计图。图估计器202的输入是根据图预测模型在对任一图进行预测处理过程中得到的。To sum up, a new graph processing model is proposed in the embodiment of the present invention, which is called a graph structure estimation model. Referring to FIG. 2, it is a schematic structural diagram of a graph structure estimation model provided by an embodiment of the present invention. The
基于图2所示的新的图结构估计模型,本发明实施例提供了一种模型处理方案,该模型处理方案用于对图2所示的图结构估计模型200进行训练。具体地,调用图结构估计模型200中的图预测模型201对初始图(该初始图可以称为一个图训练样本)进行预测处理,得到图预测模型201对初始图进行观测的观测信息;然后调用图结构估计模型200中的图估计器202根据观测信息和初始图对应的标签信息进行估计得到一个估计图;进一步的,将估计图输入到图预测模型201中进行预测得到预测信息,接着基于该预测信息和标签信息对图预测模型201进行优化。如果检测到结束训练指示,则将上述优化后的图预测模型和图估计器组成优化后的图结构估计模型。Based on the new graph structure estimation model shown in FIG. 2 , an embodiment of the present invention provides a model processing solution, and the model processing solution is used to train the graph
后续如果检测到有待识别图输入至优化后的图结构估计模型中,则调用图结构估计模型中的图预测模型201对该待识别图进行预测处理,得到观测信息;进一步的,调用图结构估计模型中的图估计器202基于观测信息进行估计处理,得到估计图;然后,调用图预测模型对该估计图进行预测处理,输出处理结果。Subsequently, if it is detected that the graph to be identified is input into the optimized graph structure estimation model, the
可见,在采用本发明实施例中的模型处理方案对新的图结构估计模型进行训练的过程中,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图结构估计模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的,换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen that in the process of training a new graph structure estimation model using the model processing scheme in the embodiment of the present invention, the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also The graph structure estimation model is optimized based on the estimation graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is, Compared with the initial graph, the estimated graph can better match the properties of the graph prediction model, which is also more in line with the properties of the graph structure estimation model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
基于上述的新的图结构估计模型和模型处理方案,本发明实施例提供了一种模型处理方法。参见图3,为本发明实施例提供的一种模型处理方法的流程示意图,图3所示的模型处理方法可由模型处理设备执行,具体可由模型处理设备的处理器执行。所述模型处理设备可以指终端或者服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此;服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。图3所示的模型处理方法可包括如下步骤:Based on the above-mentioned new graph structure estimation model and model processing scheme, an embodiment of the present invention provides a model processing method. Referring to FIG. 3 , which is a schematic flowchart of a model processing method provided by an embodiment of the present invention, the model processing method shown in FIG. 3 may be executed by a model processing device, and specifically may be executed by a processor of the model processing device. The model processing device may refer to a terminal or a server, wherein the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this; the server may be an independent physical server, It can also be a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, and security services. , CDN, and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. The model processing method shown in FIG. 3 may include the following steps:
步骤S301、获取初始图以及初始图对应的标签信息。Step S301 , acquiring an initial image and label information corresponding to the initial image.
在一个实施例中,所述初始图可以是任意一个图,初始图中可以包含多个节点。可选的,假设初始图可以表示为其中表示初始图包括的节点的集合,假设初始图中包括N个节点,则ε表示初始图中边的集合,X表示初始图的节点特征矩阵,X可以表示为: xi是指节点vi的特征向量,i大于等于1小于等于N。In one embodiment, the initial graph may be any graph, and the initial graph may include multiple nodes. Optionally, it is assumed that the initial graph can be represented as in Represents the set of nodes included in the initial graph. Assuming that the initial graph includes N nodes, then ε represents the set of edges in the initial graph, X represents the node feature matrix of the initial graph, and X can be expressed as: x i refers to the feature vector of node v i , i is greater than or equal to 1 and less than or equal to N.
可选的,初始图对应的标签信息用于指示初始图中目标节点所属的类别,目标节点可以指初始图包含的多个节点中任意一个或多个。例如,初始图中目标节点表示为v1对应的标签信息可以表示为y1,v2对应的标签信息可以表示为y2,以此类推,初始图对应的标签信息可以表示为 Optionally, the label information corresponding to the initial graph is used to indicate the category to which the target node in the initial graph belongs, and the target node may refer to any one or more of multiple nodes included in the initial graph. For example, the target node in the initial graph is represented as The label information corresponding to v 1 can be expressed as y 1 , the label information corresponding to v 2 can be expressed as y 2 , and so on, the label information corresponding to the initial graph can be expressed as
由前述可知,初始图中的边用来描述节点之间的关系。另外,初始图中节点之间的关系还可以由初始图对应的邻接矩阵表示,邻接矩阵中每个行和列用于表示初始图中的顶点,存储在vi行vj列位置处的矩阵元素表示节点vi和节点vj之间是否存在边,j大于等于1小于等于N。这样一来,基于邻接矩阵便可以构造出初始图,因此,在图处理领域中,任一图也可以通过所述任一图对应的邻接矩阵表示。As can be seen from the foregoing, the edges in the initial graph are used to describe the relationship between nodes. In addition, the relationship between the nodes in the initial graph can also be represented by the adjacency matrix corresponding to the initial graph. Each row and column in the adjacency matrix is used to represent the vertices in the initial graph, and the matrix stored at the position of v i row v j column The element indicates whether there is an edge between node v i and node v j , where j is greater than or equal to 1 and less than or equal to N. In this way, the initial graph can be constructed based on the adjacency matrix. Therefore, in the field of graph processing, any graph can also be represented by the adjacency matrix corresponding to the any graph.
举例来说,假设如果两个节点之间存在边,则两个节点交叉处的矩阵元素为1;如果两个节点之间不存在边,则这两个节点交叉处的矩阵元素为0。参见图4a为本发明实施例提供的一种初始图的示意图,假设初始图为一个无向图,初始图对应的邻接矩阵可如图4b中401所示。由图4a可见,节点v0和节点v1之间存在边,因此,在图4b所示的邻接矩阵中,节点v0和节点v1交叉处402的矩阵元素为1;节点v1和节点v5之间不存在边,因此,在图4b所示的邻接矩阵中,节点v1和节点v5交叉处403的矩阵元素为0。For example, suppose that if there is an edge between two nodes, the matrix element at the intersection of the two nodes is 1; if there is no edge between the two nodes, the matrix element at the intersection of the two nodes is 0. Referring to FIG. 4a, which is a schematic diagram of an initial graph provided by an embodiment of the present invention, assuming that the initial graph is an undirected graph, an adjacency matrix corresponding to the initial graph may be shown as 401 in FIG. 4b. It can be seen from Figure 4a that there is an edge between node v0 and node v1. Therefore, in the adjacency matrix shown in Figure 4b, the
步骤S302、调用图结构估计模型包括的图预测模型对初始图进行预测处理,得到初始图对应的观测信息,该观测信息包括初始图对应的预测信息。Step S302 , calling the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes prediction information corresponding to the initial graph.
由前述可知,图结构估计模型可由图预测模型和图估计器组成,其中,图预测模型用于对输入至图预测模型中初始图进行预测处理,得到初始图对应的预测信息,该预测信息用于表示初始图中各个节点所属类别;另外,图预测模型在对初始图进行预测处理过程中该会产生初始图对应的邻居图集合,邻居图集合和预测信息组成了图预测模型对初始图进行观测的观测信息。图估计器用于根据图预测模型对初始图进行观测的观测信息进行估计,得到任一图对应的估计图。As can be seen from the foregoing, the graph structure estimation model can be composed of a graph prediction model and a graph estimator, wherein the graph prediction model is used to perform prediction processing on the initial graph input to the graph prediction model, and obtain the prediction information corresponding to the initial graph. It indicates the category of each node in the initial graph; in addition, the graph prediction model will generate a neighbor graph set corresponding to the initial graph in the process of predicting the initial graph. The neighbor graph set and the prediction information form the graph prediction model. Observational information for observations. The graph estimator is used to estimate the observation information of the initial graph according to the graph prediction model, and obtain the estimated graph corresponding to any graph.
可选的,该图预测模型可以是基于图神经网络构建的,比如基于图卷积神经网络GCN构建的,基于图神经网络GNN构建的。本发明实施例中,优选的基于图卷积神经网络GCN构建图预测模型,Optionally, the graph prediction model may be constructed based on a graph neural network, for example, constructed based on a graph convolutional neural network GCN, or constructed based on a graph neural network GNN. In the embodiment of the present invention, a graph prediction model is preferably constructed based on the graph convolutional neural network GCN,
在一个实施例中,图预测模型可以包括多个卷积层,每一个卷积层用于对输入至该卷积层的数据进行卷积处理,前一个卷积层的输出作为后一个卷积层的输入。本发明实施例中以图预测模型包括两个卷积层为例来阐述图预测模型的工作原理,在实际应用中可以根据实际需求设置图预测模型的卷积层数量。In one embodiment, the graph prediction model may include multiple convolutional layers, each convolutional layer is used to perform convolutional processing on the data input to the convolutional layer, and the output of the previous convolutional layer is used as the next convolutional layer layer input. In the embodiment of the present invention, the graph prediction model includes two convolutional layers as an example to illustrate the working principle of the graph prediction model. In practical applications, the number of convolutional layers of the graph prediction model can be set according to actual requirements.
具体地,图预测模型包括第一卷积层和第二卷积层,所述调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到初始图对应的观测信息,包括:Specifically, the graph prediction model includes a first convolutional layer and a second convolutional layer, and the graph prediction model included in the graph structure estimation model is used to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, including:
获取所述初始图的节点特征矩阵,并将所述节点特征矩阵输入至所述第一卷积层以基于所述第一卷积层对应的第一权重参数进行卷积运算,得到第一节点表示矩阵;将所述第一节点表示矩阵输入至所述第二卷积层进行卷积以基于所述第二卷积层对应的第二权重参数进行卷积运算,得到第二节点表示矩阵,以及对所述第二节点表示矩阵进行归一化处理得到所述初始图对应的预测信息;基于所述第一节点表示矩阵构造第一邻居图,以及基于所述第二节点表示矩阵构造第二邻居图,并将所述第一邻居图和所述第二邻居图组成所述邻居图集合。Obtain the node feature matrix of the initial graph, and input the node feature matrix into the first convolution layer to perform a convolution operation based on the first weight parameter corresponding to the first convolution layer to obtain a first node Representation matrix; input the first node representation matrix to the second convolution layer for convolution to perform convolution operation based on the second weight parameter corresponding to the second convolution layer to obtain the second node representation matrix, and normalizing the second node representation matrix to obtain the prediction information corresponding to the initial graph; constructing a first neighbor graph based on the first node representation matrix, and constructing a second neighbor graph based on the second node representation matrix a neighbor graph, and the first neighbor graph and the second neighbor graph form the neighbor graph set.
下面具体介绍:本发明实施例的图预测模型是基于GCN网络构建的,GCN遵循邻域聚合策略,通过聚合邻居的节点表示来迭代更新节点表示矩阵,形式化地,GCN的第k个卷积层聚合规则可如公式(1)所示:The following is a detailed introduction: the graph prediction model of the embodiment of the present invention is constructed based on the GCN network, and the GCN follows the neighborhood aggregation strategy, and iteratively updates the node representation matrix by aggregating the node representations of the neighbors. Formally, the kth convolution of the GCN The layer aggregation rule can be shown in formula (1):
在公式(1)中,表示初始图对应的归一化的邻接矩阵,表示初始图对应的度矩阵,度矩阵对角上的矩阵元素是邻接矩阵所在行求和,具体地可以通过如下公式(2)表示:In formula (1), represents the normalized adjacency matrix corresponding to the initial graph, Represents the degree matrix corresponding to the initial graph. The matrix elements on the diagonal of the degree matrix are the sum of the rows of the adjacency matrix. Specifically, it can be expressed by the following formula (2):
在公式(1)中,W(k)表示第k个卷积层的权重矩阵,各个卷积层的权重矩阵组成了图预测模型的模型参数,k的取值为大于等于1小于等于图预测模型包括的卷积层的个数,本发明实施例中假设图预测模型包括两个卷积层,因此k的取值为大于等于1,小于等于2。图预测模型中每个卷积层对应一个权重矩阵,各个卷积层对应的权重矩阵组成了图预测模型的模型参数。可选的,假设第一个卷积层对应的权重矩阵表示为W(1),第二个卷积层对应的权重矩阵表示为W(2),那么图预测模型的模型参数可以表示为:Θ=(W(1),W(2))。In formula (1), W (k) represents the weight matrix of the kth convolutional layer, the weight matrix of each convolutional layer constitutes the model parameters of the graph prediction model, and the value of k is greater than or equal to 1 and less than or equal to the graph prediction The number of convolutional layers included in the model. In the embodiment of the present invention, it is assumed that the graph prediction model includes two convolutional layers, so the value of k is greater than or equal to 1 and less than or equal to 2. In the graph prediction model, each convolutional layer corresponds to a weight matrix, and the weight matrix corresponding to each convolutional layer constitutes the model parameters of the graph prediction model. Optionally, assuming that the weight matrix corresponding to the first convolutional layer is represented as W (1) and the weight matrix corresponding to the second convolutional layer is represented as W (2) , then the model parameters of the graph prediction model can be represented as: Θ=(W (1) ,W (2) ).
在公式(1)中,σ表示激活函数,H(k-1)表示第k-1个卷积层对应的节点表示矩阵,H(k)表示第k个卷积层对应的节点表示矩阵。作为特例的,初始图对应的节点特征矩阵X,也可以采用节点表示矩阵的形式表示,比如H(0)=X。初始图对应的预测信息是对最后一个卷积层输出的节点表示矩阵进行归一化处理得到的,假设图预测模型只有一个卷积层,那么初始图对应的预测信息可以表示为Z=H(1)。In formula (1), σ represents the activation function, H (k-1) represents the node representation matrix corresponding to the k-1th convolutional layer, and H (k) represents the node representation matrix corresponding to the kth convolutional layer. As a special case, the node feature matrix X corresponding to the initial graph may also be represented in the form of a node representation matrix, for example, H (0) =X. The prediction information corresponding to the initial graph is obtained by normalizing the node representation matrix output by the last convolution layer. Assuming that the graph prediction model has only one convolution layer, the prediction information corresponding to the initial graph can be expressed as Z=H ( 1) .
基于上述描述得到第一个卷积层对应的节点表示矩阵和第二个卷积层对应的节点表示矩阵后,进一步的,基于各个节点表示矩阵构造邻居图集合。具体地,假设各个卷积层对应的节点表示矩阵,与初始图的节点特征矩阵组成一个节点表示集合 由前述可知,H(0)=X表示初始图对应的节点特征矩阵。基于H(0)构建的邻居图(kNN)的邻接矩阵表示为O(0),基于第一节点表示矩阵构建的邻居图的邻接矩阵表示为O(1),以此类推,基于上述节点表示集合构建的邻居图集合表示为 After the node representation matrix corresponding to the first convolutional layer and the node representation matrix corresponding to the second convolutional layer are obtained based on the above description, further, a neighbor graph set is constructed based on each node representation matrix. Specifically, it is assumed that the node representation matrix corresponding to each convolutional layer forms a node representation set with the node feature matrix of the initial graph It can be seen from the foregoing that H (0) =X represents the node feature matrix corresponding to the initial graph. The adjacency matrix of the neighbor graph (kNN ) constructed based on H (0) is represented as O (0) , the adjacency matrix of the neighbor graph constructed based on the first node representation matrix is represented as O (1) , and so on, based on the above node representation The set of neighbor graphs constructed by the set is represented as
应当理解的,初始图也是图预测模型用于观测初始图的一个重要外部观测,因此,本发明实施例中将初始图和上述邻居图集合作为对初始图进行观测的观测图集合。进一步的,将初始图对应的观测图集合和初始图对应的预测信息作为观测信息输入至图估计器中。It should be understood that the initial graph is also an important external observation used by the graph prediction model to observe the initial graph. Therefore, in the embodiment of the present invention, the initial graph and the above-mentioned neighbor graph set are used as the observation graph set for observing the initial graph. Further, the observation graph set corresponding to the initial graph and the prediction information corresponding to the initial graph are input into the graph estimator as observation information.
在一个实施例中,步骤S302中图结构估计模型包括的图预测模型可以是预先训练完成的,已达到收敛的模型,本发明实施例中在获取到初始图后无需对图预测模型进行训练,直接执行步骤S302即可。或者,为了提高图预测模型和初始图之间的适配度,即使图预测模型在开始步骤S302之已达到收敛,本发明实施例还可以基于初始图以及初始图对应的标签信息对图预测模型进行优化。In one embodiment, the graph prediction model included in the graph structure estimation model in step S302 may be a model that has been pre-trained and has reached convergence. In this embodiment of the present invention, after the initial graph is obtained, the graph prediction model does not need to be trained. Step S302 can be directly executed. Alternatively, in order to improve the degree of adaptation between the graph prediction model and the initial graph, even if the graph prediction model has reached convergence before starting step S302, the embodiment of the present invention may further analyze the graph prediction model based on the initial graph and the label information corresponding to the initial graph. optimize.
在其他实施例中,如果图预测模型在执行步骤S302之前是未训练到收敛的模型,本发明实施例中模型处理设备需要基于初始图以及初始图对应的标签信息对图预测模型进行训练优化。In other embodiments, if the graph prediction model is not trained to converge before step S302 is performed, the model processing device in this embodiment of the present invention needs to perform training and optimization on the graph prediction model based on the initial graph and label information corresponding to the initial graph.
在一个实施例中,本发明实施例如果需要对基于初始图以及初始图对应的标签信息对图预测模型进行优化处理,则在图预测模型第一次对初始图进行预测处理得到邻居图集合之后,还可以包括:从所述初始图对应的预测信息中获取所述目标节点对应的预测信息,并确定所述目标节点对应的预测信息与所述标签信息之间的差异信息;根据所述差异信息构建所述图预测模型对应的损失函数;In one embodiment, if the embodiment of the present invention needs to optimize the graph prediction model based on the initial graph and the label information corresponding to the initial graph, after the graph prediction model performs prediction processing on the initial graph for the first time to obtain the neighbor graph set , may also include: obtaining the prediction information corresponding to the target node from the prediction information corresponding to the initial graph, and determining the difference information between the prediction information corresponding to the target node and the label information; information to construct a loss function corresponding to the graph prediction model;
按照减少所述损失函数的值的方向更新所述第一权重参数和所述第二权重参数;基于更新的第一权重参数和更新的第二权重参数分别更新所述初始图对应的预测信息和所述邻居图集合。Update the first weight parameter and the second weight parameter according to the direction of reducing the value of the loss function; update the prediction information and the corresponding prediction information of the initial graph based on the updated first weight parameter and the updated second weight parameter the set of neighbor graphs.
其中,图预测模型对应的损失函数可以是一个交叉熵函数,如果初始图通过初始图对应的邻接矩阵A表示,初始图对应的节点特征矩阵为X,初始图对应的标签信息标识为则图预测模型对应的损失函数可以表示为如下公式(3)所示:The loss function corresponding to the graph prediction model can be a cross-entropy function. If the initial graph is represented by the adjacency matrix A corresponding to the initial graph, the node feature matrix corresponding to the initial graph is X, and the label information corresponding to the initial graph is identified as Then the loss function corresponding to the graph prediction model can be expressed as the following formula (3):
在公式(3)中,是图预测模型学得的映射函数,是节点vi对应的预测信息,用于衡量任意一个节点的预测信息和该节点的标签信息之间的差异。In formula (3), is the mapping function learned by the graph prediction model, is the prediction information corresponding to node v i , It is used to measure the difference between the prediction information of any node and the label information of the node.
总结来说,如果本发明实施例中无需基于初始图以及初始图对应的标签信息对图预测模型进行优化,则步骤S302是通过图预测模型的一次预测处理得到的。也就是说将初始图输入到图预测模型中进行处理,便可输出初始图对应的观测信息;如果本发明实施例中模型处理设备需要基于初始图以及初始图对应的标签信息对图预测模型进行优化,则步骤S302是通过图预测模型进行多次预测处理得到的,每次预测处理使用的图预测模型的模型参数是基于上一次预测处理得到的预测信息和初始图对应的标签信息优化的,在每次预测处理过程中,初始图对应的预测信息和邻居图图集合随着更新;当图预测模型达到收敛时,将最后一次预测处理的初始图对应的预测信息和邻居图集合写入观测信息中。To sum up, if the graph prediction model does not need to be optimized based on the initial graph and the label information corresponding to the initial graph in the embodiment of the present invention, step S302 is obtained through a prediction process of the graph prediction model. That is to say, the initial graph is input into the graph prediction model for processing, and the observation information corresponding to the initial graph can be output; if the model processing device in the embodiment of the present invention needs to perform the graph prediction model based on the initial graph and the label information corresponding to the initial graph optimization, then step S302 is obtained by performing multiple prediction processes through the graph prediction model, and the model parameters of the graph prediction model used in each prediction process are optimized based on the prediction information obtained in the previous prediction process and the label information corresponding to the initial graph, In each prediction process, the prediction information corresponding to the initial graph and the set of neighbor graphs are updated along with it; when the graph prediction model reaches convergence, the prediction information and the set of neighbor graphs corresponding to the initial graph of the last prediction process are written into the observation information.
步骤S303、调用图结构估计模型包括的图估计器基于标签信息和观测信息进行估计处理得到估计图,并调用图预测模型对估计图进行预测处理,得到估计图对应的预测信息。Step S303 , call the graph estimator included in the graph structure estimation model to perform estimation processing based on the label information and the observation information to obtain an estimated graph, and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph.
通过步骤S302得到初始图对应的观测信息后,我们需要解决的问题是:基于这些观测信息,与图预测模型匹配的估计图是什么呢?这些观测信息从不同的角度揭示了与图预测模型匹配的估计图,但是它们可能是不可靠或者不完整的,并且没有先验知识来确定任何一种观测信息的准确性。在这种情况下,直接回答上述问题并不容易,但是回答相反的问题则相对容易。假设已经生成了初始图对应的与图预测模型匹配的估计图,模型处理设备可以计算将该估计图映射到上述观测信息的概率。如果掌握了这一点,可以根据贝叶斯推断进行反演,并计算图结构的后验分布,从而达到获取与图预测模型匹配的估计图的目的。After obtaining the observation information corresponding to the initial graph through step S302, the question we need to solve is: based on these observation information, what is the estimated graph that matches the graph prediction model? These observations reveal estimated graphs that match the graph prediction model from different perspectives, but they may be unreliable or incomplete, and there is no prior knowledge to determine the accuracy of any kind of observation. In this case, it is not easy to answer the above question directly, but it is relatively easy to answer the opposite question. Assuming that an estimated graph corresponding to the initial graph matching the graph prediction model has been generated, the model processing device can calculate the probability of mapping the estimated graph to the above-mentioned observation information. If you master this, you can perform inversion based on Bayesian inference and calculate the posterior distribution of the graph structure, so as to achieve the purpose of obtaining an estimated graph that matches the graph prediction model.
也就是说,本发明实施例中得到初始图对应的观测信息后,图估计器首先估计出初始图对应的多个候选图;然后在确定出如果任一候选图作为图预测模型匹配的估计图,则观测信息存在的概率;然后基于每个候选图作为估计图时,观测信息存在的概率,和每个候选图对应的生成概率估计得到与图预测模型匹配的估计图。That is to say, after obtaining the observation information corresponding to the initial graph in the embodiment of the present invention, the graph estimator first estimates a plurality of candidate graphs corresponding to the initial graph; , then the probability of the existence of the observation information; then, when each candidate image is used as an estimated image, the probability of the existence of the observation information and the corresponding generation probability of each candidate image are estimated to obtain an estimated image that matches the image prediction model.
具体地,图估计器可以包括结构子模型和观测子模型,初始图对应的多个候选图是调用结构子模型执行的,任一候选图作为图预测模型匹配的估计图时,观测信息存在概率是调用观测子模型执行的;具体地,所述调用图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图,包括:Specifically, the graph estimator may include a structural sub-model and an observation sub-model. Multiple candidate graphs corresponding to the initial graph are executed by calling the structural sub-model. When any candidate graph is used as an estimated graph matched by the graph prediction model, the probability of existence of observation information is performed by calling the observation sub-model; specifically, the graph estimator included in the call graph structure estimation model performs estimation processing based on the label information and the observation information to obtain an estimation graph, including:
调用所述结构子模型基于所述标签信息和所述观测信息中所述预测信息生成N个候选图,并基于所述结构子模型的第一参数和所述N个候选图中每个候选图对应的邻接矩阵确定相应候选图对应的生成概率;调用所述观测子模型基于所述观测子模型的第二参数、所述观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率;其中,所述候选图m对应的观测信息存在概率用于表示当所述候选图m作为所述估计图时,所述观测信息存在的存在概率,m大于等于1小于等于N;基于每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵,并根据所述估计邻接矩阵生成所述估计图。Invoke the structural sub-model to generate N candidate graphs based on the label information and the prediction information in the observation information, and based on the first parameter of the structural sub-model and each candidate graph in the N candidate graphs The corresponding adjacency matrix determines the generation probability corresponding to the corresponding candidate graph; calling the observation sub-model to calculate the corresponding candidate graph based on the second parameter of the observation sub-model, the observation information, and the adjacency matrix corresponding to each candidate graph The existence probability of the corresponding observation information; wherein, the existence probability of the observation information corresponding to the candidate image m is used to indicate the existence probability of the observation information when the candidate image m is used as the estimated image, and m is greater than or equal to 1 and less than equal to N; perform graph estimation based on the generation probability corresponding to each candidate graph and the existence probability of observation information corresponding to each candidate graph to obtain an estimated adjacency matrix, and generate the estimated graph according to the estimated adjacency matrix.
在一个实施例中,图估计器可以是在构造图结构估计模型时,就训练完成的,本发明实施例中无需再对图估计器进行训练;或者,本发明实施例中为了得到与图预测模型更加匹配的估计图,也可以在基于标签信息和观测信息进行估计处理的过程中,对图估计器也进行优化处理。这部分内容在后面的实施例中详细介绍。In one embodiment, the graph estimator may be trained when the graph structure estimation model is constructed, and there is no need to train the graph estimator in this embodiment of the present invention; For an estimated graph that matches the model better, the graph estimator can also be optimized during the estimation process based on the label information and observation information. This part of the content will be described in detail in the following embodiments.
步骤S304、基于估计图对应的预测信息和标签信息对图预测模型进行优化。Step S304 , optimize the graph prediction model based on the prediction information and label information corresponding to the estimated graph.
在得到估计图之后,调用图预测模型对估计图进行预测处理,得到估计图对应的预测信息,然后基于估计图对应的预测信息和初始图对应的标签信息对图预测模型进行优化。应当理解的,估计图是基于图预测模型对初始图进行观测的观测信息估计得到的,那么相比于初始图,估计图与图预测模型的特性更加匹配,基于估计图对图预测模型进行优化,可以提高图预测模型的准确性。After the estimation graph is obtained, the graph prediction model is called to perform prediction processing on the estimation graph, and the prediction information corresponding to the estimation graph is obtained, and then the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information corresponding to the initial graph. It should be understood that the estimated graph is obtained by estimating the observation information of the initial graph based on the graph prediction model. Then, compared with the initial graph, the estimated graph matches the characteristics of the graph prediction model better, and the graph prediction model is optimized based on the estimated graph. , which can improve the accuracy of the graph prediction model.
在一个实施例中,基于估计图对应的预测信息和标签信息对图预测模型进行优化,可包括:从估计图对应的预测信息中获取目标节点对应的预测信息;确定目标节点对应的预测信息和标签信息之间的差异信息;根据该差异信息构建图预测模型对应的损失函数;按照减少该损失函数的值的方向更新图预测模型的第一权重参数和第二权重参数,以实现对图预测模型进行优化。In one embodiment, optimizing the graph prediction model based on the prediction information and label information corresponding to the estimation graph may include: obtaining the prediction information corresponding to the target node from the prediction information corresponding to the estimation graph; determining the prediction information corresponding to the target node and Difference information between label information; construct a loss function corresponding to the graph prediction model according to the difference information; update the first weight parameter and the second weight parameter of the graph prediction model according to the direction of reducing the value of the loss function, so as to realize the graph prediction model is optimized.
应当理解的,上述步骤S301-步骤S304只阐述了对图结构估计模型的第一轮训练过程,如果在步骤S304之后,未检测到结束训练事件,则获取调用图预测模型对估计图进行预测处理处理过程中,估计图对应的观测信息;调用图估计器基于标签信息和估计图对应的观测信息进行估计处理,得到新的估计图,并调用优化后的图预测模型对新的估计图进行预测处理,得到新的估计图对应的预测信息;基于新的估计图对应的预测信息和标签信息对应优化后的图预测模型进行再次优化。其中,训练结束事件可以指上述训练过程被执行了预设次,或者训练结束事件还可以指接收到训练结束的指示指令或者操作。It should be understood that the above steps S301 to S304 only describe the first round of training process for the graph structure estimation model. If after step S304, no end training event is detected, the call graph prediction model is obtained to perform prediction processing on the estimation graph. During the processing, the observation information corresponding to the estimated graph is estimated; the graph estimator is called to perform estimation processing based on the label information and the observation information corresponding to the estimated graph to obtain a new estimated graph, and the optimized graph prediction model is called to predict the new estimated graph processing to obtain the prediction information corresponding to the new estimation graph; the optimized graph prediction model is re-optimized based on the prediction information corresponding to the new estimation graph and the label information corresponding to the optimized graph. The training end event may refer to the above-mentioned training process being executed a preset number of times, or the training end event may also refer to the receipt of an instruction or operation indicating that the training ends.
本发明实施例中,提出了一种新的图处理模型,称为图结构估计模型,图结构估计模型由图预测模型和图估计器组成。在对图结构估计模型进行优化的过程中,可调用图结构估计模型中的图预测模型对初始图进行预测处理,得到所述初始图对应的观测信息,所述观测信息包括所述初始图对应的预测信息;然后调用图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;进一步的,调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息;基于所述估计图对应的预测信息和所述初始图对应的标签信息对所述图预测模型进行优化。In the embodiment of the present invention, a new graph processing model is proposed, which is called a graph structure estimation model, and the graph structure estimation model is composed of a graph prediction model and a graph estimator. In the process of optimizing the graph structure estimation model, the graph prediction model in the graph structure estimation model can be invoked to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes the corresponding initial graph. The prediction information of Prediction information; optimize the graph prediction model based on the prediction information corresponding to the estimated graph and the label information corresponding to the initial graph.
通过上述过程可见,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图预测模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的。换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen from the above process that the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also optimizes the graph prediction model based on the estimated graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is to say, the estimated graph better matches the properties of the graph prediction model than the initial graph, which is more in line with the graph structure. Estimate the properties of the model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
基于上述的模型处理方法,本发明实施例提供了另一种模型处理方法,参见图5,为本发明实施例提供的另一种模型处理方法的流程示意图。图5所示的模型处理方法可由模型处理设备执行,具体可由模型处理设备的处理器执行。所述模型处理设备可以指终端或者服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此;服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。图5所示的模型处理方法可包括如下步骤:Based on the above model processing method, an embodiment of the present invention provides another model processing method. Referring to FIG. 5 , it is a schematic flowchart of another model processing method provided by an embodiment of the present invention. The model processing method shown in FIG. 5 can be executed by a model processing device, and specifically, can be executed by a processor of the model processing device. The model processing device may refer to a terminal or a server, wherein the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this; the server may be an independent physical server, It can also be a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, and security services. , CDN, and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. The model processing method shown in FIG. 5 may include the following steps:
步骤S501、获取初始图以及初始图对应的标签信息。Step S501 , acquiring an initial image and label information corresponding to the initial image.
步骤S502、调用图结构估计模型包括的图预测模型对初始图进行预测处理,得到初始图对应的观测信息,该观测信息包括初始图对应的预测信息。Step S502 , calling the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes prediction information corresponding to the initial graph.
在一个实施例中,步骤S501和步骤S502中包括的一些可行的实施方式,可参见图3实施例中相关步骤的描述,在此不再赘述。In one embodiment, for some feasible implementation manners included in step S501 and step S502, reference may be made to the description of the relevant steps in the embodiment of FIG. 3, and details are not repeated here.
步骤S503、调用图结构估计模型包括的图估计器基于标签信息和观测信息进行估计处理,得到估计图。Step S503 , calling the graph estimator included in the graph structure estimation model to perform estimation processing based on the label information and the observation information to obtain an estimation graph.
在一个实施例中,由图3所示的实施例可知,所述调用图结构估计模型包括的图估计器基于标签信息和观测信息进行估计处理,得到估计图,包括如下步骤:In one embodiment, as can be seen from the embodiment shown in FIG. 3 , the graph estimator included in the call graph structure estimation model performs estimation processing based on label information and observation information to obtain an estimation graph, including the following steps:
①调用所述结构子模型基于所述标签信息和所述观测信息中的所述预测信息生成N个候选图,并基于所述结构子模型的第一参数和所述N个候选图中每个候选图对应的邻接矩阵确定相应候选图对应的生成概率;① Invoke the structural sub-model to generate N candidate graphs based on the label information and the prediction information in the observation information, and based on the first parameter of the structural sub-model and each of the N candidate graphs The adjacency matrix corresponding to the candidate image determines the generation probability corresponding to the corresponding candidate image;
②调用所述观测子模型基于所述观测子模型的第二参数、所述观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率;其中,所述候选图m对应的观测信息存在概率用于表示当所述候选图m作为所述估计图时,所述观测信息存在的存在概率,m大于等于1小于等于N;② Invoke the observation sub-model to calculate the existence probability of the observation information corresponding to the corresponding candidate graph based on the second parameter of the observation sub-model, the observation information and the adjacency matrix corresponding to each candidate graph; wherein, the candidate graph The existence probability of the observation information corresponding to the graph m is used to indicate the existence probability of the observation information when the candidate graph m is used as the estimated graph, and m is greater than or equal to 1 and less than or equal to N;
③基于每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵,并根据所述估计邻接矩阵生成所述估计图。③ Perform graph estimation based on the generation probability corresponding to each candidate graph and the existence probability of observation information corresponding to each candidate graph to obtain an estimated adjacency matrix, and generate the estimated graph according to the estimated adjacency matrix.
由前述描述可以知道的,本发明实施例中图预测模型是基于GCN网络构建的,考虑到GCN网络的局部平滑特性,可以采用随机块模型SBM作为结构子模型,随机块模型可以广泛用于社区检测,适用于建模具有相对较强的社区结构的图。随机块模块SBM中社区内和社区间的参数值可以约束估计图的同质性。It can be known from the foregoing description that the graph prediction model in the embodiment of the present invention is constructed based on the GCN network. Considering the local smoothness of the GCN network, the random block model SBM can be used as the structural sub-model, and the random block model can be widely used in the community. Detection, suitable for modeling graphs with relatively strong community structure. The intra-community and inter-community parameter values in the random block module SBM can constrain the homogeneity of the estimated graph.
可选的,假设N个候选图中包括第一候选图,该第一候选图可以是N个候选图中任意一个,下面以第一个候选图为例,介绍上述步骤①的具体实现方式。第一候选图对应的生成概率是基于结构子模型的第一参数和第一候选图对应的邻接矩阵确定的,第一候选图对应的生成概率可以表示为如下公式(4)所示:Optionally, it is assumed that the N candidate pictures include a first candidate picture, and the first candidate picture may be any one of the N candidate pictures. The following takes the first candidate picture as an example to introduce the specific implementation of the
其中,in,
在公式(4)中,可以表示候选图m的生成概率,在此处假设候选图m是指第一候选图,G是第一候选图对应的邻接矩阵,Z表示观测信息包括的预测值,表示初始图对应的标签信息;Ω表示结构子模型的第一参数,该第一参数假设节点间边的存在概率仅取决于其社区。例如,社区ci的节点vi和社区cj的节点vj间边的存在概率表示为按照上述公式(4)和公式(5)可以得到各个候选图对应的生成概率。In formula (4), It can represent the generation probability of the candidate map m. Here, it is assumed that the candidate map m refers to the first candidate map, G is the adjacency matrix corresponding to the first candidate map, and Z represents the predicted value included in the observation information, represents the label information corresponding to the initial graph; Ω represents the first parameter of the structural sub-model, which assumes that the existence probability of an edge between nodes depends only on its community. For example, the existence probability of an edge between node v i of community c i and node v j of community c j is expressed as The generation probability corresponding to each candidate image can be obtained according to the above formula (4) and formula (5).
得到N个候选图以及N个候选图中每个候选图对应的生成概率后,接下来要做的事情是引入一个观测子模型来描述每个候选图是如何映射到观测信息上的。下面仍然以N个候选图中的第一候选图为例,具体介绍上述步骤②的实现方式。在下面的介绍中假设边的观测是独立的、均匀分布的伯努利随机变量,其条件是在候选图中边存在或不存在。具体地,调用观测子模型基于观测子模型的第二参数、所述观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率,包括如下步骤:After obtaining the N candidate graphs and the corresponding generation probability of each candidate graph in the N candidate graphs, the next thing to do is to introduce an observation sub-model to describe how each candidate graph is mapped to the observation information. The first candidate image in the N candidate images is still taken as an example below, and the implementation manner of the foregoing
S51:获取所述观测信息包括的数据的总数量,以及根据所述第二参数确定观测概率参数;S51: Acquire the total number of data included in the observation information, and determine an observation probability parameter according to the second parameter;
由前述可知,观测信息中包括初始图对应的预测信息、邻居图集合以及初始图。其中,应当理解的,初始图包括多个节点,初始图对应的预测信息用于指示初始图中各个节点所属类别,因此实质上初始图对应的预测信息可包括用于指示每个节点所属类别的每个节点的预测值;邻居图集合包括根据初始图对应的节点特征矩阵得到的目标邻居图,以及根据图预测模型的各个卷积层对应的节点表示矩阵得到的多个邻居图。It can be seen from the foregoing that the observation information includes the prediction information corresponding to the initial graph, the set of neighbor graphs, and the initial graph. It should be understood that the initial graph includes multiple nodes, and the prediction information corresponding to the initial graph is used to indicate the category to which each node in the initial graph belongs. Therefore, in essence, the prediction information corresponding to the initial graph may include a data indicating the category to which each node belongs. The predicted value of each node; the neighbor graph set includes the target neighbor graph obtained from the node feature matrix corresponding to the initial graph, and multiple neighbor graphs obtained from the node representation matrix corresponding to each convolutional layer of the graph prediction model.
所述观测信息包括的数据的总数量就是指上述这些信息的总数量,例如初始图中包括5个节点,图预测模型包括2个卷积层,则预测信息中包括5个预测值,邻居图集合中包括1个目标邻居图,2个根据节点表示矩阵得到的邻居图,基于此观测信息包括的数据的总数量可以等于:5个预测值+3个邻居图+1个初始图=8。The total amount of data included in the observation information refers to the total amount of the above information. For example, the initial graph includes 5 nodes, the graph prediction model includes 2 convolutional layers, the prediction information includes 5 predicted values, and the neighbor graph The set includes 1 target neighbor graph and 2 neighbor graphs obtained from the node representation matrix. The total number of data included based on this observation information can be equal to: 5 predicted values + 3 neighbor graphs + 1 initial graph = 8.
在一个实施例中,根据第二参数确定出的观测概率参数可以包括四类,分别为第一类参数、第二类参数、第三类参数以及第四类参数。其中,所述第一类参数是指当节点i和节点j之间存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边存在的概率;所述第二类参数是指当节点i和节点j之间存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边不存在的概率;第三类参数是指当节点i和节点j之间不存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边不存在的概率,所述第四类参数是指当节点i和节点j之间不存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边存在的概率。In one embodiment, the observation probability parameter determined according to the second parameter may include four types, namely, the first type parameter, the second type parameter, the third type parameter, and the fourth type parameter. The first type of parameter refers to the probability that any data in the observation set indicates the existence of an edge between node i and node j when there is an edge between node i and node j; the second type of parameter The parameter refers to the probability that when there is an edge between node i and node j, any data in the observation set indicates that the edge between node i and node j does not exist; the third type of parameter refers to when node i and node j When there is no edge between j, any data in the observation set indicates the probability that the edge between node i and node j does not exist, and the fourth type of parameter refers to when there is no edge between node i and node j When there is an edge, any data in the observation set indicates the probability that an edge exists between the node i and the node j.
通俗来讲,假设观测子模型的第二参数包括α和β,通过这两个参数将观测信息中的各个数据进行参数化,例如,true-positive表示第一类参数,该参数的取值为α,即表示任一数据观测到任一候选图中一个真实存在的边存在的概率;false-positive表示第三类参数,该参数的取值为β,即表示任一数据观测到任一候选图中一个真实存在的边不存在的概率;true-negative表示第二类参数,该参数的取值为1-α,即表示任一数据观测到任一候选图中一个真实存在的边不存在的概率;false-negative表示第四类参数,该参数的取值可以为1-β,即表示任一数据观测到任一候选图中一个真实不存在边不存在概率。In layman's terms, it is assumed that the second parameter of the observation sub-model includes α and β, and each data in the observation information is parameterized by these two parameters. For example, true-positive represents the first type of parameter, and the value of this parameter is α, which means that any data observes the probability that a real edge exists in any candidate graph; false-positive means the third type of parameter, the value of this parameter is β, which means that any data observes any candidate The probability that a real edge does not exist in the graph; true-negative represents the second type parameter, and the value of this parameter is 1-α, which means that any data observes that a real edge does not exist in any candidate graph The probability of ; false-negative represents the fourth type of parameter, and the value of this parameter can be 1-β, which means that any data observes the probability that a real non-existent edge does not exist in any candidate graph.
S52:获取观测信息中指示节点i和节点j之间存在边的数据的第一数量,以及根据所述第一数量和所述总数量确定所述观测集合指示节点i和节点j之间不存在边的数据的第二数量;其中,节点i和节点j为所述第一候选图包括的任意两个节点且i小于j;S52: Acquire a first quantity of data indicating that an edge exists between node i and node j in the observation information, and determine that the observation set indicates that there is no edge between node i and node j according to the first quantity and the total quantity The second quantity of edge data; wherein, node i and node j are any two nodes included in the first candidate graph and i is less than j;
S53:根据所述观测概率参数、所述第一数量以及所述第二数量计算节点i和节点j间的边相关概率;S53: Calculate the edge correlation probability between node i and node j according to the observation probability parameter, the first quantity and the second quantity;
其中,节点i和节点j间的边相关概率是由两个概率相乘得到的,一个是如果在第一候选图中节点i和节点j之间的边真实存在,那么观测信息包括的数据中节点i和节点j之间出现第一数量个边的概率;另一个是在第一候选图中节点i和节点j之间的边真实不存在,那么观测信息包括的数据中节点i和节点j之间出现第一数量个边的概率。Among them, the edge correlation probability between node i and node j is obtained by multiplying two probabilities, one is that if the edge between node i and node j in the first candidate graph really exists, then the data included in the observation information The probability of the first number of edges appearing between node i and node j; the other is that the edge between node i and node j in the first candidate graph does not really exist, then the data included in the observation information is node i and node j. The probability that the first number of edges appear between.
举例来说,假设观测信息中包括的数据总数量为M,观测信息中指示节点i和节点j之间存在边的数据的第一数量表示为Eij,那么观测信息中指示节点i和节点j之间不存在边的数据的第二数量为M-Eij。将观测概率参数、第一数量以及第二数量输入至节点间边相关概率的运算公式中进行运算,得到节点i和节点j之间的边相关概率,基于此,根据观测概率参数、所述第一数量以及所述第二数量计算得到的节点i和节点j间的边相关概率可以表示为公式(6):For example, assuming that the total number of data included in the observation information is M, and the first quantity of data indicating the existence of an edge between node i and node j in the observation information is represented as E ij , then the observation information indicates that node i and node j The second quantity of data between which no edges exist is ME ij . The observation probability parameter, the first quantity and the second quantity are input into the calculation formula of the edge correlation probability between nodes for operation, and the edge correlation probability between node i and node j is obtained. Based on this, according to the observation probability parameter, the first The edge correlation probability between node i and node j calculated by a quantity and the second quantity can be expressed as formula (6):
在公式(6)中,G表示第一候选图对应的邻接矩阵,Gij是邻接矩阵中一个矩阵元素,该值取决于在第一候选图中节点i和节点j之间是否存在边,如果节点i和节点j之间存在边则该值为1,如果节点i和节点j之间不存在边则该值为0。在公式(6)中,表示如果在第一候选图中节点i和节点j之间的边真实存在,那么观测信息包括的数据中节点i和节点j之间出现第一数量个边的概率;表示如果在第一候选图中节点i和节点j之间的边真实不存在,那么观测信息包括的数据中节点i和节点j之间出现第一数量个边的概率。In formula (6), G represents the adjacency matrix corresponding to the first candidate graph, G ij is a matrix element in the adjacency matrix, the value depends on whether there is an edge between node i and node j in the first candidate graph, if The value is 1 if there is an edge between node i and node j, and the value is 0 if there is no edge between node i and node j. In formula (6), Indicates that if the edge between node i and node j actually exists in the first candidate graph, then the probability of the first number of edges appearing between node i and node j in the data included in the observation information; Indicates that if the edge between node i and node j does not really exist in the first candidate graph, then the probability that the first number of edges appear between node i and node j in the data included in the observation information.
S54:将所述第一候选图中每两个节点间的边相关概率进行相乘运算,得到所述第一候选图对应的观测信息存在概率。S54: Multiply the edge correlation probabilities between every two nodes in the first candidate graph to obtain the existence probability of the observation information corresponding to the first candidate graph.
按照上述方法可以计算出第一候选图中每两个节点间的边相关概率,进一步的,将第一候选图中每两个节点间的边相关概率进行相乘运算,便可得到第一候选图对应的观测信息存在概率。由前述可知,第一候选图对应的观测信息存在概率用于表示当第一候选图作为估计图时,观测信息存在的概率。According to the above method, the edge correlation probability between every two nodes in the first candidate graph can be calculated. Further, the first candidate graph can be obtained by multiplying the edge correlation probability between every two nodes in the first candidate graph. The probability of existence of observation information corresponding to the graph. It can be seen from the foregoing that the existence probability of observation information corresponding to the first candidate image is used to represent the probability of existence of observation information when the first candidate image is used as an estimated image.
可选的,将第一候选图中每两个节点间的边相关概率进行相乘运算,得到第一候选图对应的观测信息的存在概率,可以通过下述公式(7)表示:Optionally, multiply the edge correlation probability between every two nodes in the first candidate graph to obtain the existence probability of the observation information corresponding to the first candidate graph, which can be expressed by the following formula (7):
在一个实施例中,通过步骤S51-步骤S54可以得到多个候选图中每个候选图对应的观测信息的存在概率,进一步的,通过上述步骤③根据每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计处理得到估计邻接矩阵,并根据所述估计邻接矩阵生成估计图。In one embodiment, the existence probability of the observation information corresponding to each candidate graph in the multiple candidate graphs can be obtained through steps S51 to S54. The existence probability of the observation information corresponding to the candidate graph is subjected to graph estimation processing to obtain an estimated adjacency matrix, and an estimated graph is generated according to the estimated adjacency matrix.
具体实现中,假设N个候选图中除了包括第一候选图,还包括第二候选图,所述基于所述每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵,包括:In a specific implementation, it is assumed that the N candidate images include a second candidate image in addition to the first candidate image. Estimation obtains an estimated adjacency matrix, including:
获取所述第一参数的概率以及所述第二参数的概率;将所述第一参数的概率、所述第二参数的概率以及所述第一候选图对应的生成概率和所述第一候选图对应的观测信息存在概率输入至候选概率计算规则中进行运算,得到所述第一候选图作为估计图的第一候选概率;将所述第一参数的概率、所述第二参数的概率以及所述第二候选图对应的生成概率和所述第二候选图对应的观测信息存在概率输入至所述候选概率计算规则中进行运算,得到所述第二候选图作为估计图的第二候选概率;基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵。Obtain the probability of the first parameter and the probability of the second parameter; combine the probability of the first parameter, the probability of the second parameter, and the corresponding generation probability of the first candidate map with the first candidate The existence probability of the observation information corresponding to the graph is input into the candidate probability calculation rule for calculation, and the first candidate graph is obtained as the first candidate probability of the estimated graph; the probability of the first parameter, the probability of the second parameter and the The generation probability corresponding to the second candidate picture and the existence probability of the observation information corresponding to the second candidate picture are input into the candidate probability calculation rule for calculation, and the second candidate picture is obtained as the second candidate probability of the estimated picture generating an estimated adjacency matrix based on the first candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability and the adjacency matrix corresponding to the second candidate graph.
简单来说,首先要计算第一候选图作为估计图的第一候选概率,和第二候选图估计图的第二候选概率,然后基于第一候选概率和第二候选概率以及各个候选图对应的邻接矩阵生成估计邻接矩阵。To put it simply, first calculate the first candidate probability of the first candidate image as the estimated image, and the second candidate image of the second candidate image to estimate the second candidate probability of the image, and then based on the first candidate probability and the second candidate probability and the corresponding The adjacency matrix generates an estimated adjacency matrix.
其中,第一参数的概率和第二参数的概率分别是根据第一参数和第二参数确定的,第一参数的概率可以表示为P(Ω),由于第二参数包括α和β两个,那么第二参数的概率也包括两个,分别表示为P(α)和P(β)。候选概率计算规则可以表示为如下公式(8)所示:The probability of the first parameter and the probability of the second parameter are respectively determined according to the first parameter and the second parameter, and the probability of the first parameter can be expressed as P(Ω). Since the second parameter includes α and β, Then the probability of the second parameter also includes two, which are respectively expressed as P(α) and P(β). The candidate probability calculation rule can be expressed as the following formula (8):
在公式(8)中,G表示任一候选图对应的邻接矩阵,表示任一候选图对应的生成概率,表示任一候选图对应的观测信息存在概率。将第一参数的概率、第二参数的概率以及第一候选图对应的生成概率和第一候选图对应的观测信息存在概率带入到公式(8)中边可以得到第一候选图对应的第一候选概率;同理的,将第一参数的概率、第二参数的概率以及第二候选图对应的生成概率和第二候选图对应的观测信息存在概率带入到上述公式(8)中,可以得到第二候选图对应的第二候选概率。In formula (8), G represents the adjacency matrix corresponding to any candidate graph, represents the generation probability corresponding to any candidate image, Indicates the existence probability of observation information corresponding to any candidate graph. The probability of the first parameter, the probability of the second parameter, the generation probability corresponding to the first candidate image, and the existence probability of the observation information corresponding to the first candidate image are brought into formula (8) to obtain the first candidate image corresponding to the first candidate image. A candidate probability; similarly, the probability of the first parameter, the probability of the second parameter, the generation probability corresponding to the second candidate map and the existence probability of the observation information corresponding to the second candidate map are brought into the above formula (8), The second candidate probability corresponding to the second candidate map can be obtained.
可选的,通过上述公式(8)得到第一候选图作为估计图的第一候选概率,以及第二候选图作为估计图的第二候选概率后,可以将第一候选概率和第二候选概率生成一个概率分布,表示为q(G),在这个概率分布中包括第一候选概率和第二候选概率,如果N候选图中仅包括第一候选图和第二候选图,则q(G)中的两个候选概率之和等于1。Optionally, after obtaining the first candidate picture as the first candidate probability of the estimated picture and the second candidate picture as the second candidate probability of the estimated picture through the above formula (8), the first candidate probability and the second candidate probability can be calculated as Generate a probability distribution, denoted as q(G), in which the first candidate probability and the second candidate probability are included. If the N candidate map only includes the first candidate map and the second candidate map, then q(G) The sum of the two candidate probabilities in is equal to 1.
进一步的,基于第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵。Further, an estimated adjacency matrix is generated based on the first candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability, and the adjacency matrix corresponding to the second candidate graph.
具体实现中,假设第一候选图对应的邻接矩阵包括M行M列,那么第一候选图对应的邻接矩阵中包括M乘M个矩阵元素,同理的,第二候选图对应的邻接矩阵也包括M行M列,那么第二候选图对应的邻接矩阵中也包括M乘M个矩阵元素;估计邻接矩阵包括M行M列,以及M乘M个目标矩阵元素;所述基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵,包括:In the specific implementation, it is assumed that the adjacency matrix corresponding to the first candidate image includes M rows and M columns, then the adjacency matrix corresponding to the first candidate image includes M by M matrix elements. Similarly, the adjacency matrix corresponding to the second candidate image is also Including M rows and M columns, then the adjacency matrix corresponding to the second candidate image also includes M by M matrix elements; the estimated adjacency matrix includes M rows and M columns, and M by M target matrix elements; The candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability, and the adjacency matrix corresponding to the second candidate graph generate an estimated adjacency matrix, including:
获取所述第一候选图对应的邻接矩阵中第i行第j列位置处的第一矩阵元素,以及获取所述第二候选图对应的邻接矩阵中第i行第j列位置处的第二矩阵元素;将所述第一矩阵元素与所述第一候选概率进行相乘运算,得到第一运算结果,以及将所述第二矩阵元素与所述第二候选概率进行相乘运算,得到第二运算结果;将所述第一运算结果和所述第二运算结果进行相加运算,运算结果作为估计邻接矩阵中第i行第j列位置处的目标矩阵元素。Obtain the first matrix element at the position of the ith row and the jth column in the adjacency matrix corresponding to the first candidate image, and obtain the second element at the position of the ith row and the jth column in the adjacency matrix corresponding to the second candidate image. matrix element; multiply the first matrix element and the first candidate probability to obtain a first operation result, and multiply the second matrix element and the second candidate probability to obtain the first operation result. Two operation results; performing an addition operation on the first operation result and the second operation result, and the operation result is used as the target matrix element at the position of the i-th row and the j-th column in the estimated adjacency matrix.
上述计算目标矩阵元素的过程可以通过公式(9)表示:The above process of calculating the elements of the target matrix can be expressed by formula (9):
在公式(9)中,G表示N个候选图对应的邻接矩阵的集合,Gij表示任意一个邻接矩阵中位于第i行第j列的矩阵元素,Qij表示估计邻接矩阵中位于第i行第j列的目标矩阵元素。In formula (9), G represents the set of adjacency matrices corresponding to the N candidate graphs, G ij represents the matrix element located at the ith row and the jth column in any adjacency matrix, and Q ij represents the estimated adjacency matrix located at the ith row The target matrix element in the jth column.
举例来说,假设第一候选图对应的邻接矩阵如图6中600所示,第二候选图对应的邻接矩阵图6中601所示,估计邻接矩阵如图6中602所示。三个邻接矩阵都是5行5列,并且包括5乘5=25个矩阵元素,由于第一候选图和第二候选图是已知的,那么第一候选图的邻接矩阵和第二候选图的矩阵中各个矩阵元素是已知的,但是估计邻接矩阵中各个目标矩阵元素都是未知的,需要根据第一候选图的邻接矩阵和第二候选图的邻接矩阵得出。具体地,将邻接矩阵600中位于第一行第二列位置处的矩阵元素1与第一候选图对应的第一候选概率相乘,假设第一候选概率为0.6,得到相乘结果为0.6;后将邻接矩阵601中位于第一行第二列位置处的矩阵元素0与第二候选图对应的第二候选概率相乘,假设第二候选概率为0.4,得到的相乘结果为0;将0+0.6=0.6作为估计邻接矩阵中第一行第二列位置处61的目标矩阵元素。以此类推,可以得到估计邻接矩阵中各个目标矩阵元素。For example, it is assumed that the adjacency matrix corresponding to the first candidate image is shown as 600 in FIG. 6 , the adjacency matrix corresponding to the second candidate image is shown as 601 in FIG. 6 , and the estimated adjacency matrix is shown as 602 in FIG. 6 . The three adjacency matrices are all 5 rows and 5 columns, and include 5 by 5=25 matrix elements. Since the first candidate graph and the second candidate graph are known, then the adjacency matrix of the first candidate graph and the second candidate graph Each matrix element in the matrix of is known, but each target matrix element in the estimated adjacency matrix is unknown, which needs to be obtained from the adjacency matrix of the first candidate graph and the adjacency matrix of the second candidate graph. Specifically, multiplying the
通过上述各个步骤得到估计邻接矩阵后,可以根据估计邻接矩阵生成一个估计图。After the estimated adjacency matrix is obtained through the above steps, an estimated graph can be generated according to the estimated adjacency matrix.
步骤S504、调用图预测模型对估计图进行预测处理,得到估计图对应的预测信息,并基于估计图对应的预测信息和标签信息对图预测模型进行优化。Step S504 , call the graph prediction model to perform prediction processing on the estimated graph, obtain prediction information corresponding to the estimated graph, and optimize the graph prediction model based on the prediction information and label information corresponding to the estimated graph.
在一个实施例中,步骤S503中在生成估计邻接矩阵的过程中,假设结构子模型的第一参数以及观测子模型的第二参数是已经优化好的,在实际应用中,为了提高图估计器与图预测模型之间更好的匹配,在生成估计邻接矩阵过程中,还可以对第一参数和第二参数进行优化;然后根据优化后的第一参数和第二参数对已经估计出的估计邻接矩阵进行更新。In one embodiment, in the process of generating the estimated adjacency matrix in step S503, it is assumed that the first parameter of the structural sub-model and the second parameter of the observation sub-model have been optimized. In practical applications, in order to improve the graph estimator Better matching with the graph prediction model, in the process of generating the estimated adjacency matrix, the first parameter and the second parameter can also be optimized; The adjacency matrix is updated.
具体实现中,在基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵之前,所述方法还包括:根据所述第一候选概率和所述第二候选概率对所述第一参数和所述第二参数进行优化处理;采用优化处理后的第一参数和优化处理后的第二参数对分别所述第一候选概率和第二候选概率进行更新。这样一来,步骤S503中最后生成的估计邻接矩阵是基于更新后的第一候选概率和更新后的第二候选概率得到的。In a specific implementation, before generating an estimated adjacency matrix based on the first candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability, and the adjacency matrix corresponding to the second candidate graph, the method It also includes: performing optimization processing on the first parameter and the second parameter according to the first candidate probability and the second candidate probability; using the optimized first parameter and the optimized second parameter pair The first candidate probability and the second candidate probability are updated respectively. In this way, the estimated adjacency matrix finally generated in step S503 is obtained based on the updated first candidate probability and the updated second candidate probability.
在一个实施例中,所述根据所述第一候选概率和所述第二候选概率对所述第一参数和所述第二参数进行优化处理,包括:In one embodiment, the performing optimization processing on the first parameter and the second parameter according to the first candidate probability and the second candidate probability includes:
将所述第一候选概率和所述第二候选概率进行相加运算,得到所述第一参数和所述第二参数的联合后验概率表达式;利用预设不等式对所述联合后验概率表达式进行变换;基于所述第一参数对变换后的联合后验概率进行求导运算,得到所述第一参数对应的优化等式,以及基于所述第二参数对变化后的联合后验概率进行求导运算,得到所述第二参数对应的优化等式;对所述第一参数对应的优化等式求解得到优化处理后的第一参数,以及对所述第二参数对应的优化等式求解得到优化处理后的第二参数。The first candidate probability and the second candidate probability are added together to obtain a joint posterior probability expression of the first parameter and the second parameter; the joint posterior probability is calculated by using a preset inequality Transform the expression; perform a derivation operation on the transformed joint posterior probability based on the first parameter to obtain an optimization equation corresponding to the first parameter, and perform a derivation operation on the changed joint posterior based on the second parameter Perform a derivation operation on the probability to obtain the optimization equation corresponding to the second parameter; solve the optimization equation corresponding to the first parameter to obtain the optimized first parameter, and the optimization corresponding to the second parameter, etc. The second parameter after optimization is obtained by solving the formula.
其中,将第一候选概率和第二候选概率进行相加运算得到第一参数和第二参数的联合后验概率表达式可以通过如下公式(10)表示:Wherein, adding the first candidate probability and the second candidate probability to obtain the joint posterior probability expression of the first parameter and the second parameter can be expressed by the following formula (10):
在公式(10)中,G表示N个候选图中每个候选图对应的邻接矩阵组成的集合,表示N个候选图中候选图m对应的候选概率。In formula (10), G represents the set of adjacency matrices corresponding to each candidate graph in the N candidate graphs, Indicates the candidate probability corresponding to the candidate map m in the N candidate maps.
然后,采用预设不等于比如詹森不等式,对联合后验概率表达式进行变换,也就是将公式(10)进行变换处理,得到公式(11):Then, the joint posterior probability expression is transformed by using the preset not equal to, for example, Jensen's inequality, that is, transforming the formula (10) to obtain the formula (11):
进一步的,对公式(11)分别针对第一参数进行求导,得到第一参数对应的优化等式,如下述公式(12)所示:Further, formula (11) is respectively derived for the first parameter to obtain an optimization equation corresponding to the first parameter, as shown in the following formula (12):
基于第二优化参数对公式(11)进行求导,得到第二参数对应的优化等式,如下述公式(13)和公式(14)所示:Based on the second optimization parameter, formula (11) is derived, and the optimization equation corresponding to the second parameter is obtained, as shown in the following formulas (13) and (14):
对公式(12)求解,可以得到优化后的第一参数,对公式(13)和公式(14)求解可以得到优化后的第二参数。The optimized first parameter can be obtained by solving the formula (12), and the optimized second parameter can be obtained by solving the formula (13) and the formula (14).
为了计算方便,可以交换公式(12)求和的顺序,发现存在如下规律:For the convenience of calculation, the order of summation of formula (12) can be exchanged, and the following rules are found:
其中,in,
在公式(15)中,r和s表示两个社区,公式(15)的解释是社区r和社区s之间边存在的概率Ωrs是这两个社区中所有节点间存在边的平均概率。In formula (15), r and s represent two communities, and the interpretation of formula (15) is that the probability of the existence of an edge between community r and community s Ω rs is the average probability of the existence of an edge between all nodes in these two communities.
对公式(13)和公式(14)也分别进行类似的计算,得到公式(16)和公式(17):Similar calculations are also performed on formula (13) and formula (14), respectively, to obtain formula (16) and formula (17):
通过公式(15)-(17)便可得到优化处理后的第一参数和优化处理后的第二参数。进一步的,基于优化处理后的第一参数和优化处理后的第二参数对估计邻接矩阵进行更新。具体实现中,基于优化处理后的第一参数和优化处理后的第二参数对估计邻接矩阵进行更新,可以理解为将上述公式(15)-(17)带入到确定估计邻接矩阵的公式(9)中,重写确定估计邻接矩阵的公式,将得到更新后的估计邻接矩阵表示为如下公式(18):The optimized first parameter and the optimized second parameter can be obtained by formulas (15)-(17). Further, the estimated adjacency matrix is updated based on the optimized first parameter and the optimized second parameter. In the specific implementation, the estimated adjacency matrix is updated based on the optimized first parameter and the optimized second parameter, which can be understood as bringing the above formulas (15)-(17) into the formula for determining the estimated adjacency matrix ( 9), rewrite the formula for determining the estimated adjacency matrix, and express the updated estimated adjacency matrix as the following formula (18):
在一个实施例中,在上述对第一参数和第二参数进行优化的过程中,观测信息存在概率的概率分布q(G)的表达形式也随着不断更新。上述公式(11)中的不等式的右侧在等号成立时最大化,如果等号成立,则q(G)的表达式可以表示为公式(19)所示:In one embodiment, in the above-mentioned process of optimizing the first parameter and the second parameter, the expression form of the probability distribution q(G) of the existence probability of the observation information is also continuously updated. The right-hand side of the inequality in the above formula (11) is maximized when the equal sign holds, and if the equal sign holds, the expression of q(G) can be expressed as formula (19):
将公式(4)和公式(7)带入到公式(19)中,并消除分数中的常数,q(G)的的表达式可以变换为公式(20)所示:Bringing Equation (4) and Equation (7) into Equation (19), and eliminating the constant in the fraction, the expression of q(G) can be transformed into Equation (20):
接着,基于公式(18)对公式(20)进行改写,最后可得到q(G)的表达式如公式(21)所示:Then, formula (20) is rewritten based on formula (18), and finally the expression of q(G) can be obtained as shown in formula (21):
在一个实施例中,对估计邻接矩阵进行更新后,可以根据更新后的估计邻接矩阵生成估计图,进一步的,调用图预测模型对估计图进行预测处理,得到估计图对应的预测信息,并基于估计图对应的预测信息和标签信息对图预测模型进行优化。In one embodiment, after the estimated adjacency matrix is updated, an estimated graph can be generated according to the updated estimated adjacency matrix, and further, a graph prediction model is called to perform prediction processing on the estimated graph, to obtain prediction information corresponding to the estimated graph, and based on Estimate the prediction information and label information corresponding to the graph to optimize the graph prediction model.
可选的,由上述步骤求得的估计邻接矩阵中目标矩阵元素在[0,1]之间,但是完全连接的图不仅计算量大,且对于大多数应用来说意义不大,因此,我们在根据估计邻接矩阵生成估计图时,可以首先对所述估计邻接矩阵进行稀疏化处理,以从所述估计邻接矩阵中提取目标邻接矩阵;然后,根据所述目标邻接矩阵生成估计图。Optionally, the elements of the target matrix in the estimated adjacency matrix obtained by the above steps are between [0, 1], but the fully connected graph is not only computationally expensive, but also has little meaning for most applications. Therefore, we When generating the estimated graph according to the estimated adjacency matrix, the estimated adjacency matrix may be sparsed first to extract the target adjacency matrix from the estimated adjacency matrix; then, the estimated graph is generated according to the target adjacency matrix.
具体实现中,所述对所述估计邻接矩阵进行稀疏化处理,从所述估计邻接矩阵中提取目标邻接矩阵,包括:遍历所述估计邻接矩阵中每个目标矩阵元素,将所述估计邻接矩阵中小于等于阈值的矩阵元素替换为零,得到所述目标邻接矩阵。In a specific implementation, performing sparse processing on the estimated adjacency matrix and extracting a target adjacency matrix from the estimated adjacency matrix includes: traversing each target matrix element in the estimated adjacency matrix, and converting the estimated adjacency matrix The matrix elements less than or equal to the threshold are replaced with zeros to obtain the target adjacency matrix.
例如,假设阈值设置为ε,从估计邻接矩阵中提取目标邻接矩阵可以通过下述公式(22)表示:For example, assuming that the threshold is set to ε, the extraction of the target adjacency matrix from the estimated adjacency matrix can be expressed by the following formula (22):
步骤S505、若未检测到结束训练事件,则获取调用图预测模型对估计图进行预测处理过程中估计图对应的观测信息。Step S505 , if the end training event is not detected, obtain the observation information corresponding to the estimated graph in the process of calling the graph prediction model to predict the estimated graph.
步骤S506、调用图估计器基于标签信息和估计图对应的观测信息进行估计处理,得到新的估计图,并调用优化后的图预测模型对新的估计图进行预测处理,得到新的估计图对应的预测信息。Step S506 , call the graph estimator to perform estimation processing based on the label information and the observation information corresponding to the estimation graph to obtain a new estimation graph, and call the optimized graph prediction model to perform prediction processing on the new estimation graph to obtain a new estimation graph corresponding to forecast information.
步骤S507、基于新的估计图对应的预测信息和标签信息对优化后的图预测模型进行更新。Step S507: Update the optimized graph prediction model based on the prediction information and label information corresponding to the new estimated graph.
在一个实施例中步骤S505-步骤S507中包括的一些可行的实施方式可参见图3实施例中相关步骤的介绍,在此不再赘述。For some feasible implementation manners included in steps S505 to S507 in an embodiment, reference may be made to the introduction of the relevant steps in the embodiment of FIG. 3 , and details are not repeated here.
在一个实施例中,如果检测到结束训练事件,则停止对图结构估计模型进行训练。此时,如果模型处理设备获取到一个待处理图,则可以调用优化后的图结构估计模型中图预测模型对所述待处理图进行预测处理,得到所述待处理图对应的目标观测信息;然后调用所述图结构估计模型中的图估计器基于所述目标观测信息进行估计处理,得到目标估计图;调用图预存模型对所述目标估计图进行处理,得到所述目标估计图对应的预测结果,所述预测结果用于指示所述待处理图中每个节点所属类别。In one embodiment, the training of the graph structure estimation model is stopped if an end training event is detected. At this time, if the model processing device acquires a graph to be processed, the graph prediction model in the optimized graph structure estimation model can be invoked to perform prediction processing on the graph to be processed, to obtain target observation information corresponding to the graph to be processed; Then call the graph estimator in the graph structure estimation model to perform estimation processing based on the target observation information to obtain a target estimation graph; call the graph pre-stored model to process the target estimation graph to obtain the prediction corresponding to the target estimation graph As a result, the prediction result is used to indicate the category to which each node in the to-be-processed graph belongs.
通过本发明实施例训练完成的图结构估计模型可以应用于任何基于图结构的应用中,比如好友推荐以及广告推荐等等。The graph structure estimation model trained by the embodiment of the present invention can be applied to any graph structure-based application, such as friend recommendation and advertisement recommendation.
本发明实施例中,提出了一种图结构估计模型,由图预测模型和图估计器组成。在对图结构估计模型进行优化的过程中,可调用图结构估计模型中的图预测模型对初始图进行预测处理,得到所述初始图对应的观测信息,所述观测信息包括所述初始图对应的预测信息;然后调用图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;进一步的,调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息;基于所述估计图对应的预测信息和所述初始图对应的标签信息对所述图预测模型进行优化。In the embodiment of the present invention, a graph structure estimation model is proposed, which is composed of a graph prediction model and a graph estimator. In the process of optimizing the graph structure estimation model, the graph prediction model in the graph structure estimation model can be invoked to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes the corresponding initial graph. The prediction information of Prediction information; optimize the graph prediction model based on the prediction information corresponding to the estimated graph and the label information corresponding to the initial graph.
进一步的,如果未检测到结束训练事件,则获取调用图预测模型对估计图进行预测处理过程中得到的估计图对应的观测信息;调用图估计器基于标签信息和估计图对应的观测信息进行估计处理,得到新的估计图,并调用优化后的图预测模型对新的估计图进行预测处理,得到新的估计图对应的预测信息。进而,基于新的估计图对应的预测信息和标签信息对优化后的图预测模型进行更新。不断重复上述步骤,直至检测到结束训练事件,则停止训练。Further, if the end training event is not detected, obtain the observation information corresponding to the estimated graph obtained in the process of predicting the estimated graph by the call graph prediction model; the call graph estimator estimates based on the label information and the observation information corresponding to the estimated graph. process to obtain a new estimated graph, and call the optimized graph prediction model to perform prediction processing on the new estimated graph to obtain prediction information corresponding to the new estimated graph. Furthermore, the optimized graph prediction model is updated based on the prediction information and label information corresponding to the new estimated graph. Repeat the above steps continuously until the end training event is detected, then stop training.
通过上述过程可见,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图预测模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的。换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen from the above process that the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also optimizes the graph prediction model based on the estimated graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is to say, the estimated graph better matches the properties of the graph prediction model than the initial graph, which is more in line with the graph structure. Estimate the properties of the model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
为了更加形象地阐述本发明实施例中对图结构估计模型的训练过程,基于图3和图5的方法实施例,本发明实施例提供了一种图结构估计模型的训练示意图如图7所示,以及一种训练算法流程如表1所示。将表1所示的训练算法应用在图7所示的图结构估计模型中以完成对图结构估计模型的训练。In order to more vividly describe the training process of the graph structure estimation model in the embodiment of the present invention, based on the method embodiments of FIG. 3 and FIG. 5 , an embodiment of the present invention provides a training schematic diagram of a graph structure estimation model, as shown in FIG. 7 . , and a training algorithm flow as shown in Table 1. The training algorithm shown in Table 1 is applied to the graph structure estimation model shown in FIG. 7 to complete the training of the graph structure estimation model.
根据表1所示的训练算法总结本发明实施例中对图结构估计模型的训练过程,大致可以概括为:将初始图的节点特征矩阵(feature matrix)X、邻接矩阵(adjacencymatrix)A以及标签信息(labels)、各个邻居图(k in kNN)、容忍度(tolerance)λ,阈值(threshold)ε、迭代次数阈值(iterations)τ作为输入,输入到图结构估计模型中;若当前训练的轮次i小于等于迭代次数阈值τ,则首先更新图预测模型的各个卷积层的权重参数Θ,直到图预测模型收敛;然后基于收敛后的图预测模型对初始图进行预测,获取到初始图对应的观测信息;接着通过5、6、7步骤更新图估计器中结构子模型的第一参数Ω以及观测子模型的第二参数α和β,以及根据更新后的第一参数和更新后的第二参数计算得到估计邻接矩Q;进一步的,再对估计邻接矩阵Q进行稀疏化处理,得到目标邻接矩阵S(i);根据目标邻接矩阵S(i)生成估计图。重复上述训练过程,直到当前训练轮次i大于迭代次数阈值τ则结束对图结构估计模型的训练。According to the training algorithm shown in Table 1, the training process of the graph structure estimation model in the embodiment of the present invention is summarized, which can be roughly summarized as: the node feature matrix (feature matrix) X, the adjacency matrix (adjacency matrix) A and the label information of the initial graph (labels), each neighbor graph (k in kNN), tolerance (tolerance) λ, threshold (threshold) ε, iterations threshold (iterations) τ as input, input into the graph structure estimation model; if the current training round If i is less than or equal to the iteration threshold τ, first update the weight parameter Θ of each convolutional layer of the graph prediction model until the graph prediction model converges; then predict the initial graph based on the converged graph prediction model, and obtain the corresponding Observation information; then update the first parameter Ω of the structural sub-model in the graph estimator and the second parameters α and β of the observation sub-model through steps 5, 6, and 7, and according to the updated first parameter and the updated second parameter Parameter calculation obtains the estimated adjacency moment Q; Further, the estimated adjacency matrix Q is carried out sparse processing again, obtains the target adjacency matrix S (i) ; According to the target adjacency matrix S (i), generate the estimated graph. The above training process is repeated until the current training round i is greater than the iteration number threshold τ, then the training of the graph structure estimation model is ended.
表1Table 1
在图7中图结构估计模型700包括图预测模型701和图估计器702,图预测模型可以包括l个卷积层,图估计器包括结构子模型7021和观测子模型7022。本发明实施例中利用初始图对应的邻接矩阵A表示初始图,将初始图对应的节点特征矩阵S输入到图预测模型中,图预测模型包括的l个卷积层中每个卷积层对初始图进行卷积处理,每个卷积层的输入为前一个卷积层的输入,每个卷积层在进行卷积处理后得到该层的节点表示矩阵,如图7中所示,第一个卷积层进行卷积处理后得到的节点表示矩阵表示为H(1),第二个卷积层进行卷积处理得到的节点表示矩阵表示为H(2),以此类推,第l个卷积层进行卷积处理后得到的节点表示矩阵表示为H(l);由前述可知,初始图对应的节点特征矩阵对应的节点表示可以表示为H(0)。In FIG. 7 , the graph structure estimation model 700 includes a graph prediction model 701 and a graph estimator 702 , the graph prediction model may include 1 convolutional layers, and the graph estimator includes a structure sub-model 7021 and an observation sub-model 7022 . In the embodiment of the present invention, the adjacency matrix A corresponding to the initial graph is used to represent the initial graph, the node feature matrix S corresponding to the initial graph is input into the graph prediction model, and each convolutional layer pair in the l convolutional layers included in the graph prediction model is paired The initial graph is subjected to convolution processing, the input of each convolution layer is the input of the previous convolution layer, and each convolution layer obtains the node representation matrix of the layer after the convolution processing, as shown in Figure 7, the first The node representation matrix obtained after the convolution process of one convolution layer is denoted as H (1) , the node representation matrix obtained by the convolution process of the second convolution layer is denoted as H (2) , and so on, the lth The node representation matrix obtained after the convolution processing of each convolutional layer is performed is represented as H (l) ; from the foregoing, it can be seen that the node representation corresponding to the node feature matrix corresponding to the initial graph can be represented as H (0) .
进一步的,根据每个卷积层对应的节点表示矩阵生成一个邻居图以及获取该邻居图对应的邻接矩阵,如图7中所示,根据第一个卷积层对应的节点表示矩阵H(1)得到的邻居图为703,邻居图703对应的邻接矩阵表示为O(1),根据第二个卷积层对应的节点表示H(2)矩阵得到的对应的邻居图为704,邻居图704对应的邻接矩阵表示为O(2),根据第l个卷积层对应的节点表示矩阵H(l)构建的邻居图表示为705,邻居图705对应的邻接矩阵表示为O(l)。根据初始图对应的节点特征矩阵S构建的目标邻居图为706,目标邻居图706对应的邻接矩阵表示为O(0)。将邻居图集合和初始图组成对初始图进行观测得到的观测图集合。Further, a neighbor graph is generated according to the node representation matrix corresponding to each convolutional layer and the adjacency matrix corresponding to the neighbor graph is obtained, as shown in FIG. 7 , according to the node representation matrix H (1 ) The neighbor graph obtained is 703, the adjacency matrix corresponding to the neighbor graph 703 is represented as O (1) , and the corresponding neighbor graph obtained according to the node representation H (2) matrix corresponding to the second convolutional layer is 704, and the neighbor graph 704 The corresponding adjacency matrix is denoted as O (2) , the neighbor graph constructed according to the node representation matrix H (l) corresponding to the lth convolutional layer is denoted as 705, and the adjacency matrix corresponding to the neighbor graph 705 is denoted as O (l) . The target neighbor graph constructed according to the node feature matrix S corresponding to the initial graph is 706 , and the adjacency matrix corresponding to the target neighbor graph 706 is represented as O (0) . The neighbor graph set and the initial graph are composed of the observation graph set obtained by observing the initial graph.
进一步的,将初始图A、各个邻居图组成观测图集合,可选的观测图集合可以表示为:接着,模型处理设备将最后一个卷积层也就是第i个卷积层的输出进行归一化处理可以得到初始图对应的预测信息,假设初始图对应的预测信息表示为Z。将预测信息Z和观测图集合组成一条观测信息,将观测信息和初始图对应的标签信息输入到图估计器702中,图估计器702中的结构子模型7021基于标签信息生成多个候选图并得到每个候选图的生成概率,观测子模型7022确定每个候选图对应的观测信息存在概率,以及根据每个候选图对应的观测信息存在概率和每个候选图的生成概率得到估计邻接矩阵Q,最后根据估计邻接矩阵Q生成估计图,并将估计图输入至图预测模型701中,继续下一次训练。Further, the initial graph A and each neighbor graph are formed into an observation graph set, and the optional observation graph set can be expressed as: Next, the model processing device normalizes the output of the last convolutional layer, that is, the ith convolutional layer, to obtain the prediction information corresponding to the initial image, assuming that the prediction information corresponding to the initial image is represented as Z. The prediction information Z and the set of observation graphs are formed into a piece of observation information, and the label information corresponding to the observation information and the initial graph is input into the graph estimator 702, and the structure sub-model 7021 in the graph estimator 702 generates a plurality of candidate graphs based on the label information. Obtain the generation probability of each candidate image, the observation sub-model 7022 determines the existence probability of the observation information corresponding to each candidate image, and obtains the estimated adjacency matrix Q according to the existence probability of the observation information corresponding to each candidate image and the generation probability of each candidate image , and finally generate an estimated graph according to the estimated adjacency matrix Q, and input the estimated graph into the graph prediction model 701 to continue the next training.
另外,为了验证本发明实施例中图结构估计模型在实际应用中的优势,将本发明实施例所述的图结构估计模型和现有技术中基于GNN构建的图处理模型,在对图中节点分类的性能上进行对比。In addition, in order to verify the advantages of the graph structure estimation model in the embodiment of the present invention in practical applications, the graph structure estimation model described in the embodiment of the present invention and the graph processing model constructed based on GNN in the prior art are used to compare the graph node The classification performance is compared.
具体实现中,性能对比所使用的数据如表2所示,来自6个数据集:In the specific implementation, the data used for performance comparison are shown in Table 2, from 6 data sets:
表2Table 2
在表2中,Cora,Citeseer和Pubmed是基准引用网络数据集。在这些网络中,节点代表论文,边代表引文关系。节点特征是论文的词袋表示,而标签是学术领域。Chameleon和Squirrel是Wikipedia中具有特定主题的页面-页面网络。在这些数据集中,节点是网页,边表示超链接。节点特征是页面中的信息性名词,标签对应于页面的每月流量。Actor数据集是fim-director-actor-writer网络的actor子图。每个节点代表演员,边代表合作。节点特征是Wikipedia中的关键字,标签是演员类型。In Table 2, Cora, Citeseer and Pubmed are the benchmark reference network datasets. In these networks, nodes represent papers and edges represent citation relationships. Node features are bag-of-words representations of papers, while labels are academic domains. Chameleon and Squirrel are topic-specific page-page networks in Wikipedia. In these datasets, nodes are web pages and edges represent hyperlinks. Node features are informational nouns in a page, and tags correspond to monthly traffic to the page. The Actor dataset is an actor subgraph of the fim-director-actor-writer network. Each node represents an actor and an edge represents a collaboration. Node features are keywords in Wikipedia and tags are actor types.
根据上述各个数据集的同质性可以将上述6个数据集分为同配图(Cora,Citeseer和Pubmed)和异配图(Chameleon、Squirrel和Actor)。对于具有挑战性的数据集Chameleon、Squirrel和Actor,在此次试验中将监督设置为典型的半监督训练/验证/测试划分。According to the homogeneity of the above datasets, the above 6 datasets can be divided into homographies (Cora, Citeseer and Pubmed) and heterographs (Chameleon, Squirrel and Actor). For the challenging datasets Chameleon, Squirrel, and Actor, the supervision is set to a typical semi-supervised train/validation/test split in this experiment.
在测试过程中,将本发明实施例的图结构处理模型(GEN)与基于三类代表性GNN进行比较,包括三种基于频谱的图处理模型(比如SGC,GCN和ChebNet),三种基于空间的图处理模型(比如GAT,APPNP和GraphSAGE)以及三种基于图结构学习的图处理模型(比如,LDS,Pro-GNN和Geom-GCN)。本发明实施例中,为了方便描述,在对比时选取SGC、GAT和LDS与本发明实施例进行中的GEN进行比较。In the testing process, the graph structure processing model (GEN) of the embodiment of the present invention is compared with three types of representative GNNs, including three spectrum-based graph processing models (such as SGC, GCN, and ChebNet), three spatial-based Graph processing models (such as GAT, APPNP and GraphSAGE) and three graph processing models based on graph structure learning (such as LDS, Pro-GNN and Geom-GCN). In the embodiment of the present invention, for the convenience of description, SGC, GAT, and LDS are selected for comparison with the GEN that is in progress in the embodiment of the present invention.
在具体试验对比过程中,基于深度学习库PyTorch实现本发明实施例所提出的图结构估计模型。所有的试验对比均是在带有图形处理器(Graphics Processing Unit,GPU)和中央处理器(Central Processing Unit,CPU)的Linux服务器上进行的。In the specific test comparison process, the graph structure estimation model proposed in the embodiment of the present invention is implemented based on the deep learning library PyTorch. All experimental comparisons were performed on a Linux server with a Graphics Processing Unit (GPU) and a Central Processing Unit (CPU).
本发明实施例中的图结构处理模型中图预测模型是以GCN为基石的,并使用Adam优化器将其训练200轮。初始学习率为0.01,权重衰减为5e-4。将ReLU设置为图预测模型的激活函数,并应用0.5的dropout进一步防止过拟合。对于超参数的网络搜索控件,从{8,16,32,64,128,}中选择嵌入维度d,将kNN的k从3调整至15,容忍度λ在{0.1,0.01,0.001}中搜索,并在{0.1,0.2,…,0.9}中调整阈值ε。迭代次数阈值τ固定为50,然后选择验证集准确率最高的模型进行测试。In the graph structure processing model in the embodiment of the present invention, the graph prediction model is based on GCN, and the Adam optimizer is used to train it for 200 rounds. The initial learning rate is 0.01 and the weight decay is 5e-4. Set ReLU as the activation function of the graph prediction model and apply a dropout of 0.5 to further prevent overfitting. For the web search controls for hyperparameters, choose the embedding dimension d from {8, 16, 32, 64, 128,}, adjust the k of kNN from 3 to 15, the tolerance λ is searched in {0.1, 0.01, 0.001}, and Adjust the threshold ε in {0.1, 0.2, ..., 0.9}. The iteration threshold τ is fixed at 50, and then the model with the highest accuracy on the validation set is selected for testing.
在试验过程中,采用了PyTorch Geometric实现的SGC、GCN、GAT、APPNP和GraphSAGE。对于其余的基准方法ChebNet、LDS、Pro-GNN和Geom-GCN,使用其对应的源代码。在验证的数据集对所有模型进行超参搜索。为公平起见,本发明实施例提出的图结构估计模型和其他图处理模型,共同超参数的搜索空间大小是相同的,包括嵌入维度、初始学习率、权重衰减和dropout rate。During the experiment, SGC, GCN, GAT, APPNP, and GraphSAGE implemented by PyTorch Geometric were used. For the remaining benchmark methods ChebNet, LDS, Pro-GNN and Geom-GCN, their corresponding source codes are used. A hyperparameter search is performed on all models on the validation dataset. For the sake of fairness, the graph structure estimation model proposed in the embodiment of the present invention and other graph processing models have the same search space size for common hyperparameters, including embedding dimension, initial learning rate, weight decay, and dropout rate.
GEN模型和其他用于对比的图处理模型在节点分类性能上的性能对比可如下表3所示:表3中只示出在数据集上GEN、SGC、GAT以及LDS的分类性能对比,在这三个数据集上其他未示出的模型GCN、CheNet、APPNP、GraphSAGE、Pro-GNN以及Geom-GCN的分类性能也差与GEN;同理的,在除上述3个数据集外的其他数据集上,各个对比的图处理模型的分类性能也差于GEN。为了方便描述,本发明实施例不一一以表格形式列出。The performance comparison of the GEN model and other graph processing models used for comparison in terms of node classification performance is shown in Table 3 below: Table 3 only shows the classification performance comparison of GEN, SGC, GAT and LDS on the data set. The classification performance of other unshown models GCN, CheNet, APPNP, GraphSAGE, Pro-GNN and Geom-GCN on the three datasets is also worse than that of GEN; for the same reason, in other datasets except the above three datasets Above, the classification performance of each contrasted graph processing model is also worse than that of GEN. For the convenience of description, the embodiments of the present invention are not listed one by one in the form of a table.
表3table 3
根据比较结果发现,GEN模型始终优于3个数据集上的其他模型,对于另外3个数据上,虽然未在表格中示出,但是GEN模型的性能也优于其他模型。尤其是在减少标签和同质性降低的情况下,这表明本发明实施例的GEN模型可以以鲁棒方式提高节点分类性能。随着标签和同质性的降低,GNNs的性能迅速下降,而GEN模型的性能提升更加明显。这些现象符合本发明实施例的期望,即嘈杂或者稀疏的图结构会阻止GNN聚集有效信息,而本发明实施例的估计图可以缓解这一问题。GEN相对于其他模型的压倒性优势,意味着GEN能够估计合适的图结构。与其他模型相比,本发明实施例中GEN模型的性能提升表明明确限制社区结构并充分利用多方面信息有助于学习更好的图结构和更可靠的GCN参数。According to the comparison results, the GEN model consistently outperforms the other models on the 3 datasets, and for the other 3 data sets, although not shown in the table, the GEN model also outperforms the other models. Especially with reduced labels and reduced homogeneity, this shows that the GEN model of embodiments of the present invention can improve node classification performance in a robust manner. The performance of GNNs degrades rapidly as labels and homogeneity decrease, while the performance improvement of GEN models is more pronounced. These phenomena are in line with the expectations of the embodiments of the present invention, that is, noisy or sparse graph structures prevent the GNN from gathering effective information, and the estimation graph of the embodiments of the present invention can alleviate this problem. The overwhelming dominance of GEN over other models means that GEN is able to estimate suitable graph structures. Compared with other models, the performance improvement of the GEN model in the embodiment of the present invention shows that explicitly limiting the community structure and making full use of multi-faceted information helps to learn better graph structures and more reliable GCN parameters.
在表2中,试验过程中分别为每类设置20个、5个以及10个标签。图2中展示了10次随机独立试验的平均值和标准差。In Table 2, 20, 5, and 10 labels were set for each class during the experiment, respectively. The mean and standard deviation of 10 random independent trials are shown in Figure 2.
为了进一步了解GEN模型相对于其他基于GNN网络的图处理模型,在性能上的改进,本发明实施例分析了预测置信度的变化。具体来讲,对于Cora和Chameleon数据集中的每个训练集和测试集节点vi,从GCN和GEN模型的最终预测信息中选择对应于该节点的真实类别yi的值,并将其绘制为图8a所示的箱型图。In order to further understand the improvement in performance of the GEN model compared to other graph processing models based on the GNN network, the embodiment of the present invention analyzes the change of the prediction confidence. Specifically, for each training and test set node vi in the Cora and Chameleon datasets , the value corresponding to the true class yi of that node is selected from the final prediction information of the GCN and GEN models and plotted as The box plot shown in Figure 8a.
在图8a所示的箱型图中,箱框表示25-75%;中位数由加粗虚线表示,如图8a中800;实线黑色实心圆代表平均值,如图8a中801。晶须延伸到不是异常值的最小和最大数据点。为更直观地表示,对于每个箱型,用虚线灰色实心圆显示50个节点的预测置信度,如图8a中802所示。从图8a所的图中可以发现,对于Cora或更具有挑战性的Chameleon数据集,在估计图上获得的预测置信度比初始图高很多。由此推测,将多阶邻居相似度注入图结构学习可以使学得的图描绘出更多由信息的节点对,从而使分类分布更加尖峰,并为GCN提供纠正错误分类节点的能力。In the box plot shown in Figure 8a, the box represents 25-75%; the median is represented by a bold dashed line, as shown at 800 in Figure 8a; the solid black circle represents the mean, as shown at 801 in Figure 8a. The whiskers extend to the minimum and maximum data points that are not outliers. For a more intuitive representation, for each box, the prediction confidence for 50 nodes is shown with a dashed grey solid circle, as shown at 802 in Figure 8a. From the graph in Figure 8a, it can be seen that for Cora or the more challenging Chameleon dataset, the prediction confidence obtained on the estimated graph is much higher than the initial graph. It is speculated that injecting multi-order neighbor similarity into graph structure learning can make the learned graph depict more informative node pairs, thus making the classification distribution more spiky and providing GCN with the ability to correct misclassified nodes.
为了解GEN的迭代估计过程,本发明实施例在Cora和Chameleon数据集上给出了true-positive概率α和false-positive概率β的变化曲线,参见图8b所示,81表示在Cora数据集上表示true-positive概率α和82表示在Cora数据集上false-positive概率β的变化曲线,83表示在Chameleon数据集上true-positive概率α和84表示在Chameleon数据集上false-positive概率β的变化曲线。在图8b中,横轴的坐标表示EM算法中期望值和最大化值的替代步骤,虚线分隔GEN的不同轮迭代。在图8b中可以将将容忍度λ固定为0.001。从图8b中可见,在迭代过程中,true-positive概率α逐渐增加,意味着由图预测模型建立的观测信息变得越来越准确。In order to understand the iterative estimation process of GEN, the embodiment of the present invention provides the change curves of true-positive probability α and false-positive probability β on the Cora and Chameleon data sets, as shown in Figure 8b, 81 indicates on the Cora data set Represents the true-positive probability α and 82 represents the change curve of the false-positive probability β on the Cora dataset, 83 represents the true-positive probability α on the Chameleon dataset and 84 represents the change in the false-positive probability β on the Chameleon dataset curve. In Fig. 8b, the coordinates of the horizontal axis represent the alternative steps of expectation and maximization in the EM algorithm, with dashed lines separating different iterations of GEN. The tolerance λ can be fixed to 0.001 in Figure 8b. It can be seen from Figure 8b that during the iterative process, the true-positive probability α gradually increases, which means that the observation information established by the graph prediction model becomes more and more accurate.
本发明实施例中进一步地比较了GEN模型和其他图处理模型的收敛速度。参见图9a,为本发明实施例提供的GEN模型和其他图处理模型的准确率曲线图。在图9a中90A表示LDS模型在Cora数据集上的准确率曲线,90B表示LDS模型在Chameleon数据集上的准确率曲线;91A表示Pro-GNN模型在Cora数据集上的准确率曲线,91B表示Pro-GNN模型在Chameleon数据集上的准确率曲线;92A表示GEN模型在Cora数据集上的准确率曲线,92B表示GEN模型在Chameleon数据集上的准确率曲线。图9a中横坐标为迭代轮数,纵坐标为准确率。从图9a中可以看出,GEN在两个数据集上都具有更快的收敛速度和更好的验证集准确率,证明了GEN的效率和有效性。此外,对于Chameleon数据集,LDS和Pro-GNN的验证集准确率波动很大,而GEN则稳步提高了准确率,这再次证实了考虑图生成原理和多方面信息的鲁棒性。In the embodiment of the present invention, the convergence speed of the GEN model and other graph processing models is further compared. Referring to FIG. 9a, it is a graph of the accuracy rate of the GEN model and other graph processing models provided by the embodiment of the present invention. In Figure 9a, 90A represents the accuracy curve of the LDS model on the Cora dataset, 90B represents the accuracy curve of the LDS model on the Chameleon dataset; 91A represents the accuracy curve of the Pro-GNN model on the Cora dataset, 91B represents The accuracy curve of the Pro-GNN model on the Chameleon dataset; 92A represents the accuracy curve of the GEN model on the Cora dataset, and 92B represents the accuracy curve of the GEN model on the Chameleon dataset. In Figure 9a, the abscissa is the number of iteration rounds, and the ordinate is the accuracy. As can be seen in Figure 9a, GEN has faster convergence speed and better validation set accuracy on both datasets, demonstrating the efficiency and effectiveness of GEN. Moreover, for the Chameleon dataset, the validation set accuracy of LDS and Pro-GNN fluctuates greatly, while GEN steadily improves the accuracy, which again confirms the robustness considering the principle of graph generation and multi-faceted information.
同行前述的比较,已经证明了GEN模型在实际数据集上的有效性,下面介绍GEN模型的机理和估计图的性质。The aforementioned comparison of peers has proven the effectiveness of the GEN model on actual data sets. The following describes the mechanism of the GEN model and the properties of the estimation graph.
为更好地探索GEN机制,本发明实施例中使用属性随机模型SBM对估计图进行了研究,该模型已广泛用于基准图聚类方法。为了更好地可视化和分析,本发明实施例中在SBM版本中,有5个社区,每个社区有20个节点。随机初始化对称概率矩阵以生成边,在大多数情况下对角元素在相应行中最大,以确保一定程度的同质性。节点的8维特征是使用多元正态分布生成的,其中不同社区中的节点共享随机协方差矩阵,但根据其自己的社区具有不同的均值。在训练/验证/测试划分上,我们每类使用5个节点进行训练,5个节点进行验证,其余作为测试。In order to better explore the GEN mechanism, in the embodiment of the present invention, an attribute stochastic model SBM is used to study the estimated graph, and this model has been widely used in the benchmark graph clustering method. For better visualization and analysis, in the SBM version in this embodiment of the present invention, there are 5 communities, and each community has 20 nodes. A symmetric probability matrix is randomly initialized to generate edges, with diagonal elements being largest in the corresponding row in most cases, to ensure some degree of homogeneity. The 8-dimensional features of nodes are generated using a multivariate normal distribution, where nodes in different communities share a random covariance matrix, but have different means according to their own communities. On the train/validation/test split, we use 5 nodes per class for training, 5 nodes for validation, and the rest as testing.
为了直观地检查GEN带来的图结构变化,本发明实施例中使用Gephi工具在图9b中911和913可视化初始图和估计图。同时,放大上述图的局部细节,并选择一个特定节点以突出图9b中912和914中其邻域的变化。由图9b中911可见,初始图是相对比较混乱的,并且存在许多社区间的连接,通过所选节点的邻域可以更清楚的反映这一点。在这种情况下,图预测模型GCN的分类精度仅为60%。由图9b中913可见,在应用本发明实施例的GEN模型之后,估计图的社区结构是清晰的。其中,去除了许多错误边并且保留了强连接的关系,而GEN的分类精度提高到了84%。In order to visually check the graph structure changes brought about by GEN, the Gephi tool is used in the embodiment of the present invention to visualize the initial graph and the estimated graph at 911 and 913 in Fig. 9b. At the same time, zoom in on the local details of the above graph and select a particular node to highlight the changes in its neighborhood in 912 and 914 in Fig. 9b. As can be seen from 911 in Figure 9b, the initial graph is relatively chaotic, and there are many connections between communities, which can be more clearly reflected by the neighborhood of the selected node. In this case, the classification accuracy of the graph prediction model GCN is only 60%. It can be seen from 913 in Fig. 9b that after applying the GEN model of the embodiment of the present invention, the community structure of the estimation graph is clear. Among them, many erroneous edges are removed and strongly connected relationships are preserved, and the classification accuracy of GEN is improved to 84%.
为了量化估计前后的社区结构转变,可以计算初始图中社区间的概率矩阵,和估计图中社区间的概率矩阵,并将它们绘制为热图。参考图9c所示,为发明提高的一种概率矩阵热力图的示意图。在图9c中,901表示初始图中社区间的概率矩阵,902表示估计图中社区间的概率矩阵。从图9c中可以看出,901中非对角线色块也比比较深,甚至比对角线块更深,这表明初始图不能保持良好的同质性,社区间高概率连接可能会给图预测模型的优化带来困难。但是对于902,扩大了对角线元素和非对角线元素之间的差别,其中前者明显大于后者,这也就解释了本发明实施例中图处理模型GEN的分类性能提高的原因。To quantify the transition of community structure before and after estimation, the probability matrix between communities in the initial graph and the probability matrix between communities in the estimated graph can be calculated and plotted as a heatmap. Referring to Fig. 9c, it is a schematic diagram of a probability matrix heat map improved by the invention. In Fig. 9c, 901 denotes the probability matrix between communities in the initial graph, and 902 denotes the probability matrix between communities in the estimated graph. As can be seen from Figure 9c, the off-diagonal color blocks in 901 are also darker, even deeper than the diagonal blocks, which indicates that the initial graph cannot maintain good homogeneity, and high probability connections between communities may give graphs The optimization of predictive models poses difficulties. However, for 902, the difference between the diagonal elements and the off-diagonal elements is enlarged, wherein the former is significantly larger than the latter, which also explains the reason why the classification performance of the graph processing model GEN in the embodiment of the present invention is improved.
回想在图3和图5实施例中,GEN中的估计邻接矩阵Q是图结构的后验概率,其中Qij表示该边存在的置信度。为研究估计边的意义,可以展示了边置信度Qij和观测信息中指示节点i和节点j之间存在边的数据的第一数量Eij的关系。假设一个观测信息中包括的数据的总数量为3,那么Eij的取值从0到3。对于Eij的每个可能值,累积相应的节点对数量(一个节点对包括两个节点),并且在图9d中计算这些节点对的平均边置信度。在图9d中010表示每个Eij对应的节点对数量,011表示每个Eij的平均边置信度。从图9d中可见,大多数节点对均出现在Eij等于0处,这是因为图稀疏且绝大多数节点对难以相遇。从第一数量Eij与平均边置信度之间的关系,可以看出仅观测到零次或者一次的边意味着Qij低,因此单次观测可能是由于错误。但是,在Eij=1和Eij=2间有一个相对尖锐的过渡,这表明同一边的两个或多个观察会导致更大的Qij,这就反映了边存在于最佳图中的置信度较高。Recall that in the embodiments of Figures 3 and 5, the estimated adjacency matrix Q in the GEN is the posterior probability of the graph structure, where Q ij represents the confidence that the edge exists. To study the significance of estimating an edge, the relationship between the edge confidence Q ij and the first quantity of data E ij in the observation information indicating the existence of an edge between node i and node j can be shown. Assuming that the total number of data included in one observation is 3, then E ij takes values from 0 to 3. For each possible value of Eij , the corresponding number of node pairs (one node pair consists of two nodes) is accumulated, and the average edge confidence for these node pairs is calculated in Fig. 9d. In Figure 9d, 010 represents the number of node pairs corresponding to each E ij , and 011 represents the average edge confidence of each E ij . It can be seen from Figure 9d that most node pairs appear where Eij equals 0, which is because the graph is sparse and the vast majority of node pairs are difficult to meet. From the relationship between the first quantity E ij and the average edge confidence, it can be seen that an edge observed only zero or one time means that Q ij is low, so a single observation may be due to error. However, there is a relatively sharp transition between E ij =1 and E ij =2, suggesting that two or more observations of the same edge lead to a larger Qi ij , which reflects the presence of the edge in the optimal graph higher confidence.
为了显示边置信度的分布,可以将边分为两组,分别为相同社区的边和不同社区的边。下面通过图9e分别展示这些边置信度在对GEN模型训练的训练数据集上、验证数据集以及测试数据集上的归一化直方图。在图9e中,虚线白色填充矩形框用于表示相同社区的边,实线黑色填充矩阵框用于表示不同社区的边。从图9e中可观察到,相同社区的边置信度集合在最后一个区域(大于0.9),而不同社区间的边置信度更偏向第一个区域(小于0.1)。这说明GEN捕获了有用的边置信度,即相同社区间的边置信度更高。In order to show the distribution of edge confidence, the edges can be divided into two groups, the edges of the same community and the edges of different communities. The normalized histograms of these edge confidences on the training dataset, validation dataset, and test dataset for training the GEN model are shown in Figure 9e below. In Figure 9e, dashed white filled rectangular boxes are used to represent the edges of the same community, and solid black filled matrix boxes are used to represent edges of different communities. It can be observed from Figure 9e that the edge confidences of the same community are gathered in the last region (greater than 0.9), while the edge confidences between different communities are more biased towards the first region (less than 0.1). This shows that GEN captures useful edge confidence, i.e. the edge confidence between the same communities is higher.
在上述描述中均是指GEN模型应用在静态图中,在未来可以将GEN模型应用到动态图中。从直观的角度来看,可以在不同的时间片上构建观测信息,因此GEN可以基于一系列历史交互来推断图结果。In the above description, it is meant that the GEN model is applied to the static graph, and the GEN model can be applied to the dynamic graph in the future. Intuitively, observations can be constructed on different time slices, so GEN can infer graph results based on a series of historical interactions.
基于上述图结构估计模型的训练方法实施例,本发明实施例提供了一种图结构估计模型的训练装置。参见图10,为本发明实施例提供的一种图结构估计模型的训练装置的结构示意图。图10所述的训练装置可运行如下单元:Based on the above-mentioned embodiment of the training method of the graph structure estimation model, the embodiment of the present invention provides a training apparatus for the graph structure estimation model. Referring to FIG. 10 , it is a schematic structural diagram of a training apparatus for a graph structure estimation model provided by an embodiment of the present invention. The training device described in Figure 10 may operate the following units:
获取单元1001,用于获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;The obtaining
处理单元1002,用于调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;A
所述处理单元1002,还用于调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;The
所述处理单元1002,还用于基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。The
在一个实施例中,所述获取单元1001还用于:若未检测到结束训练事件,则获取调用所述图预测模型对所述估计图进行预测处理过程中得到的所述估计图对应的观测信息;In one embodiment, the obtaining
所述处理单元1002,还用于调用所述图估计器基于所述标签信息和所述估计图对应的观测信息进行估计处理得到新的估计图,并调用优化后的图预测模型对所述新的估计图进行预测处理,得到所述新的估计图对应的预测信息,所述新的估计图对应的预测信息用于指示所述新的估计图中各个节点所属类别;The
基于所述新的估计图对应的预测信息和所述标签信息对所述优化后的图预测模型进行更新。The optimized graph prediction model is updated based on the prediction information corresponding to the new estimated graph and the label information.
在一个实施例中,所述观测信息包括所述初始图对应的预测信息和初始图对应的观测图集合,所述初始图对应的预测信息用于指示所述初始图中各个节点所属类别,所述观测图集合中包括所述初始图和所述初始图对应的邻居图集合;所述图预测模型包括第一个卷积层和第二个卷积层,所述处理单元1002在调用所述图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息时,执行如下步骤:In one embodiment, the observation information includes prediction information corresponding to the initial graph and a set of observation graphs corresponding to the initial graph, where the prediction information corresponding to the initial graph is used to indicate the category to which each node in the initial graph belongs, and the The observation graph set includes the initial graph and the neighbor graph set corresponding to the initial graph; the graph prediction model includes a first convolution layer and a second convolution layer, and the
获取所述初始图的节点特征矩阵,并将所述节点特征矩阵输入至所述第一个卷积层以基于所述第一个卷积层对应的第一权重参数进行卷积运算,得到第一个卷积层对应的节点表示矩阵;将所述第一个卷积层对应的节点表示矩阵输入至所述第二个卷积层以基于所述第二个卷积层对应的第二权重参数进行卷积运算,得到第二个卷积层对应的节点表示矩阵;Obtain the node feature matrix of the initial graph, and input the node feature matrix to the first convolutional layer to perform a convolution operation based on the first weight parameter corresponding to the first convolutional layer to obtain the first convolutional layer. A node representation matrix corresponding to one convolutional layer; inputting the node representation matrix corresponding to the first convolutional layer to the second convolutional layer to be based on the second weight corresponding to the second convolutional layer The parameters are subjected to convolution operation to obtain the node representation matrix corresponding to the second convolution layer;
对所述第二个卷积层对应的节点表示矩阵进行归一化处理得到所述初始图对应的预测信息;基于所述第一个卷积层对应的节点表示矩阵构造第一邻居图,以及基于所述第二个卷积层对应的节点表示矩阵构造第二邻居图,并基于所述初始图的节点特征矩阵构建目标邻居图;将所述第一邻居图、所述第二邻居图以及所述目标邻居图组成所述邻居图集合。normalizing the node representation matrix corresponding to the second convolutional layer to obtain prediction information corresponding to the initial graph; constructing a first neighbor graph based on the node representation matrix corresponding to the first convolutional layer, and Construct a second neighbor graph based on the node representation matrix corresponding to the second convolutional layer, and construct a target neighbor graph based on the node feature matrix of the initial graph; combine the first neighbor graph, the second neighbor graph and the The target neighbor graph forms the neighbor graph set.
在一个实施例中,图估计器包括结构子模型和观测子模型,所述处理单元1002在调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图时,执行如下步骤:In one embodiment, the graph estimator includes a structure sub-model and an observation sub-model, and the
调用所述结构子模型基于所述标签信息和所述初始图对应的观测信息中所述初始图对应的预测信息生成N个候选图,N为大于等于1的整数;并基于所述结构子模型的第一参数和所述N个候选图中每个候选图对应的邻接矩阵确定相应候选图对应的生成概率;Invoke the structural sub-model to generate N candidate graphs based on the label information and the prediction information corresponding to the initial graph in the observation information corresponding to the initial graph, where N is an integer greater than or equal to 1; and based on the structural sub-model The first parameter of and the adjacency matrix corresponding to each candidate image in the N candidate images determine the generation probability corresponding to the corresponding candidate image;
调用所述观测子模型基于所述观测子模型的第二参数、所述初始图对应的观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率;其中,所述候选图m对应的观测信息存在概率用于表示当所述候选图m作为所述估计图时,所述观测信息存在的概率,m大于等于1且小于等于N;基于每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵,并根据所述估计邻接矩阵生成所述估计图。Calling the observation sub-model to calculate the existence probability of the observation information corresponding to the corresponding candidate graph based on the second parameter of the observation sub-model, the observation information corresponding to the initial graph, and the adjacency matrix corresponding to each candidate graph; wherein, The existence probability of the observation information corresponding to the candidate map m is used to indicate that when the candidate map m is used as the estimated map, the probability of the existence of the observation information, m is greater than or equal to 1 and less than or equal to N; The estimated adjacency matrix is obtained by performing graph estimation on the generation probability of , and the existence probability of observation information corresponding to each candidate graph, and the estimated graph is generated according to the estimated adjacency matrix.
在一个实施例中,所述N个候选图包括第一候选图,所述处理单元1002在调用所述观测子模型基于所述观测子模型的第二参数、所述初始图对应的观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率时,执行如下步骤:In one embodiment, the N candidate graphs include a first candidate graph, and the
获取所述观测信息包括的数据的总数量,以及根据所述第二参数确定观测概率参数;获取所述观测信息中指示节点i和节点j之间存在边的数据的第一数量,以及根据所述第一数量和所述总数量确定所述观测信息中指示节点i和节点j之间不存在边的数据的第二数量;其中,节点i和节点j为所述第一候选图包括的任意两个节点且i小于j;根据所述观测概率参数、所述第一数量以及所述第二数量计算所述节点i和节点j间的边相关概率;将所述第一候选图中每两个节点间的边相关概率进行相乘运算,得到所述第一候选图对应的观测信息存在概率。Acquiring the total number of data included in the observation information, and determining an observation probability parameter according to the second parameter; acquiring the first quantity of data indicating the existence of an edge between node i and node j in the observation information, and determining the observation probability parameter according to the second parameter; The first quantity and the total quantity determine the second quantity of data indicating that there is no edge between node i and node j in the observation information; wherein, node i and node j are any arbitrary data included in the first candidate graph. Two nodes and i is less than j; calculate the edge correlation probability between the node i and node j according to the observation probability parameter, the first number and the second number; The edge correlation probabilities between the nodes are multiplied to obtain the existence probability of the observation information corresponding to the first candidate graph.
在一个实施例中,所述观测概率参数包括第一类参数、第二类参数、第三类参数以及第四类参数;其中,所述第一类参数是指当节点i和节点j之间存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边存在的概率;所述第二类参数是指当节点i和节点j之间存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边不存在的概率;所述第三类参数是指当节点i和节点j之间不存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边不存在的概率,所述第四类参数是指当节点i和节点j之间不存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边存在的概率。In one embodiment, the observation probability parameter includes a first-type parameter, a second-type parameter, a third-type parameter, and a fourth-type parameter; wherein, the first-type parameter refers to the time between node i and node j When there is an edge, any data in the observation set indicates the probability of the existence of an edge between the node i and node j; the second type of parameter refers to the observation when an edge exists between node i and node j Any data in the set indicates the probability that the edge between node i and node j does not exist; the third type of parameter refers to when there is no edge between node i and node j, any data in the observation set Indicates the probability that the edge between the node i and the node j does not exist, and the fourth parameter refers to when there is no edge between the node i and the node j, any data in the observation set indicates that the node i and the probability that an edge exists between node j.
在一个实施例中,所述N个候选图中包括第一候选图和第二候选图,所述处理单元1002在基于每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵时,执行如下步骤:In one embodiment, the N candidate pictures include a first candidate picture and a second candidate picture, and the
获取所述第一参数的概率以及所述第二参数的概率;将所述第一参数的概率、所述第二参数的概率以及所述第一候选图对应的生成概率和所述第一候选图对应的观测信息存在概率输入至候选概率计算规则中进行运算,得到所述第一候选图作为估计图的第一候选概率;Obtain the probability of the first parameter and the probability of the second parameter; combine the probability of the first parameter, the probability of the second parameter, and the corresponding generation probability of the first candidate map with the first candidate The existence probability of the observation information corresponding to the graph is input into the candidate probability calculation rule for calculation, and the first candidate graph is obtained as the first candidate probability of the estimated graph;
将所述第一参数的概率、所述第二参数的概率以及所述第二候选图对应的生成概率和所述第二候选图对应的观测信息存在概率输入至所述候选概率计算规则中进行运算,得到所述第二候选图作为估计图的第二候选概率;基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵。The probability of the first parameter, the probability of the second parameter, the generation probability corresponding to the second candidate map, and the existence probability of the observation information corresponding to the second candidate map are input into the candidate probability calculation rule for operation to obtain the second candidate graph as the second candidate probability of the estimated graph; based on the first candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability and the second candidate graph The corresponding adjacency matrix generates an estimated adjacency matrix.
在一个实施例中,任一候选图对应的邻接矩阵包括M行M列,所述任一候选图对应的邻接矩阵包括M乘M个矩阵元素,所述估计邻接矩阵包括M行M列,所述估计邻接矩阵包括M乘M个目标矩阵元素;所述处理单元1002在基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵时。执行如下步骤:In one embodiment, the adjacency matrix corresponding to any candidate graph includes M rows and M columns, the adjacency matrix corresponding to any candidate graph includes M by M matrix elements, and the estimated adjacency matrix includes M rows and M columns, so The estimated adjacency matrix includes M by M target matrix elements; the
获取所述第一候选图对应的邻接矩阵中第i行第j列位置处的第一矩阵元素,以及获取所述第二候选图对应的邻接矩阵中第i行第j列位置处的第二矩阵元素;将所述第一矩阵元素与所述第一候选概率进行相乘运算,得到第一运算结果,以及将所述第二矩阵元素与所述第二候选概率进行相乘运算,得到第二运算结果;将所述第一运算结果和所述第二运算结果进行相加运算,运算结果作为估计邻接矩阵中第i行第j列位置处的目标矩阵元素。Obtain the first matrix element at the position of the ith row and the jth column in the adjacency matrix corresponding to the first candidate image, and obtain the second element at the position of the ith row and the jth column in the adjacency matrix corresponding to the second candidate image. matrix element; multiply the first matrix element and the first candidate probability to obtain a first operation result, and multiply the second matrix element and the second candidate probability to obtain the first operation result. Two operation results; performing an addition operation on the first operation result and the second operation result, and the operation result is used as the target matrix element at the position of the i-th row and the j-th column in the estimated adjacency matrix.
在一个实施例中,所述处理单元1002还用于:In one embodiment, the
根据所述第一候选概率和所述第二候选概率对所述第一参数和所述第二参数进行优化处理;基于优化处理后的第一参数和优化处理后的第二参数对估计邻接矩阵进行更新处理。The first parameter and the second parameter are optimized according to the first candidate probability and the second candidate probability; the adjacency matrix is estimated based on the optimized first parameter and the optimized second parameter pair Update processing is performed.
在一个实施例中,所述根据所述第一候选概率和所述第二候选概率对所述第一参数和所述第二参数进行优化处理时,执行如下步骤:In an embodiment, when the optimization process is performed on the first parameter and the second parameter according to the first candidate probability and the second candidate probability, the following steps are performed:
将所述第一候选概率和所述第二候选概率进行相加运算,得到所述第一参数和所述第二参数的联合后验概率表达式;利用预设不等式对所述联合后验概率表达式进行变换;The first candidate probability and the second candidate probability are added together to obtain a joint posterior probability expression of the first parameter and the second parameter; the joint posterior probability is calculated by using a preset inequality expression to transform;
基于所述第一参数对变换后的联合后验概率进行求导运算,得到所述第一参数对应的优化等式,以及基于所述第二参数对变化后的联合后验概率进行求导运算,得到所述第二参数对应的优化等式;对所述第一参数对应的优化等式求解得到优化处理后的第一参数,以及对所述第二参数对应的优化等式求解得到优化处理后的第二参数。Perform a derivation operation on the transformed joint posterior probability based on the first parameter to obtain an optimization equation corresponding to the first parameter, and perform a derivation operation on the changed joint posterior probability based on the second parameter , obtain the optimization equation corresponding to the second parameter; solve the optimization equation corresponding to the first parameter to obtain the optimized first parameter, and solve the optimization equation corresponding to the second parameter to obtain the optimized process after the second parameter.
在一个实施例中,所述处理单元1002在根据所述估计邻接矩阵生成所述估计图时,执行如下步骤:In one embodiment, when the
对所述估计邻接矩阵进行稀疏化处理,从所述估计邻接矩阵中提取目标邻接矩阵;根据所述目标邻接矩阵生成所述估计图。Perform sparse processing on the estimated adjacency matrix, and extract a target adjacency matrix from the estimated adjacency matrix; and generate the estimated graph according to the target adjacency matrix.
在一个实施例中,所述处理单元1002在对所述估计邻接矩阵进行稀疏化处理,从所述估计邻接矩阵中提取目标邻接矩阵时,执行如下步骤:遍历所述估计邻接矩阵中每个目标矩阵元素,将所述估计邻接矩阵中小于等于阈值的矩阵元素替换为零,得到所述目标邻接矩阵。In one embodiment, when performing sparse processing on the estimated adjacency matrix and extracting a target adjacency matrix from the estimated adjacency matrix, the
在一个实施例中,所述初始图对应的预测信息包括所述初始图的多个节点中每个节点对应的预测值,任一节点对应的预测值用于指示所述任一节点所属类别,所述标签信息包括用于指示目标节点所属类别的目标值;所述处理单元1002还用于:In one embodiment, the prediction information corresponding to the initial graph includes a predicted value corresponding to each node in the multiple nodes of the initial graph, and the predicted value corresponding to any node is used to indicate the category to which any node belongs, The label information includes a target value used to indicate the category to which the target node belongs; the
从所述初始图对应的预测信息中获取所述目标节点对应的预测值,并确定所述目标节点对应的预测值与所述标签信息包括的所述目标值之间的差异信息;根据所述差异信息构建所述图预测模型对应的损失函数;按照减少所述损失函数的值的方向更新所述第一权重参数和所述第二权重参数;基于更新的第一权重参数和更新的第二权重参数分别更新所述初始图对应的预测信息和所述邻居图集合。Obtain the predicted value corresponding to the target node from the prediction information corresponding to the initial graph, and determine the difference information between the predicted value corresponding to the target node and the target value included in the label information; according to the constructing a loss function corresponding to the graph prediction model based on the difference information; updating the first weight parameter and the second weight parameter in the direction of reducing the value of the loss function; based on the updated first weight parameter and the updated second weight parameter The weight parameter updates the prediction information corresponding to the initial graph and the neighbor graph set respectively.
在一个实施例中,所述获取单元1001还用于:获取待处理图;所述处理单元1002,还用于:调用图结构估计模型中优化后的所述图预测模型对所述待处理图进行预测处理,得到所述待处理图对应的目标观测信息,所述目标观测信息包括所述待处理图对应的目标预测信息;调用所述图估计器基于所述目标观测信息进行估计处理得到目标估计图;调用所述图预测模型对所述目标估计图进行处理,得到所述目标估计图对应的预测结果,所述预测结果用于指示所述待处理图中每个节点所属类别。In one embodiment, the obtaining
根据本发明的一个实施例,图3和图5所示的图结构估计模型的训练方法所涉及各个步骤可以是由图10所示的图结构估计模型的训练装置中的各个单元来执行的。例如,图3所述的步骤S301可由图10所示的图结构估计模型的训练装置中的获取收单元1001来执行,步骤S302-步骤S304可由图10所示的图结构估计模型的训练装置中的处理单元1002来执行;再如,图5所示的图结构估计模型的训练方法中步骤S501可由图10所示的图结构估计模型的训练装置中获取单元1001来执行,步骤S502-步骤S507可由图10所示的图结构估计模型的训练装置中的处理单元1002来执行。According to an embodiment of the present invention, each step involved in the training method of the graph structure estimation model shown in FIG. 3 and FIG. 5 may be performed by each unit in the graph structure estimation model training apparatus shown in FIG. 10 . For example, step S301 shown in FIG. 3 can be performed by the acquisition and receiving
根据本发明的另一个实施例,图10所示的图结构估计模型的训练装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本发明的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本发明的其它实施例中,基于图结构估计模型的训练装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。According to another embodiment of the present invention, each unit in the training apparatus of the graph structure estimation model shown in FIG. 10 may be respectively or all combined into one or several other units to form, or some unit(s) among them. It can also be divided into multiple units with smaller functions, which can realize the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit may also be implemented by multiple units, or the functions of multiple units may be implemented by one unit. In other embodiments of the present invention, the training apparatus based on the graph structure estimation model may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by multiple units in cooperation.
根据本发明的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图3和图5所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图10中所示的图结构估计模型的训练装置,以及来实现本发明实施例的图结构估计模型的训练方法。所述计算机程序可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于上述计算设备中,并在其中运行。According to another embodiment of the present invention, a general-purpose computing device, such as a computer, may be implemented using processing elements such as a central processing unit (CPU), random access storage medium (RAM), read-only storage medium (ROM), etc., and storage elements. Running a computer program (including program code) capable of performing the steps involved in the corresponding methods as shown in Figures 3 and 5, to construct a training device for a graph structure estimation model as shown in Figure 10, and to implement the present invention The training method of the graph structure estimation model of the embodiment. The computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above-mentioned computing device through the computer-readable storage medium, and executed therein.
本发明实施例中,提出了一种图结构估计模型,由图预测模型和图估计器组成。在对图结构估计模型进行优化的过程中,可调用图结构估计模型中的图预测模型对初始图进行预测处理,得到所述初始图对应的观测信息,所述观测信息包括所述初始图对应的预测信息;然后调用图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;进一步的,调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息;基于所述估计图对应的预测信息和所述初始图对应的标签信息对所述图预测模型进行优化。In the embodiment of the present invention, a graph structure estimation model is proposed, which is composed of a graph prediction model and a graph estimator. In the process of optimizing the graph structure estimation model, the graph prediction model in the graph structure estimation model can be invoked to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes the corresponding initial graph. The prediction information of Prediction information; optimize the graph prediction model based on the prediction information corresponding to the estimated graph and the label information corresponding to the initial graph.
通过上述过程可见,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图预测模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的。换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen from the above process that the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also optimizes the graph prediction model based on the estimated graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is to say, the estimated graph better matches the properties of the graph prediction model than the initial graph, which is more in line with the graph structure. Estimate the properties of the model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
基于上述的方法以及装置实施例,本发明实施例还提供了一种图结构估计模型的训练设备,参见图11,为本发明实施例提供的一种图结构估计模型的训练设备的结构示意图。图11所示的训练设备可至少包括处理器1101、输入接口1102、输出接口1103以及计算机存储介质1104。其中,处理器1101、输入接口1102、输出接口1103以及计算机存储介质1104可通过总线或其他方式连接。Based on the above method and apparatus embodiment, the embodiment of the present invention further provides a training device for a graph structure estimation model. Referring to FIG. 11 , it is a schematic structural diagram of a training device for a graph structure estimation model provided by an embodiment of the present invention. The training device shown in FIG. 11 may include at least a
计算机存储介质1104可以存储在图结构估计模型的训练设备的存储器中,所述计算机存储介质901用于存储计算机程序,所述计算机程序包括计算机程序,所述处理器901用于执行所述计算机存储介质1104存储的计算机程序。处理器1101(或称CPU(CentralProcessing Unit,中央处理器))是图结构估计模型的训练设备的计算核心以及控制核心,其适于实现计算机程序,具体适于加载并执行:The
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. Any one or more of the nodes; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call the graph estimator included in the graph structure estimation model Perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph, and the prediction corresponding to the estimated graph The information is used to indicate the category to which each node in the estimation graph belongs; the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information.
本发明实施例中,提出了一种图结构估计模型,由图预测模型和图估计器组成。在对图结构估计模型进行优化的过程中,可调用图结构估计模型中的图预测模型对初始图进行预测处理,得到所述初始图对应的观测信息,所述观测信息包括所述初始图对应的预测信息;然后调用图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;进一步的,调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息;基于所述估计图对应的预测信息和所述初始图对应的标签信息对所述图预测模型进行优化。In the embodiment of the present invention, a graph structure estimation model is proposed, which is composed of a graph prediction model and a graph estimator. In the process of optimizing the graph structure estimation model, the graph prediction model in the graph structure estimation model can be invoked to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes the corresponding initial graph. The prediction information of Prediction information; optimize the graph prediction model based on the prediction information corresponding to the estimated graph and the label information corresponding to the initial graph.
通过上述过程可见,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图预测模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的。换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen from the above process that the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also optimizes the graph prediction model based on the estimated graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is to say, the estimated graph better matches the properties of the graph prediction model than the initial graph, which is more in line with the graph structure. Estimate the properties of the model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
本发明实施例中还提供了一种计算机存储介质(Memory),所述计算机存储介质是图结构估计模型的训练设备中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机存储介质既可以包括图结构估计模型的训练设备的内置存储介质,当然也可以包括图结构估计模型的训练设备所支持的扩展存储介质。计算机存储介质提供存储空间,该存储空间存储了图结构估计模型的训练设备的操作系统。并且,在该存储空间中还存放了适于被处理器901加载并执行的计算机程序;或者适于被处理器1101加载并执行的计算机程序,这些计算机程序可以是一个以上的计算机程序(包括程序代码)。需要说明的是,此处的计算机存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatilememory),例如至少一个磁盘存储器;可选的还可以是至少一个位于远离前述处理器的计算机存储介质。An embodiment of the present invention also provides a computer storage medium (Memory), where the computer storage medium is a memory device in a training device for a graph structure estimation model, and is used to store programs and data. It can be understood that the computer storage medium here may include both the built-in storage medium of the training device of the graph structure estimation model, and of course the extended storage medium supported by the training device of the graph structure estimation model. The computer storage medium provides storage space in which the operating system of the training device of the graph structure estimation model is stored. In addition, a computer program suitable for being loaded and executed by the
在一个实施例中,所述计算机存储介质可由处理器1101加载并执行计算机存储介质中存放计算机程序,以实现上述有关图3所示的图结构估计模型的训练方法的相应步骤。具体实现中,计算机存储介质中的计算机程序由处理器1101加载并执行如下步骤:In one embodiment, the computer storage medium can be loaded by the
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. Any one or more of the nodes; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call the graph estimator included in the graph structure estimation model Perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph, and the prediction corresponding to the estimated graph The information is used to indicate the category to which each node in the estimation graph belongs; the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information.
在一个实施例中,所述处理器1101还用于执行:若未检测到结束训练事件,则获取调用所述图预测模型对所述估计图进行预测处理过程中得到的所述估计图对应的观测信息;调用所述图估计器基于所述标签信息和所述估计图对应的观测信息进行估计处理得到新的估计图,并调用优化后的图预测模型对所述新的估计图进行预测处理,得到所述新的估计图对应的预测信息,所述新的估计图对应的预测信息用于指示所述新的估计图中各个节点所属类别;基于所述新的估计图对应的预测信息和所述标签信息对所述优化后的图预测模型进行更新。In one embodiment, the
在一个实施例中,,所述观测信息包括所述初始图对应的预测信息和所述初始图对应的观测图集合,所述初始图对应的预测信息用于指示所述初始图中各个节点所属类别,所述观测图集合中包括所述初始图和所述初始图对应的邻居图集合;所述图预测模型包括第一个卷积层和第二个卷积层;所述处理器1101在调用所述图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息时,执行如下步骤:In one embodiment, the observation information includes prediction information corresponding to the initial graph and an observation graph set corresponding to the initial graph, and the prediction information corresponding to the initial graph is used to indicate that each node in the initial graph belongs to category, the observation graph set includes the initial graph and the neighbor graph set corresponding to the initial graph; the graph prediction model includes a first convolutional layer and a second convolutional layer; the
获取所述初始图的节点特征矩阵,并将所述节点特征矩阵输入至所述第一个卷积层以基于所述第一个卷积层对应的第一权重参数进行卷积运算,得到第一个卷积层对应的节点表示矩阵;Obtain the node feature matrix of the initial graph, and input the node feature matrix to the first convolutional layer to perform a convolution operation based on the first weight parameter corresponding to the first convolutional layer to obtain the first convolutional layer. A node representation matrix corresponding to a convolutional layer;
将所述第一个卷积层对应的节点表示矩阵输入至所述第二个卷积层以基于所述第二个卷积层对应的第二权重参数进行卷积运算,得到第二个卷积层对应的节点表示矩阵;对所述第二个卷积层对应的节点表示矩阵进行归一化处理得到所述初始图对应的预测信息;基于所述第一个卷积层对应的节点表示矩阵构造第一邻居图,以及基于所述第二个卷积层对应的节点表示矩阵构造第二邻居图,并基于所述初始图的节点特征矩阵构建目标邻居图;将所述第一邻居图、所述第二邻居图以及所述目标邻居图组成所述邻居图集合。Inputting the node representation matrix corresponding to the first convolutional layer to the second convolutional layer to perform a convolution operation based on the second weight parameter corresponding to the second convolutional layer to obtain a second volume The node representation matrix corresponding to the product layer; the node representation matrix corresponding to the second convolution layer is normalized to obtain the prediction information corresponding to the initial graph; based on the node representation corresponding to the first convolution layer The matrix constructs a first neighbor graph, and a second neighbor graph is constructed based on the node representation matrix corresponding to the second convolution layer, and a target neighbor graph is constructed based on the node feature matrix of the initial graph; the first neighbor graph is , the second neighbor graph and the target neighbor graph form the neighbor graph set.
在一个实施例中,所述图估计器包括结构子模型和观测子模型;所述处理器1101在调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图时,执行如下步骤:In one embodiment, the graph estimator includes a structure sub-model and an observation sub-model; the
调用所述结构子模型基于所述标签信息和所述初始图对应的观测信息中所述初始图对应的预测信息生成N个候选图,N为大于等于1的整数;并基于所述结构子模型的第一参数和所述N个候选图中每个候选图对应的邻接矩阵确定相应候选图对应的生成概率;Invoke the structural sub-model to generate N candidate graphs based on the label information and the prediction information corresponding to the initial graph in the observation information corresponding to the initial graph, where N is an integer greater than or equal to 1; and based on the structural sub-model The first parameter of and the adjacency matrix corresponding to each candidate image in the N candidate images determine the generation probability corresponding to the corresponding candidate image;
调用所述观测子模型基于所述观测子模型的第二参数、所述初始图对应的观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率;其中,所述候选图m对应的观测信息存在概率用于表示当所述候选图m作为所述估计图时,所述观测信息存在的概率,m大于等于1且小于等于N;基于每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵,并根据所述估计邻接矩阵生成所述估计图。Calling the observation sub-model to calculate the existence probability of the observation information corresponding to the corresponding candidate graph based on the second parameter of the observation sub-model, the observation information corresponding to the initial graph, and the adjacency matrix corresponding to each candidate graph; wherein, The existence probability of the observation information corresponding to the candidate map m is used to indicate that when the candidate map m is used as the estimated map, the probability of the existence of the observation information, m is greater than or equal to 1 and less than or equal to N; The estimated adjacency matrix is obtained by performing graph estimation on the generation probability of , and the existence probability of observation information corresponding to each candidate graph, and the estimated graph is generated according to the estimated adjacency matrix.
在一个实施例中,所述N个候选图包括第一候选图,所述处理器1101在调用所述观测子模型基于所述观测子模型的第二参数、所述初始图对应的观测信息以及所述每个候选图对应的邻接矩阵,计算相应候选图对应的观测信息存在概率时,执行如下步骤:In one embodiment, the N candidate graphs include a first candidate graph, and the
获取所述观测信息包括的数据的总数量,以及根据所述第二参数确定观测概率参数;获取所述观测信息中指示节点i和节点j之间存在边的数据的第一数量,以及根据所述第一数量和所述总数量确定所述观测信息中指示节点i和节点j之间不存在边的数据的第二数量;其中,节点i和节点j为所述第一候选图包括的任意两个节点且i小于j;根据所述观测概率参数、所述第一数量以及所述第二数量计算所述节点i和节点j间的边相关概率;将所述第一候选图中每两个节点间的边相关概率进行相乘运算,得到所述第一候选图对应的观测信息存在概率。Acquiring the total number of data included in the observation information, and determining an observation probability parameter according to the second parameter; acquiring the first quantity of data indicating the existence of an edge between node i and node j in the observation information, and determining the observation probability parameter according to the second parameter; The first quantity and the total quantity determine the second quantity of data indicating that there is no edge between node i and node j in the observation information; wherein, node i and node j are any arbitrary data included in the first candidate graph. Two nodes and i is less than j; calculate the edge correlation probability between the node i and node j according to the observation probability parameter, the first number and the second number; The edge correlation probabilities between the nodes are multiplied to obtain the existence probability of the observation information corresponding to the first candidate graph.
在一个实施例中,所述观测概率参数包括第一类参数、第二类参数、第三类参数以及第四类参数;其中,所述第一类参数是指当节点i和节点j之间存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边存在的概率;所述第二类参数是指当节点i和节点j之间存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边不存在的概率;所述第三类参数是指当节点i和节点j之间不存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边不存在的概率,所述第四类参数是指当节点i和节点j之间不存在边时,所述观测集合中任一数据指示所述节点i和节点j之间边存在的概率。In one embodiment, the observation probability parameter includes a first-type parameter, a second-type parameter, a third-type parameter, and a fourth-type parameter; wherein, the first-type parameter refers to the time between node i and node j When there is an edge, any data in the observation set indicates the probability of the existence of an edge between the node i and node j; the second type of parameter refers to the observation when an edge exists between node i and node j Any data in the set indicates the probability that the edge between node i and node j does not exist; the third type of parameter refers to when there is no edge between node i and node j, any data in the observation set Indicates the probability that the edge between the node i and the node j does not exist, and the fourth parameter refers to when there is no edge between the node i and the node j, any data in the observation set indicates that the node i and the probability that an edge exists between node j.
在一个实施例中,所述N个候选图中包括第一候选图和第二候选图,所述处理器1101在基于每个候选图对应的生成概率和每个候选图对应的观测信息存在概率进行图估计得到估计邻接矩阵时,执行如下步骤:In one embodiment, the N candidate pictures include a first candidate picture and a second candidate picture, and the
获取所述第一参数的概率以及所述第二参数的概率;将所述第一参数的概率、所述第二参数的概率以及所述第一候选图对应的生成概率和所述第一候选图对应的观测信息存在概率输入至候选概率计算规则中进行运算,得到所述第一候选图作为估计图的第一候选概率;将所述第一参数的概率、所述第二参数的概率以及所述第二候选图对应的生成概率和所述第二候选图对应的观测信息存在概率输入至所述候选概率计算规则中进行运算,得到所述第二候选图作为估计图的第二候选概率;基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵。Obtain the probability of the first parameter and the probability of the second parameter; combine the probability of the first parameter, the probability of the second parameter, and the corresponding generation probability of the first candidate map with the first candidate The existence probability of the observation information corresponding to the graph is input into the candidate probability calculation rule for calculation, and the first candidate graph is obtained as the first candidate probability of the estimated graph; the probability of the first parameter, the probability of the second parameter and the The generation probability corresponding to the second candidate picture and the existence probability of the observation information corresponding to the second candidate picture are input into the candidate probability calculation rule for calculation, and the second candidate picture is obtained as the second candidate probability of the estimated picture generating an estimated adjacency matrix based on the first candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability and the adjacency matrix corresponding to the second candidate graph.
在一个实施例中,任一候选图对应的邻接矩阵包括M行M列,所述任一候选图对应的邻接矩阵包括M乘M个矩阵元素,所述估计邻接矩阵包括M行M列,所述估计邻接矩阵包括M乘M个目标矩阵元素;所述处理器1101在基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵时,执行如下步骤:In one embodiment, the adjacency matrix corresponding to any candidate graph includes M rows and M columns, the adjacency matrix corresponding to any candidate graph includes M by M matrix elements, and the estimated adjacency matrix includes M rows and M columns, so The estimated adjacency matrix includes M by M target matrix elements; the
获取所述第一候选图对应的邻接矩阵中第i行第j列位置处的第一矩阵元素,以及获取所述第二候选图对应的邻接矩阵中第i行第j列位置处的第二矩阵元素;将所述第一矩阵元素与所述第一候选概率进行相乘运算,得到第一运算结果,以及将所述第二矩阵元素与所述第二候选概率进行相乘运算,得到第二运算结果;将所述第一运算结果和所述第二运算结果进行相加运算,运算结果作为估计邻接矩阵中第i行第j列位置处的目标矩阵元素。Obtain the first matrix element at the position of the ith row and the jth column in the adjacency matrix corresponding to the first candidate image, and obtain the second element at the position of the ith row and the jth column in the adjacency matrix corresponding to the second candidate image. matrix element; multiply the first matrix element and the first candidate probability to obtain a first operation result, and multiply the second matrix element and the second candidate probability to obtain the first operation result. Two operation results; performing an addition operation on the first operation result and the second operation result, and the operation result is used as the target matrix element at the position of the i-th row and the j-th column in the estimated adjacency matrix.
在一个实施例中,基于所述第一候选概率、所述第一候选图对应的邻接矩阵、所述第二候选概率以及所述第二候选图对应的邻接矩阵生成估计邻接矩阵后,所述处理器1101还用于执行:In one embodiment, after generating an estimated adjacency matrix based on the first candidate probability, the adjacency matrix corresponding to the first candidate graph, the second candidate probability, and the adjacency matrix corresponding to the second candidate graph, the
根据所述第一候选概率和所述第二候选概率对所述第一参数和所述第二参数进行优化处理;基于优化处理后的第一参数和优化处理后的第二参数对估计邻接矩阵进行更新处理。The first parameter and the second parameter are optimized according to the first candidate probability and the second candidate probability; the adjacency matrix is estimated based on the optimized first parameter and the optimized second parameter pair Perform update processing.
在一个实施例中,所述处理器1101在根据所述第一候选概率和所述第二候选概率对所述第一参数和所述第二参数进行优化处理时,执行如下步骤:In one embodiment, when the
将所述第一候选概率和所述第二候选概率进行相加运算,得到所述第一参数和所述第二参数的联合后验概率表达式;利用预设不等式对所述联合后验概率表达式进行变换;基于所述第一参数对变换后的联合后验概率进行求导运算,得到所述第一参数对应的优化等式,以及基于所述第二参数对变化后的联合后验概率进行求导运算,得到所述第二参数对应的优化等式;对所述第一参数对应的优化等式求解得到优化处理后的第一参数,以及对所述第二参数对应的优化等式求解得到优化处理后的第二参数。The first candidate probability and the second candidate probability are added to obtain a joint posterior probability expression of the first parameter and the second parameter; the joint posterior probability is calculated by using a preset inequality Transform the expression; perform a derivation operation on the transformed joint posterior probability based on the first parameter to obtain an optimization equation corresponding to the first parameter, and perform a derivation operation on the changed joint posterior based on the second parameter Perform a derivation operation on the probability to obtain the optimization equation corresponding to the second parameter; solve the optimization equation corresponding to the first parameter to obtain the optimized first parameter, and the optimization corresponding to the second parameter, etc. The second parameter after optimization is obtained by solving the formula.
在一个实施例中,所述处理器1101在根据所述估计邻接矩阵生成所述估计图时,执行如下步骤:In one embodiment, when the
对所述估计邻接矩阵进行稀疏化处理,从所述估计邻接矩阵中提取目标邻接矩阵;根据所述目标邻接矩阵生成所述估计图。Perform sparse processing on the estimated adjacency matrix, and extract a target adjacency matrix from the estimated adjacency matrix; and generate the estimated graph according to the target adjacency matrix.
在一个实施例中,所述处理器1101在对所述估计邻接矩阵进行稀疏化处理,从所述估计邻接矩阵中提取目标邻接矩阵时,执行如下步骤:遍历所述估计邻接矩阵中每个目标矩阵元素,将所述估计邻接矩阵中小于等于阈值的矩阵元素替换为零,得到所述目标邻接矩阵。In one embodiment, when the
在一个实施例中,所述初始图对应的预测信息包括所述初始图的多个节点中每个节点对应的预测值,任一节点对应的预测值用于指示所述任一节点所属类别,所述标签信息包括用于指示目标节点所属类别的目标值,所述将所述第一邻居图和所述第二邻居图组成所述邻居图集合之后,所述处理器1101还用于:In one embodiment, the prediction information corresponding to the initial graph includes a predicted value corresponding to each node in the multiple nodes of the initial graph, and the predicted value corresponding to any node is used to indicate the category to which any node belongs, The label information includes a target value used to indicate the category to which the target node belongs. After the first neighbor graph and the second neighbor graph are formed into the neighbor graph set, the
从所述初始图对应的预测信息中获取所述目标节点对应的预测值,并确定所述目标节点对应的预测值与所述标签信息包括的所述目标值之间的差异信息;根据所述差异信息构建所述图预测模型对应的损失函数;按照减少所述损失函数的值的方向更新所述第一权重参数和所述第二权重参数;基于更新的第一权重参数和更新的第二权重参数分别更新所述初始图对应的预测信息和所述邻居图集合。Obtain the predicted value corresponding to the target node from the prediction information corresponding to the initial graph, and determine the difference information between the predicted value corresponding to the target node and the target value included in the label information; according to the constructing a loss function corresponding to the graph prediction model based on the difference information; updating the first weight parameter and the second weight parameter in the direction of reducing the value of the loss function; based on the updated first weight parameter and the updated second weight parameter The weight parameter updates the prediction information corresponding to the initial graph and the neighbor graph set respectively.
在一个实施例中,所述处理器1101还用于:获取待处理图,并调用图结构估计模型中优化后的所述图预测模型对所述待处理图进行预测处理,得到所述待处理图对应的目标观测信息,所述目标观测信息包括所述待处理图对应的目标预测信息;调用所述图估计器基于所述目标观测信息进行估计处理得到目标估计图;调用所述图预测模型对所述目标估计图进行处理,得到所述目标估计图对应的预测结果,所述预测结果用于指示所述待处理图中每个节点所属类别。In one embodiment, the
本发明实施例中,提出了一种图结构估计模型,由图预测模型和图估计器组成。在对图结构估计模型进行优化的过程中,可调用图结构估计模型中的图预测模型对初始图进行预测处理,得到所述初始图对应的观测信息,所述观测信息包括所述初始图对应的预测信息;然后调用图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;进一步的,调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息;基于所述估计图对应的预测信息和所述初始图对应的标签信息对所述图预测模型进行优化。In the embodiment of the present invention, a graph structure estimation model is proposed, which is composed of a graph prediction model and a graph estimator. In the process of optimizing the graph structure estimation model, the graph prediction model in the graph structure estimation model can be invoked to perform prediction processing on the initial graph to obtain observation information corresponding to the initial graph, where the observation information includes the corresponding initial graph. The prediction information of Prediction information; optimize the graph prediction model based on the prediction information corresponding to the estimated graph and the label information corresponding to the initial graph.
通过上述过程可见,对图预测模型的优化不仅仅是简单的基于初始图和初始图对应的标签信息,还要基于估计图对图预测模型进行优化。该估计图是图估计器基于图预测模型对初始图进行预测得到的观测信息进行估计得到的。换句话说,该估计图是在图预测模型的角度对初始图进行观测得到的,也就是说估计图相比于初始图而言,更能匹配图预测模型的性质,也就更符合图结构估计模型的性质。因此,基于估计图对图预测模型进行优化训练,可以提高图预测模型的准确度,从而可提高图结构估计模型的准确度。It can be seen from the above process that the optimization of the graph prediction model is not only based on the initial graph and the label information corresponding to the initial graph, but also optimizes the graph prediction model based on the estimated graph. The estimated graph is obtained by estimating the observation information obtained by the graph estimator predicting the initial graph based on the graph prediction model. In other words, the estimated graph is obtained by observing the initial graph from the perspective of the graph prediction model, that is to say, the estimated graph better matches the properties of the graph prediction model than the initial graph, which is more in line with the graph structure. Estimate the properties of the model. Therefore, optimizing the training of the graph prediction model based on the estimated graph can improve the accuracy of the graph prediction model, thereby improving the accuracy of the graph structure estimation model.
根据本申请的一个方面,本发明实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品包括计算机程序,该计算机程序存储在计算机存储介质中。处理器1101从计算机存储介质中读取该计算机程序,处理器1101执行该计算机程序,使得训练设备执行如图3和图5所示的图结构估计模型的训练方法,具体地:According to an aspect of the present application, an embodiment of the present invention further provides a computer program product or a computer program, where the computer program product includes a computer program, and the computer program is stored in a computer storage medium. The
获取初始图以及所述初始图对应的标签信息;所述初始图包含多个节点,所述标签信息用于指示所述初始图中目标节点所属类别,所述目标节点为所述初始图的多个节点中任意一个或多个;调用图结构估计模型包括的图预测模型对所述初始图进行预测处理,得到所述初始图对应的观测信息;调用所述图结构估计模型包括的图估计器基于所述标签信息和所述观测信息进行估计处理得到估计图;并调用所述图预测模型对所述估计图进行预测处理,得到所述估计图对应的预测信息,所述估计图对应的预测信息用于指示所述估计图中各个节点所属类别;基于所述估计图对应的预测信息和所述标签信息对所述图预测模型进行优化。Obtain the initial graph and the label information corresponding to the initial graph; the initial graph includes multiple nodes, and the label information is used to indicate the category to which the target node in the initial graph belongs, and the target node is a plurality of nodes in the initial graph. Any one or more of the nodes; call the graph prediction model included in the graph structure estimation model to perform prediction processing on the initial graph, and obtain the observation information corresponding to the initial graph; call the graph estimator included in the graph structure estimation model Perform estimation processing based on the label information and the observation information to obtain an estimated graph; and call the graph prediction model to perform prediction processing on the estimated graph to obtain prediction information corresponding to the estimated graph, and the prediction corresponding to the estimated graph The information is used to indicate the category to which each node in the estimation graph belongs; the graph prediction model is optimized based on the prediction information corresponding to the estimation graph and the label information.
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011574363.8A CN113515519A (en) | 2020-12-25 | 2020-12-25 | Training method, device, device and storage medium for graph structure estimation model |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011574363.8A CN113515519A (en) | 2020-12-25 | 2020-12-25 | Training method, device, device and storage medium for graph structure estimation model |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN113515519A true CN113515519A (en) | 2021-10-19 |
Family
ID=78061004
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011574363.8A Pending CN113515519A (en) | 2020-12-25 | 2020-12-25 | Training method, device, device and storage medium for graph structure estimation model |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113515519A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114048816A (en) * | 2021-11-16 | 2022-02-15 | 中国人民解放军国防科技大学 | A graph neural network data sampling method, device, equipment and storage medium |
| CN114996567A (en) * | 2022-05-06 | 2022-09-02 | 北京化工大学 | An API recommendation method based on context and graph learning |
| CN115345291A (en) * | 2022-07-05 | 2022-11-15 | 华为技术有限公司 | Graph processing method and related device |
| CN115426168A (en) * | 2022-08-31 | 2022-12-02 | 东北大学秦皇岛分校 | False data injection attack positioning detection method and system based on graph convolution network |
| CN116319110A (en) * | 2023-05-24 | 2023-06-23 | 保定思齐智科信息科技有限公司 | Data acquisition and management method for industrial multi-source heterogeneous time sequence data |
| CN117272195A (en) * | 2023-08-21 | 2023-12-22 | 杭州云象网络技术有限公司 | Block chain abnormal node detection method and system based on graph convolution attention network |
| CN118690314A (en) * | 2024-08-27 | 2024-09-24 | 山东众志电子有限公司 | A graph structure data anomaly assessment method for big data scenarios |
-
2020
- 2020-12-25 CN CN202011574363.8A patent/CN113515519A/en active Pending
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114048816A (en) * | 2021-11-16 | 2022-02-15 | 中国人民解放军国防科技大学 | A graph neural network data sampling method, device, equipment and storage medium |
| CN114048816B (en) * | 2021-11-16 | 2024-04-30 | 中国人民解放军国防科技大学 | Method, device, equipment and storage medium for sampling data of graph neural network |
| CN114996567A (en) * | 2022-05-06 | 2022-09-02 | 北京化工大学 | An API recommendation method based on context and graph learning |
| CN115345291A (en) * | 2022-07-05 | 2022-11-15 | 华为技术有限公司 | Graph processing method and related device |
| CN115426168A (en) * | 2022-08-31 | 2022-12-02 | 东北大学秦皇岛分校 | False data injection attack positioning detection method and system based on graph convolution network |
| CN116319110A (en) * | 2023-05-24 | 2023-06-23 | 保定思齐智科信息科技有限公司 | Data acquisition and management method for industrial multi-source heterogeneous time sequence data |
| CN116319110B (en) * | 2023-05-24 | 2023-08-11 | 保定思齐智科信息科技有限公司 | Data acquisition and management method for industrial multi-source heterogeneous time sequence data |
| CN117272195A (en) * | 2023-08-21 | 2023-12-22 | 杭州云象网络技术有限公司 | Block chain abnormal node detection method and system based on graph convolution attention network |
| CN118690314A (en) * | 2024-08-27 | 2024-09-24 | 山东众志电子有限公司 | A graph structure data anomaly assessment method for big data scenarios |
| CN118690314B (en) * | 2024-08-27 | 2025-01-21 | 山东众志电子有限公司 | A graph structure data anomaly assessment method for big data scenarios |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11860675B2 (en) | Latent network summarization | |
| CN113515519A (en) | Training method, device, device and storage medium for graph structure estimation model | |
| CN112567355B (en) | End-to-end structure-aware convolutional networks for knowledge base completion | |
| US11232355B2 (en) | Deep graph representation learning | |
| US20240419942A1 (en) | Entity Tag Association Prediction Method, Device, and Computer Readable Storage Medium | |
| US11341417B2 (en) | Method and apparatus for completing a knowledge graph | |
| WO2023000574A1 (en) | Model training method, apparatus and device, and readable storage medium | |
| He et al. | High-order graph attention network | |
| CN110347932B (en) | Cross-network user alignment method based on deep learning | |
| CN112069398A (en) | A kind of information push method and device based on graph network | |
| Zhang et al. | Node-feature convolution for graph convolutional networks | |
| US20230342606A1 (en) | Training method and apparatus for graph neural network | |
| WO2022252458A1 (en) | Classification model training method and apparatus, device, and medium | |
| CN104809139B (en) | Code file querying method and device | |
| CN112182511B (en) | Complex semantic enhanced heterogeneous information network representation learning method and device | |
| CN113326884B (en) | Efficient learning method and device for large-scale heterograph node representation | |
| CN117807275A (en) | Heterogeneous graph embedding method and system based on relation mining | |
| CN114492651B (en) | Semi-supervised graph node classification method based on personalized webpage ranking | |
| CN110717116B (en) | Link prediction method and system of relational network, equipment and storage medium | |
| US20250232207A1 (en) | Performance optimization predictions related to an entity dataset based on a modified version of a predefined feature set for a candidate machine learning model | |
| CN109728958B (en) | A network node trust prediction method, device, equipment and medium | |
| WO2025020590A1 (en) | Data clustering method and apparatus, and computer-readable storage medium | |
| CN116484953B (en) | A travel purpose inference method and terminal | |
| Bo | Homogeneous graph neural networks | |
| CN116467466A (en) | Knowledge graph-based code recommendation method, device, equipment and medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| WD01 | Invention patent application deemed withdrawn after publication | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20211019 |