Factor network structure self-construction and characterization method, device, equipment and medium

By collecting samples, building clustering models and using attention model to train the factor network structure model, the problem of weak factor network representation ability in the existing technology is solved, and unsupervised learning and efficient representation are achieved.

CN120146134AInactive Publication Date: 2025-06-13WEST CHINA HOSPITAL SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510593450.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When analyzing the relationship between many factors, the prior art has the problem of weak characterization ability and cannot effectively construct and characterize the factor network structure.

Method used

By collecting multiple samples, establishing the initial main values ​​and initial other values ​​of the nodes, determining the number of categories of nodes and building a clustering model, using the attention model to train the factor network structure model, and building a neural network message delivery network to obtain the network characterization of nodes and samples.

Benefits of technology

Unsupervised automatic learning of network structure is realized, and the characterization of each factor and the entire network can be calculated in the form of a neural network, which improves the characterization ability of the factor network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146134A_ABST
    Figure CN120146134A_ABST
Patent Text Reader

Abstract

The invention discloses a factor network structure self-construction and characterization method and device, equipment and a medium. The method comprises the steps that a plurality of samples are collected, each sample comprises a plurality of nodes, and an initial main value and an initial other value of each node of each sample are established; determining the category number of each node, constructing a clustering model according to the data of each node and the category number, and determining the category to which each node belongs according to the clustering model; traversing each sample, and training a factor network structure model by using an attention model according to the category to which each node belongs; and constructing a neural network message passing network according to the factor network structure model, and representing each node and each sample by using the neural network message passing network to obtain network representation of each node and each sample. According to the method, the network relationship between the single factor and other remaining factors is automatically learned by using the attention model, the network structure can be automatically learned without supervision, and the representation of each factor and the representation of the whole network can be calculated in a neural network mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network analysis, and in particular, to a method, device, equipment and medium for self-constructing and characterizing a factor network structure. Background Art

[0002] When analyzing the relationships among many factors in the prior art, some are directly regarded as linear relationships, some are regarded as a pure black box, and some draw structures based on experience or data. However, to a certain extent, there are problems with weak characterization ability. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for self-constructing and characterizing a factor network structure.

[0004] The present invention provides the following technical solutions: In a first aspect, an embodiment of the present disclosure provides a method for self-constructing and characterizing a factor network structure, the method comprising: Collecting a plurality of samples, each of the samples including a plurality of nodes, and forming an initial main value and an initial other value for each node of each of the samples; Determining the number of categories of each of the nodes, constructing a clustering model according to the data and the number of categories of each of the nodes, and determining the category to which each of the nodes belongs according to the clustering model; Traversing each of the samples, and training a factor network structure model according to the category to which each of the nodes belongs and using an attention model; According to the factor network structure model, constructing a neural network message passing network, and using the neural network message passing network to characterize each of the nodes and each of the samples respectively, so as to obtain network characterizations of each of the nodes and each of the samples.

[0005] Optionally, the traversing each of the samples, training a factor network structure model according to the category to which each of the nodes belongs and using an attention model includes: Obtaining a node category vector parameter with trainable parameters according to the category to which each node in each of the samples belongs, and forming a vector of a corresponding node with the node category vector parameter with trainable parameters, the initial main value and the initial other value; Calculating a predicted main value and a predicted other value for each of the nodes according to the vectors of each of the nodes and using the attention model; Training a factor network structure model with the initial main value, the initial other value, the predicted main value and the predicted other value of each of the nodes, and obtaining a relationship model between each of the nodes and other nodes through an attention mechanism.

[0006] Optionally, calculating the predicted main value and predicted other values of each of the nodes based on the vectors of each of the nodes and using the attention model includes: According to the category to which each of the nodes in each of the samples belongs, obtaining the attention model corresponding to each of the nodes, where the attention model includes a plurality of multi-head attention modules, a plurality of summation and normalization modules, and a feed-forward neural layer; Traverse each of the nodes, and mask the initial main value and initial other value of the current node to obtain the marked vector of the current node; Using the attention model and based on the marked vector of the current node and the vectors of other nodes, calculating the attention scores of the other nodes for the current node, and obtaining the predicted main value and predicted other values of each of the nodes according to the attention scores.

[0007] Optionally, training the factor network structure model using the initial main value, initial other value, predicted main value, and predicted other value of each of the nodes includes: Forming an initial sub-vector of the corresponding node with the initial main value and the initial other value, and forming a predicted sub-vector of the corresponding node with the predicted main value and the predicted other value; Calculating the vector difference between the predicted sub-vector and the initial sub-vector of each of the nodes, and calculating the norm of the vector difference to obtain the loss of the corresponding node; Calculating the average value of the losses of all the nodes within each of the samples to obtain the loss of each of the samples.

[0008] Optionally, constructing a neural network message passing network according to the factor network structure model, and using the neural network message passing network to respectively represent each of the nodes and each of the samples to obtain the network representations of each of the nodes and each of the samples includes: Traverse each of the nodes, mask the initial main value and initial other value of the current node, and summarize the information of the remaining nodes into the attention model corresponding to the current node to obtain the current main value and current other value of the current node; Updating the current main value and current other value of the current node according to a preset update rate to obtain the updated main value and updated other value of the current node; Determining whether the current main value, current other value, updated main value, and updated other value of the current node satisfy a preset condition. If the preset condition is satisfied, stop updating. If the preset condition is not satisfied, continue to update until the preset condition is satisfied to obtain the final main value and final other value of the current node; Obtaining the network representations of each of the nodes and each of the samples according to the final main value and final other value of each of the nodes.

[0009] Optionally, determining whether the current main value, current other value, updated main value, and updated other value of the current node satisfy a preset condition includes: Calculating a first update difference between the updated main value and the current main value of the current node, and calculating a second update difference between the updated other value and the current other value of the current node; Determining whether the sum value of the first update difference and the second update difference is less than a preset threshold. If so, the preset condition is satisfied; if not, the preset condition is not satisfied.

[0010] Optionally, obtaining the network representations of each node and each sample according to the final main value and final other value of each node includes: Forming the network representation of the corresponding node by using the final main value, the final other value, and the node category vector parameter of the trainable parameter; Calculating the average value of the network representations of all nodes within each sample to obtain the network representation of each sample.

[0011] In a second aspect, an apparatus for self-constructing and representing a factor network structure is provided in an embodiment of the present disclosure. The apparatus includes: A collection module, configured to collect a plurality of samples, where each sample includes a plurality of nodes, and form an initial main value and an initial other value of each node of each sample; A determination module, configured to determine the number of categories of each node, construct a clustering model according to the data and the number of categories of each node, and determine the category to which each node belongs according to the clustering model; A training module, configured to traverse each sample, and train a factor network structure model according to the category to which each node belongs and by using an attention model; A representation module, configured to construct a neural network message passing network according to the factor network structure model, and use the neural network message passing network to represent each node and each sample respectively, so as to obtain the network representations of each node and each sample.

[0012] In a third aspect, a computer device is provided in an embodiment of the present disclosure. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the factor network structure self-construction and representation method in the first aspect are implemented.

[0013] In a fourth aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the factor network structure self-construction and representation method in the first aspect are implemented.

[0014] Advantages of the present application: The method for self-constructing and characterizing a factor network structure provided by an embodiment of the present application collects multiple samples, each of the samples includes multiple nodes, and initial main values and initial other values of each node of each of the samples are formed; the number of categories of each of the nodes is determined, a clustering model is constructed according to the data of each of the nodes and the number of categories, and the category to which each of the nodes belongs is determined according to the clustering model; each of the samples is traversed, and a factor network structure model is trained by using an attention model according to the category to which each of the nodes belongs; according to the factor network structure model, a neural network message passing network is constructed, and each of the nodes and each of the samples are characterized by using the neural network message passing network, so as to obtain network characterizations of each of the nodes and each of the samples. By using the attention model to automatically learn the network relationship between a single factor and other remaining factors, the present application can automatically learn the network structure without supervision, and at the same time can calculate the characterization of each factor and the entire network characterization in the form of a neural network.

[0015] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. Description of the Drawings

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts. In each of the drawings, similar components are numbered similarly.

[0017] Figure 1 Shows one of the flowcharts of a method for self-constructing and characterizing a factor network structure provided by an embodiment of the present application; Figure 2 Shows another flowchart of a method for self-constructing and characterizing a factor network structure provided by an embodiment of the present application; Figure 3 Shows still another flowchart of a method for self-constructing and characterizing a factor network structure provided by an embodiment of the present application; Figure 4 Shows a schematic structural diagram of a device for self-constructing and characterizing a factor network structure provided by an embodiment of the present application; Figure 5 Shows a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed Embodiments

[0018] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.

[0019] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there can also be an intermediate element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be an intermediate element at the same time. On the contrary, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0020] In the present invention, unless otherwise clearly specified and defined, terms such as "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0021] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, the meaning of "a plurality" is two or more unless otherwise clearly and specifically defined.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used in the specification of this template herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0023] Embodiment 1 As Figure 1 shown, it is a flowchart of a method for self-constructing and characterizing a factor network structure in an embodiment of the present application. The method for self-constructing and characterizing a factor network structure provided by the embodiment of the present application includes the following steps: Step S110, collect multiple samples, where each sample includes multiple nodes, and construct the initial main values and initial other values of each node of each sample.

[0024] In this embodiment, obtain the data of multiple samples from the data source, and each sample contains information of multiple nodes. According to the data of each node in the sample, construct the initial main value ( ), and the initial other value ( ), and these values can be the attributes, features or measurement values of the nodes. Suppose the number of nodes is X, and the and length and semantic space of all nodes need to be kept consistent for subsequent processing.

[0025] The above method is the starting step of data processing, which ensures that there is a sufficient and uniformly formatted data basis for subsequent analysis. By constructing the initial main values and initial other values of the nodes, it provides the necessary input features for subsequent model training, and these features are crucial for understanding the characteristics and behaviors of the nodes. Ensuring the consistency of the length and semantic space of all nodes' value and othervalue helps the model maintain consistency and accuracy when processing data.

[0026] Step S120, determine the number of categories of each node, construct a clustering model according to the data of each node and the number of categories, and determine the category to which each node belongs according to the clustering model.

[0027] Understandably, first determine the number of categories K of each node, and use the Kmeans algorithm to cluster the nodes according to the data characteristics of the nodes to form a clustering model, and then determine the category to which each node belongs according to the clustering model.

[0028] The above method makes it clear that determining the number of categories of each node is a prerequisite for subsequent clustering analysis and model training, which helps the model better understand the structure of the data. Through the clustering model, similar nodes can be grouped into one category, which provides convenience for subsequent category-based analysis and processing. Assigning category labels to each node helps the model learn the potential relationships between nodes during the training process.

[0029] Step S130, traverse each sample, and train the factor network structure model according to the category to which each node belongs and using the attention model.

[0030] Specifically, according to the category m to which each node in each sample belongs, obtain the node category vector parameter of the trainable parameter , and use the node category vector parameter of the trainable parameter , the initial main value and the initial other value Connect them to form a complete vector for the corresponding node, expressed as:

[0031] Further, according to the vectors of each node and using the attention model, calculate the predicted main value and predicted other values of each node, as Figure 2 shown, specifically including the following steps: Step S131, according to the categories to which each node in each of the samples belongs, obtain the attention model corresponding to each node, where the attention model includes a plurality of multi-head attention modules, a plurality of summation and normalization modules, and a feed-forward neural layer; Step S132, traverse each node, and mask the initial main value and initial other value of the current node to obtain the marked vector of the current node; Step S133, use the attention model and according to the marked vector of the current node and the vectors of other nodes, calculate the attention scores of other nodes for the current node, and obtain the predicted main value and predicted other values of each node according to the attention scores.

[0032] Understandably, according to each node in the sample belonging to the category m, obtain the corresponding attention model . The attention model parameters of nodes in the same category are shared, and there will be K attention models. In this embodiment, the attention model follows the structure of the decoder part of Bert, including a multi-head attention module, a summation and normalization module, a multi-head attention module, a summation and normalization module, a feed-forward neural layer, and a summation and normalization module. These operations are repeated N times to enhance the expression ability of the model (N is a preset value).

[0033] Traverse all nodes and mask the current node 's initial main value and initial other value part (that is, the and of the current node are filled with 0), to obtain the marked vector of the current node , expressed as:

[0034] Then use the attention model and according to the marked vector of the current node and the vectors of other nodes, calculate the attention scores of other nodes for the current node, and obtain the predicted main value and predicted other value of this node, expressed as:

[0035] Among them,

[0036] Furthermore, the factor network structure model is trained using the initial main values, initial other values, predicted main values, and predicted other values of each node, as Figure 3 shown, which specifically includes the following steps: Step S134: Form an initial sub-vector of the corresponding node from the initial main value and the initial other value, and form a predicted sub-vector of the corresponding node from the predicted main value and the predicted other value; Step S135: Calculate the vector difference between the predicted sub-vector and the initial sub-vector of each node, and calculate the norm of the vector difference to obtain the loss of the corresponding node; Step S136: Calculate the average value of the losses of all nodes within each sample to obtain the loss of each sample.

[0037] Understandably, first form an initial sub-vector of the corresponding node from the initial main value and the initial other value , and form a predicted sub-vector of the corresponding node from the predicted main value and the predicted other value . Then calculate the norm of the vector difference between the predicted sub-vector and the initial sub-vector of each node, that is, obtain the loss of the corresponding node , which is expressed as:

[0038] Next, sum and average the losses of all nodes (X nodes) within each sample to obtain the loss of a single sample , which is expressed as:

[0039] It should be noted that it can be used for the optimization of subsequent model parameters.

[0040] Furthermore, obtain the relationship model between each node and other nodes, , , . According to the basic idea of network modeling, the network relationship of all nodes can be disassembled into the relationship self-network of any node and the remaining nodes, because each node only has a relationship with the nodes it is connected to, which is expressed as:

[0041] The above method uses the attention model to train the factor network structure model, which can capture the complex relationships between nodes and improve the prediction ability of the model. By connecting the node category vector parameters, initial main values, and initial other values to form a complete node vector, the expression ability of the model is enhanced. By calculating the predicted main values and predicted other values, the model can more accurately predict the future state or behavior of the node.

[0042] Step S140: Construct a neural network message passing network according to the factor network structure model, and use the neural network message passing network to represent each of the nodes and each of the samples, so as to obtain the network representations of each of the nodes and each of the samples.

[0043] Specifically, first traverse all the nodes, mask the initial main value and the initial other value of the current node, and summarize the information of the remaining nodes into the attention model corresponding to the current node to obtain the current main value and the current other value of the current node, which is expressed as:

[0044] Then, update the current main value and the current other value of the current node according to a preset update rate to obtain the updated main value and the updated other value of the current node, which is expressed as:

[0045] Furthermore, determine whether the current main value, the current other value, the updated main value, and the updated other value of the current node meet the preset conditions, that is, calculate the first update difference between the updated main value and the current main value of the current node, calculate the second update difference between the updated other value and the current other value of the current node, and determine whether the sum of the first update difference and the second update difference is less than a preset threshold which is expressed as:

[0046] If it is less than the preset threshold , then the preset conditions are met. At this time, it is considered that the representation of the node has converged and the update is stopped. If it is greater than or equal to the preset threshold , then the preset conditions are not met. At this time, repeat the above steps t times to continue the update until the preset conditions are met. Finally, obtain the final main value and the final other value of the current node.

[0047] Furthermore, form the network representation of the corresponding node with the final main value , the final other value and the node category vector parameter of the trainable parameter which is expressed as:

[0048] Similarly, by integrating the information of all nodes within a single sample and calculating the average of the network representations of all nodes within the single sample, the network representation of the single sample can be obtained. , which is expressed as:

[0049] Understandably, the learned node representations and sample representations can be used for downstream tasks such as node classification, link prediction, graph classification, etc.

[0050] The above method ensures the stability and accuracy of the model by determining whether the current main value, current other values, updated main value, and updated other values of the node meet the preset conditions. By constructing a neural network message passing network, the network representations of nodes and samples are obtained, and the learned node representations and sample representations provide strong support for subsequent machine learning or deep learning tasks.

[0051] The method for self-constructing and representing a factor network structure provided by the embodiments of the present application collects multiple samples, each of which includes multiple nodes, and forms the initial main value and initial other values of each node of each sample; determines the number of categories of each node, constructs a clustering model according to the data of each node and the number of categories, and determines the category to which each node belongs according to the clustering model; traverses each sample, and trains a factor network structure model according to the category to which each node belongs and using an attention model; constructs a neural network message passing network according to the factor network structure model, and uses the neural network message passing network to represent each node and each sample respectively, so as to obtain the network representations of each node and each sample. The present application can automatically learn the network relationship between single factors and other remaining factors by using an attention model, can automatically learn the network structure without supervision, and can calculate the representations of each factor and the entire network representation in the form of a neural network.

[0052] Embodiment 2 As Figure 4 shown, it is a schematic structural diagram of a device 400 for self-constructing and representing a factor network structure in the embodiments of the present application. The device includes: A collection module 410, configured to collect multiple samples, each of which includes multiple nodes, and form the initial main value and initial other values of each node of each sample; A determination module 420, configured to determine the number of categories of each node, construct a clustering model according to the data of each node and the number of categories, and determine the category to which each node belongs according to the clustering model; A training module 430, configured to traverse each sample, and train a factor network structure model according to the category to which each node belongs and using an attention model; A characterization module 440 is configured to construct a neural network message passing network according to the factor network structure model, and use the neural network message passing network to characterize each of the nodes and each of the samples respectively, so as to obtain the network characterizations of each of the nodes and each of the samples.

[0053] The factor network structure self-construction and characterization device provided by the embodiments of the present application can automatically learn the network relationship between a single factor and other remaining factors by using an attention model, can automatically learn the network structure without supervision, and can calculate the characterizations of each factor and the entire network characterization in the form of a neural network.

[0054] Embodiment 3 The embodiments of the present application further provide a computer device. Specifically, please refer to Figure 5 , Figure 5 which is the basic structural block diagram of the computer device in this embodiment.

[0055] The computer device 5 includes a memory 51, a processor 52, and a network interface 53 that are communicatively connected to each other through a system bus. It should be noted that only the computer device 5 with the memory 51, the processor 52, and the network interface 53 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Among them, those skilled in the art of the present technology can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0056] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device can perform human-computer interaction with a user through means such as a keyboard, a mouse, a remote control, a touchpad, or a voice control device.

[0057] The memory 51 at least includes one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or D-slot compatibility test memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disc, etc. In some embodiments, the memory 51 may be an internal storage unit of the computer device 5, such as the hard disk or memory of the computer device 5. In other embodiments, the memory 51 may also be an external storage device of the computer device 5, such as a plug-in hard disk equipped on the computer device 5, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Of course, the memory 51 may also include both the internal storage unit and the external storage device of the computer device 5. In this embodiment, the memory 51 is generally used to store the operating system and various application software installed on the computer device 5, such as computer-readable instructions of the slot compatibility test method. In addition, the memory 51 may also be used to temporarily store various data that have been output or will be output.

[0058] In some embodiments, the processor 52 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other factor network structure self-construction and characterization chips. The processor 52 is generally used to control the overall operation of the computer device 5. In this embodiment, the processor 52 is used to run the computer-readable instructions stored in the memory 51 or process data, such as running the computer-readable instructions of the slot compatibility test method.

[0059] The network interface 53 may include a wireless network interface or a wired network interface, and the network interface 53 is generally used to establish a communication connection between the computer device 5 and other electronic devices.

[0060] The computer device provided in this embodiment can execute the above-mentioned factor network structure self-construction and characterization method. Here, the factor network structure self-construction and characterization method may be the factor network structure self-construction and characterization method of the above various embodiments.

[0061] Embodiment 4 This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the factor network structure self-construction and characterization method in the embodiment are implemented.

[0062] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a Smart Media Card (SMC for short), a Secure Digital (SD for short) card, a Flash Card, etc. Of course, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is generally used to store the operating system and various application software installed on the computer device. In addition, the computer-readable storage medium can also be used to temporarily store various data that have been output or will be output.

[0063] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the apparatus, method, and computer program product according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the block may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0064] In addition, each functional module or unit in various embodiments of the present invention may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.

[0065] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium can be a non-volatile storage medium or a volatile storage medium. For example, the storage medium can be: various media that can store program codes such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.

[0066] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention.

Claims

1. A method for self-constructing and characterizing a factor network structure, characterized in that: The method comprises: Collecting a plurality of samples, each of which includes a plurality of nodes, and establishing an initial main value and an initial other value of each node of each of the samples; Determine the number of categories of each of the nodes, build a clustering model based on the data of each of the nodes and the number of categories, and determine the category to which each of the nodes belongs based on the clustering model; Traversing each of the samples, and training a factor network structure model according to the category to which each of the nodes belongs and using an attention model; According to the factor network structure model, a neural network message passing network is constructed, and the neural network message passing network is used to characterize each of the nodes and each of the samples respectively to obtain a network characterization of each of the nodes and each of the samples.

2. The factor network structure self-construction and characterization method according to claim 1, characterized in that: The traversing of the samples and training the factor network structure model according to the category to which each node belongs and using the attention model include: According to the category to which each of the nodes in each of the samples belongs, obtaining a node category vector parameter of a trainable parameter, and forming a vector of a corresponding node with the node category vector parameter of the trainable parameter, the initial main value and the initial other values; Calculating the predicted main value and predicted other values ​​of each node according to the vector of each node and using the attention model; The factor network structure model is trained using the initial main value, initial other values, predicted main value and predicted other values ​​of each node, and the relationship model between each node and other nodes is obtained through the attention mechanism.

3. The factor network structure self-construction and characterization method according to claim 2, characterized in that: The step of calculating the predicted main value and predicted other values ​​of each node according to the vector of each node and using the attention model includes: According to the category to which each of the nodes in each of the samples belongs, obtaining an attention model corresponding to each of the nodes, wherein the attention model includes a plurality of multi-head attention modules, a plurality of summation and normalization modules, and a feedforward neural layer; Traversing each of the nodes, and masking the initial main value and initial other values ​​of the current node, to obtain a label vector of the current node; The attention model is used to calculate the attention scores of the other nodes to the current node based on the label vector of the current node and the vectors of other nodes, and the predicted main value and predicted other values ​​of each node are obtained based on the attention scores.

4. The factor network structure self-construction and characterization method according to claim 2, characterized in that: The factor network structure model is trained by using the initial main value, initial other value, predicted main value and predicted other value of each node, including: The initial main value and the initial other values ​​form an initial sub-vector of the corresponding node, and the predicted main value and the predicted other values ​​form a predicted sub-vector of the corresponding node; Calculating the vector difference between the predicted sub-vector and the initial sub-vector of each node, and calculating the modulus of the vector difference to obtain the loss of the corresponding node; The average value of the losses of all nodes in each of the samples is calculated to obtain the loss of each of the samples.

5. The method for self-constructing and characterizing a factor network structure according to claim 3, characterized in that: The step of constructing a neural network message passing network according to the factor network structure model, and using the neural network message passing network to characterize each of the nodes and each of the samples respectively to obtain a network characterization of each of the nodes and each of the samples includes: Traversing each of the nodes, masking the initial main value and the initial other values ​​of the current node, and aggregating the information of the remaining nodes into the attention model corresponding to the current node to obtain the current main value and the current other values ​​of the current node; The current main value and the current other values ​​of the current node are updated according to a preset update rate to obtain an updated main value and updated other values ​​of the current node; Determine whether the current main value, current other values, updated main value, and updated other values ​​of the current node meet preset conditions, if the preset conditions are met, stop updating, if not, continue updating until the preset conditions are met, and obtain the final main value and final other values ​​of the current node; According to the final main value and the final other values ​​of each of the nodes, the network representation of each of the nodes and each of the samples is obtained.

6. The method for self-constructing and characterizing a factor network structure according to claim 5, characterized in that: The determining whether the current main value, the current other values, the updated main value, and the updated other values ​​of the current node meet preset conditions includes: Calculating a first updated difference between the updated main value of the current node and the current main value, and calculating a second updated difference between the updated other value of the current node and the current other value; It is determined whether the sum of the first update difference and the second update difference is less than a preset threshold value. If so, the preset condition is met; otherwise, the preset condition is not met.

7. The method for self-constructing and characterizing a factor network structure according to claim 5, characterized in that: The obtaining of network representations of each of the nodes and each of the samples according to the final main value and the final other value of each of the nodes includes: The final main value, the final other value and the node category vector parameter of the trainable parameter form a network representation of the corresponding node; The average value of the network representations of all nodes in each of the samples is calculated to obtain the network representation of each of the samples.

8. A factor network structure self-construction and characterization device, characterized in that: The device is used to execute the factor network structure self-construction and characterization method according to any one of claims 1 to 7, comprising: A collection module, used to collect a plurality of samples, each of which includes a plurality of nodes, and to construct an initial main value and an initial other value of each node of each of the samples; A determination module, used to determine the number of categories of each of the nodes, build a clustering model according to the data of each of the nodes and the number of categories, and determine the category to which each of the nodes belongs according to the clustering model; A training module, used for traversing each of the samples, and training a factor network structure model according to the category to which each of the nodes belongs and using an attention model; The characterization module is used to construct a neural network message passing network according to the factor network structure model, and use the neural network message passing network to characterize each of the nodes and each of the samples respectively to obtain a network characterization of each of the nodes and each of the samples.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for self-constructing and characterizing a factor network structure according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the factor network structure self-construction and characterization method described in any one of claims 1 to 7 are implemented.