Result reasoning method and device, electronic equipment and storage medium
By dynamically adjusting the network structure to obtain the inference results corresponding to the input data set and inference requirements, the problem of large amount of data and long iteration maintenance cycles when the new functions of the model are implemented is solved, and the inference efficiency and accuracy of the model are improved.
Patent Information
- Application Number
- CN202411886234.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
AI Technical Summary
When the model realizes new functions, the existing technology faces the problems of large amount of data, long iteration maintenance cycle, and point drops of original functional indicators.
By obtaining the input data set and a model that includes existing and new tasks, dynamically adjust the network structure to obtain inference results, reducing the need for separate training for new tasks.
Without affecting the inference results of existing tasks, reduce the drop in the existing indicators of the model, reduce the amount of data and iterative maintenance cycles, and improve the inference efficiency and accuracy of the model.
Smart Images

Figure CN119831040A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of artificial intelligence technology, and specifically to a result reasoning method and device, an electronic device, and a storage medium. Background Art
[0002] With the development of science and technology, the accuracy of algorithm reasoning has become the focus of users' attention. As business needs increase, the functions covered by the model also need to increase. When the model implements new functions, a separate model can be built according to the new functions, using single-point iteration, but the required data volume is large and the iteration maintenance cycle is long. In addition, new functions can be added based on the original public features, but all tasks need to be regressed, and the new iteration will cause the indicators of the original functions to drop. Summary of the invention
[0003] The present disclosure provides a result reasoning method and device, an electronic device and a storage medium, the main purpose of which is to reduce the drop in points of existing indicators of the model, reduce the demand for data volume and the iterative maintenance cycle of the model, and improve the reasoning efficiency and reasoning accuracy of the model.
[0004] According to one aspect of the present disclosure, a result reasoning method is provided, comprising:
[0005] Obtaining an input data set and a first model, wherein the first model includes the at least one trained first network structure and a trained second network structure, wherein the first network structure is used to perform reasoning on an existing task, and the second network structure is used to perform reasoning on a newly added task;
[0006] Acquire first reasoning state information of each first network structure and second reasoning state information of the second network structure according to the input data set and the reasoning requirement;
[0007] At least one inference result output by the first model is obtained according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information.
[0008] According to another aspect of the present disclosure, there is provided a result reasoning device, comprising:
[0009] A set acquisition unit, used to acquire an input data set and a first model, wherein the first model includes the at least one trained first network structure and a trained second network structure, wherein the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task;
[0010] An information acquisition unit, configured to acquire first reasoning state information of each first network structure and second reasoning state information of the second network structure according to the input data set and the reasoning requirement;
[0011] A result reasoning unit is used to obtain at least one reasoning result output by the first model according to the input data set, the first reasoning branch corresponding to the first reasoning state information, and the second reasoning branch corresponding to the second reasoning state information.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods described in the above aspect.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods described in the above aspect.
[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the methods described in the aforementioned aspect.
[0018] In one or more embodiments of the present disclosure, an input data set and a first model are obtained, the first model includes at least one trained first network structure and a trained second network structure, the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task; according to the input data set and reasoning requirements, first reasoning state information of each first network structure and second reasoning state information of the second network structure are obtained; according to the input data set, the first reasoning branch corresponding to the first reasoning state information, and the second reasoning branch corresponding to the second reasoning state information, at least one reasoning result output by the first model is obtained. Therefore, under the premise that the original reasoning ability of the model remains unchanged, the network structure for reasoning can be determined according to the input data set, and whether the newly added task is to be reasoned can be determined without affecting the reasoning results of the existing tasks, thereby reducing the drop in the existing indicators of the model, and the network structure can be dynamically adjusted to obtain the reasoning results corresponding to the input data set and the reasoning requirements, and there is no need to train a model for the newly added task separately, which can reduce the demand for data volume and the iterative maintenance cycle of the model, and can fully absorb the feature representation capabilities of the existing tasks, accelerate the convergence speed of the model, improve the effect of the model, and improve the reasoning efficiency and reasoning accuracy of the model.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0021] Figure 1 is a flowchart of a result inference method according to the first embodiment of the present disclosure;
[0022] Figure 2 is a flowchart of a result inference method according to the second embodiment of the present disclosure;
[0023] FIG3( a ) is a schematic diagram of a framework of at least one existing task according to an embodiment of the present disclosure;
[0024] FIG3( b ) is a framework diagram of at least one existing task and a newly added task in an embodiment of the present disclosure;
[0025] FIG3( c ) is a diagram of the network training structure after adding a task in an embodiment of the present disclosure;
[0026] FIG3( d ) is a diagram of the network reasoning structure after adding a task in an embodiment of the present disclosure;
[0027] FIG3( e ) is a simplified structural diagram of network reasoning after adding tasks in an embodiment of the present disclosure;
[0028] Figure 4 Schematic diagram of examples of various network structures in the embodiments of the present disclosure;
[0029] FIG5( a ) is a schematic diagram of the structure of a result reasoning device for implementing the result reasoning method of an embodiment of the present disclosure;
[0030] FIG5( b ) is a second structural diagram of a result reasoning device for implementing the result reasoning method of the embodiment of the present disclosure;
[0031] Figure 6 It is a block diagram of an electronic device used to implement the result reasoning method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0033] The present disclosure is described in detail below with reference to specific embodiments.
[0034] In the first embodiment, if Figure 1 As shown, Figure 1 This is a flowchart of a result reasoning method according to the first embodiment of the present disclosure, which can be implemented by a computer program and can be run on a device for performing result reasoning. The computer program can be integrated into an application or run as an independent tool application.
[0035] The result inference device may be an electronic device with artificial intelligence interaction capability, including but not limited to: autonomous vehicles, wearable devices, handheld devices, personal computers, tablet computers, vehicle-mounted devices, smart phones, computing devices or other processing devices connected to wireless modems, etc. In different networks, the terminal may be called by different names, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), fifth generation mobile communication technology (5G) network, fourth generation mobile communication technology (4G) network, third generation mobile communication technology (3G) network or electronic device in future evolution network, etc.
[0036] Specifically, the result reasoning method includes:
[0037] S101, obtaining an input data set and a first model, where the first model includes at least one trained first network structure and a trained second network structure, where the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task;
[0038] According to some embodiments, the input data set may be, for example, a collection of at least one input data. The input data set does not specifically refer to a fixed set. For example, when the amount of data included in the input data set changes, the input data set may also change accordingly. For example, when a certain input data in the input data set changes, the input data set may also change accordingly. There is no limitation on the name of the input data set. For example, the input data set may also be called a data set to be inferred, a data set to be identified, etc.
[0039] In some embodiments, the first model refers to a model that has been trained and can perform inference on at least one existing task and a newly added task. The "first" in the first model is used to distinguish it from the other models and does not specifically refer to a fixed model. For example, when the number of first network structures corresponding to the first model changes, the first model may also change accordingly. For example, when the newly added task changes, the second network structure may also change accordingly, and the first model may also change accordingly.
[0040] In some embodiments, the first network structure can be used, for example, to reason about an existing task, where different existing tasks can correspond to different first network structures. One first network structure can reason about one existing task, or can reason about multiple existing tasks. This disclosure embodiment does not limit this.
[0041] According to some embodiments, the second network structure may be used, for example, to perform reasoning on a newly added task.
[0042] In some embodiments, the existing task refers to a task that can be inferred by the first model without adding the second network structure. The test result obtained by testing the first model for the existing task without adding the second network structure may, for example, meet the result requirement.
[0043] In some embodiments, an input data set and a first model are obtained, the first model includes at least one trained first network structure and a trained second network structure, the first network structure is used to reason about existing tasks, and the second network structure is used to reason about newly added tasks.
[0044] S102, acquiring first reasoning state information of each first network structure and second reasoning state information of each second network structure according to an input data set and a reasoning requirement;
[0045] In some embodiments, the reasoning requirement is used to indicate the result set that needs to be inferred based on the input data set. The reasoning requirement does not specifically refer to a fixed set. For example, when the number of reasoning tasks corresponding to the reasoning requirement changes, the reasoning requirement may also change accordingly. The reasoning requirement may, for example, be included in the input data set, may also be input together with the input data set, or may be input separately from the input data set, which is not limited in the embodiments of the present disclosure.
[0046] In some embodiments, the first inference status information is status information indicating whether any first network structure is effective.
[0047] In some embodiments, the second reasoning status information is used to indicate whether the second network structure is effective. For example, it can be used to indicate whether it is necessary to use the second network structure to infer the input data set when the input data set is obtained to obtain the reasoning result corresponding to the newly added task.
[0048] According to some embodiments, first reasoning state information of each first network structure and second reasoning state information of the second network structure are obtained according to an input data set and a reasoning requirement.
[0049] S103: Obtain at least one inference result output by the first model according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information.
[0050] According to some embodiments, the first reasoning branch may be, for example, a reasoning branch corresponding to the first reasoning state. The second reasoning branch may be, for example, a reasoning branch corresponding to the second network structure. The "first" in the first reasoning branch is used to distinguish it from the other reasoning branches.
[0051] According to some embodiments, the inference result may be, for example, the result obtained by inferring the input data set using the network structure. The inference result does not specifically refer to a fixed structure. For example, when the inference requirement changes, the inference result may also change accordingly. For example, when the input data set changes, the inference result may also change accordingly.
[0052] In one or more embodiments of the present disclosure, an input data set and a first model are obtained, the first model includes at least one trained first network structure and a trained second network structure, the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task; according to the input data set and the reasoning requirements, the first reasoning state information of each first network structure and the second reasoning state information of the second network structure are obtained; according to the input data set, the first reasoning branch corresponding to the first reasoning state information and the second reasoning branch corresponding to the second reasoning state information, at least one reasoning result output by the first model is obtained. Therefore, under the premise that the original reasoning ability of the model remains unchanged, the network structure for reasoning can be determined according to the input data set, and whether the newly added task is to be reasoned can be determined without affecting the reasoning results of the existing tasks, thereby reducing the drop in the existing indicators of the model, and the network structure can be dynamically adjusted to obtain the reasoning results corresponding to the input data set and the reasoning requirements, and there is no need to train a model for the newly added task separately, which can reduce the demand for data volume and the iterative maintenance cycle of the model, and can fully absorb the feature representation capabilities of the existing tasks, accelerate the convergence speed of the model, improve the effect of the model, and improve the reasoning efficiency and reasoning accuracy of the model.
[0053] See also Figure 2 , Figure 2 is a flowchart of the result inference method according to the second embodiment of the present disclosure. Specifically,
[0054] S201, obtaining an input data set and a first model, where the first model includes at least one trained first network structure and a trained second network structure, where the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task;
[0055] The specific process is as described above and will not be repeated here.
[0056] In some embodiments, the embodiments of the present disclosure may be applied to the construction of smart cities, and may specifically involve vehicle-road cooperative perception services. The models involved may include, for example, gun 2D detection, gun 3D detection, fisheye detection, vehicle structuring, pedestrian structuring, non-motor vehicle structuring, DMS and other models. Various structurings themselves include detection and recognition functions of multiple attributes, that is, multiple detection and recognition tasks.
[0057] According to some embodiments, the technical solution of the embodiments of the present disclosure can be used, for example, to maintain the original model capabilities while quickly iterating the functions of new requirements, and can realize reasoning for more tasks.
[0058] According to some embodiments, existing tasks may include, for example, license plate detection and license plate color classification, and newly added tasks may include, for example, vehicle body color recognition.
[0059] S202, acquiring first reasoning state information of each first network structure and second reasoning state information of each second network structure according to the input data set and the reasoning requirement;
[0060] The specific process is as described above and will not be repeated here.
[0061] According to some embodiments, the inference state information may also be referred to as network structure validity information, that is, information for determining whether a certain network structure is valid.
[0062] In some embodiments, the reasoning requirements may include, for example, detecting license plates, classifying license plate colors, and identifying vehicle body colors.
[0063] According to some embodiments, based on the input data set and the reasoning requirement, the first reasoning state information of each first reasoning network structure can be determined and the second reasoning state information of the second reasoning network structure can be determined. The first reasoning state information can, for example, indicate that each first reasoning network structure is in a reasoning state, and the second reasoning state information can, for example, indicate that the second reasoning network structure is in a reasoning state.
[0064] S203, obtaining a network structure subset in which the first reasoning state information of at least one first network structure meets the information requirement, and using each first network structure in the network structure subset to reason on the input data set to obtain at least one first reasoning result corresponding to the existing task;
[0065] The specific process is as described above and will not be repeated here.
[0066] According to some embodiments, a subset of network structures in which the first reasoning state information in at least one first network structure meets information requirements may be obtained, wherein the information requirement may be, for example, that the first reasoning state information indicates that the first reasoning network structure is in a reasoning state. That is, at least one first network structure used in this reasoning may be obtained.
[0067] In some embodiments, the network structure subset may include, for example, at least one first network structure, and the first inference state information of the at least one first network structure satisfies the information requirement.
[0068] In some instances, a network structure subset in which first reasoning state information in at least one first network structure meets information requirements can be obtained, and each first network structure in the network structure subset is used to reason about an input data set to obtain at least one first reasoning result corresponding to an existing task.
[0069] In some embodiments, the first inference result is an inference result corresponding to an existing task, wherein the number of the first inference result is at least one, for example, the number of the first network structures that are effective this time may be the same as, or may be greater than, the number of the first network structures that are effective this time. This disclosure embodiment does not limit this.
[0070] According to some embodiments, for example, the obtained network structure subset may include two first network structures, and the two network structures respectively detect the license plate and classify the license plate color. The two network structures may be used to infer the input data set to obtain the license plate detection result and the license plate color classification result.
[0071] S204, when the second reasoning state information indicates that the second network structure is reasoning about the input data set, determining to execute a network structure reasoning branch corresponding to the second network structure, and using the second network structure to reason about the input data set to obtain a second reasoning result corresponding to the newly added task;
[0072] In some embodiments, for example, the second inference result is an inference result corresponding to the newly added task. The second inference result does not specifically refer to a fixed result. For example, when the input data set changes or the second network structure changes, the second inference result may also change accordingly.
[0073] In some embodiments, the network structure reasoning branch is a branch for reasoning on an input data set. When the second reasoning state information indicates that the second network structure is reasoning on the input data set, it can be determined to execute the network structure reasoning branch corresponding to the second network structure, and the second network structure is used to reason on the input data set to obtain a second reasoning result corresponding to the newly added task.
[0074] For example, a newly added task may include vehicle body color recognition. When the second reasoning state information indicates that the second network structure can reason about the input data set, it is determined to execute the vehicle body color recognition branch corresponding to the second network structure, and the second network structure is used to reason about the input data set to obtain the vehicle body color recognition result corresponding to the newly added task.
[0075] In some embodiments, when the inference result of the first model is better than the historical inference result, the historical inference result can be deleted and the inference result of the first model can be stored.
[0076] S205 , when the inference state information indicates that the second network structure does not perform inference on the input data set, determine to execute a network structure failure branch corresponding to the second network structure.
[0077] In some embodiments, the network structure failure branch is a branch where the second network structure does not infer the input data set. When the inference state information indicates that the second network structure does not infer the input data set, it is determined to execute the network structure failure branch corresponding to the second network structure.
[0078] According to some embodiments, a training data set and a second model are obtained, wherein the second model includes at least one trained first network structure and an untrained second network structure, and the second network structure corresponds to the newly added task;
[0079] When it is determined that the second network structure is to be trained, parameters of at least one trained first network structure are kept unchanged, and the untrained second network structure is trained using the training data set to obtain a training result;
[0080] When the training results meet the result requirements, the first model is obtained, wherein the first model includes at least one trained first network structure and a trained second network structure. Therefore, the second network structure can be trained using the training data corresponding to the newly added task, without the need to train at least one first network structure, which can reduce the demand for training data, reduce the use of training resources, reduce the model iteration cycle, reduce the model training time, and improve the efficiency of model acquisition. It can also fully absorb the feature representation capabilities of existing tasks, accelerate the convergence speed of the model, and improve the reasoning effect of the model.
[0081] According to some embodiments, keeping the parameters of at least one trained first network structure unchanged, using the training data set to train the second network structure in the second model, and obtaining the training result includes:
[0082] Keeping the first network structure weight of at least one trained first network structure unchanged, and initializing the second network structure weight of the second network structure;
[0083] The second network structure in the second model is trained using a training data set and an error gradient function to obtain a third network structure weight of the second network structure, wherein the third network structure weight is used to indicate that the first model is obtained when the third network structure weight meets the weight requirement. Therefore, the weight of the second network structure can be trained using training data corresponding to the newly added task, without the need to train the weight of at least one first network structure, which can reduce the demand for training data, reduce the use of training resources, reduce the model iteration cycle, reduce the model training time, and improve the efficiency of model acquisition.
[0084] According to some embodiments, further comprising:
[0085] Obtaining association information between the newly added task and at least one existing task;
[0086] When the associated information meets the information requirements, the steps of obtaining the training data set and the second model are performed. Therefore, while keeping the original reasoning ability of the model unchanged, it is possible to determine whether to train the new task based on the association between the new task and the existing task, and reduce the resources required for training the new task when the new task is not related to the existing task, which can improve the efficiency of model acquisition, dynamically adjust the network structure based on the association, fully absorb the feature representation ability of the original task, accelerate the convergence speed of the model, and improve the effect of the model.
[0087] According to some embodiments, the association relationship may be, for example, an association degree, and the information requirement may be, for example, that the sum of at least one association degree is greater than a certain threshold, or that the number of association degrees greater than a certain threshold in at least one association degree is greater than a quantity threshold, which is not limited in the embodiments of the present disclosure.
[0088] According to some embodiments, FIG3(a) is a framework diagram of at least one existing task of an embodiment of the present disclosure. As shown in FIG3(a), at least one existing task may include a target detection task and an attribute 1 classification task. According to some embodiments, FIG3(b) is a framework diagram of at least one existing task and a newly added task of an embodiment of the present disclosure. As shown in FIG3(b), the newly added task is an attribute 2 classification task.
[0089] In some embodiments, FIG3(c) is a diagram of the network training structure after adding a task in the embodiment of the present disclosure, FIG3(d) is a diagram of the network reasoning structure after adding a task in the embodiment of the present disclosure, and FIG3(e) is a simplified diagram of the network reasoning structure after adding a task in the embodiment of the present disclosure. Figure 4The following is a schematic diagram of an example of each network structure of the embodiment of the present disclosure, wherein path is used to indicate a network structure reasoning branch, and droppath is used to indicate a network structure failure branch. Whether the path branch is effective can be determined, for example, by the reasoning requirement information. The dotted box of Block3 in Figure 3(d) is used to indicate that Block3 is not effective in this reasoning requirement, that is, Block3 does not reason on the input data set, that is, the actual reasoning process can be shown in Figure 3(e).
[0090] In some embodiments, for example, according to FIG. 3(b), FIG. 3(c) and Figure 4 Build a vehicle structured model for newly added body color recognition, where the license plate detection and license plate color classification parts use the trained network structure weights to initialize the second model, and the newly added body color recognition part structure is initialized by default.
[0091] According to some embodiments, a training data set can be input into a second model, and the error between the training output result of the second model and a preset label can be obtained. Based on the error, the network weights of the network structure of the license plate detection and license plate color classification parts can be kept unchanged, and the network weights of the vehicle body color recognition part can be updated by back-propagating the error gradient. When it is determined that the training information of the second model meets the model storage condition, the first model can be obtained. The training information may include, for example, the training output result or the number of training times. Among them, the model storage condition includes that the error between the training output result of the second model and the preset label is less than the preset error, or the number of training times reaches a threshold number of times, etc.
[0092] According to some embodiments, when the second reasoning state information indicates that the second network structure is reasoning about the input data set, it is determined to execute the network structure reasoning branch corresponding to the second network structure, and the second network structure is used to reason about the input data set to obtain the second reasoning result corresponding to the newly added task; when the reasoning state information indicates that the second network structure does not reason about the input data set, it is determined to execute the network structure failure branch corresponding to the second network structure. Therefore, it can be determined whether the network structure is reasoning about the input data set according to the reasoning requirement information, which can reduce the waste of reasoning resources and improve reasoning efficiency.
[0093] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0094] Please refer to FIG. 5( a ), which shows a first structural schematic diagram of a result reasoning device for implementing the result reasoning method of the embodiment of the present disclosure. The result reasoning device can be implemented as all or part of the device through software, hardware, or a combination of both. The result reasoning device 500 includes a set acquisition unit 501, an information acquisition unit 502, and a result reasoning unit 503, wherein:
[0095] A set acquisition unit 501 is used to acquire an input data set and a first model, where the first model includes at least one trained first network structure and a trained second network structure, where the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task;
[0096] An information acquisition unit 502 is used to acquire first reasoning state information of each first network structure and second reasoning state information of the second network structure according to an input data set and a reasoning requirement;
[0097] The result inference unit 503 is used to obtain at least one inference result output by the first model according to the input data set, the inference branch corresponding to the inference state information of the at least one trained first network structure and the second network structure.
[0098] According to some embodiments, FIG. 5( b ) is a second structural diagram of a result reasoning device for implementing the result reasoning method of the embodiment of the present disclosure, wherein the result reasoning device 500 further includes a model training unit 504 for:
[0099] Acquire a training data set and a second model, wherein the second model includes at least one trained first network structure and an untrained second network structure, and the second network structure corresponds to the newly added task;
[0100] When it is determined that the second network structure is to be trained, parameters of at least one trained first network structure are kept unchanged, and the untrained second network structure is trained using the training data set to obtain a training result;
[0101] When the training result meets the result requirement, a first model is obtained, wherein the first model includes at least one trained first network structure and a trained second network structure.
[0102] According to some embodiments, the model training unit 504 is used to keep the parameters of at least one trained first network structure unchanged, train the second network structure in the second model using the training data set, and obtain the training result, specifically for:
[0103] Keeping the first network structure weight of at least one trained first network structure unchanged, and initializing the second network structure weight of the second network structure;
[0104] The second network structure in the second model is trained using a training data set and an error gradient function to obtain a third network structure weight of the second network structure, wherein the third network structure weight is used to indicate that the first model is obtained when the third network structure weight meets the weight requirement.
[0105] According to some embodiments, the model training unit 504 is further configured to:
[0106] Obtaining association information between the newly added task and at least one existing task;
[0107] When the associated information meets the information requirements, the step of acquiring a training data set and a second model is performed.
[0108] According to some embodiments, the result inference unit 503 is used to obtain at least one inference result output by the first model according to the input data set, the inference branch corresponding to the inference state information of the at least one trained first network structure and the second network structure, and is specifically used to:
[0109] Obtaining a subset of network structures in which first reasoning state information in at least one first network structure meets information requirements, using each first network structure in the subset of network structures to reason on an input data set, and obtaining at least one first reasoning result corresponding to an existing task;
[0110] When the second reasoning state information indicates that the second network structure performs reasoning on the input data set, determine to execute the network structure reasoning branch corresponding to the second network structure, and use the second network structure to reason on the input data set to obtain a second reasoning result corresponding to the newly added task.
[0111] According to some embodiments, the result inference unit 503 is used to obtain at least one inference result output by the first model according to the input data set, the inference branch corresponding to the inference state information of the at least one trained first network structure and the second network structure, and is specifically used to:
[0112] Obtaining a subset of network structures in which first reasoning state information in at least one first network structure meets information requirements, using each first network structure in the subset of network structures to reason on an input data set, and obtaining at least one first reasoning result corresponding to an existing task;
[0113] When the inference state information indicates that the second network structure does not perform inference on the input data set, it is determined to execute a network structure failure branch corresponding to the second network structure.
[0114] It should be noted that the result reasoning device provided in the above embodiment only uses the division of the above functional modules as an example when executing the result reasoning method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the result reasoning device provided in the above embodiment and the result reasoning method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0115] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0116] In summary, the device provided by the embodiment of the present disclosure includes a set acquisition unit, which is used to acquire an input data set and a first model, wherein the first model includes at least one trained first network structure and a trained second network structure, wherein the first network structure is used to infer existing tasks, and the second network structure is used to infer newly added tasks; an information acquisition unit, which is used to acquire first inference state information of each first network structure and second inference state information of the second network structure according to the input data set and the inference requirements; and a result inference unit, which is used to acquire at least one inference result output by the first model according to the inference branch corresponding to the inference state information of the input data set, at least one trained first network structure and the second network structure. Therefore, under the premise that the original inference ability of the model remains unchanged, the network structure for inference can be determined according to the input data set, and whether the newly added task is inferred can be determined without affecting the inference results of the existing tasks, thereby reducing the drop of the existing indicators of the model, and dynamically adjusting the network structure to obtain the inference results corresponding to the input data set and the inference requirements, and there is no need to train a model for the newly added task separately, which can reduce the demand for data volume and the iterative maintenance cycle of the model, and can fully absorb the feature representation ability of the existing tasks, accelerate the convergence speed of the model, improve the effect of the model, and improve the inference efficiency and inference accuracy of the model.
[0117] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0118] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0119] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0120] like Figure 6 As shown, the electronic device includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0121] Multiple components in the electronic device are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0122] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the result reasoning method. For example, in some embodiments, the result reasoning method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 602 and / or a communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the result reasoning method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the result reasoning method in any other appropriate manner (e.g., by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or electronic device.
[0125] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data electronic device), or a computing system that includes middleware components (e.g., an application electronic device), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0128] A computer system may include a client and an electronic device. The client and the electronic device are generally remote from each other and usually interact through a communication network. The relationship between the client and the electronic device is generated by computer programs running on the corresponding computers and having a client-electronic device relationship with each other. The electronic device may be a cloud electronic device, also known as a cloud computing electronic device or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The electronic device may also be an electronic device of a distributed system, or an electronic device combined with a blockchain.
[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0130] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A result reasoning method, comprising: Obtaining an input data set and a first model, wherein the first model includes the at least one trained first network structure and a trained second network structure, wherein the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task; Acquire first reasoning state information of each first network structure and second reasoning state information of the second network structure according to the input data set and the reasoning requirement; At least one inference result output by the first model is obtained according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information.
2. The method according to claim 1, further comprising: Acquire a training data set and a second model, wherein the second model includes the at least one trained first network structure and an untrained second network structure, and the second network structure corresponds to the newly added task; In the case of determining to perform a training operation on the second network structure, keeping the parameters of the at least one trained first network structure unchanged, using the training data set to train the untrained second network structure, and obtaining a training result; When the training result meets the result requirement, the first model is acquired, wherein the first model includes the at least one trained first network structure and the at least one trained second network structure.
3. The method according to claim 2, wherein: The step of keeping the parameters of the at least one trained first network structure unchanged, training the second network structure in the second model using the training data set, and obtaining a training result includes: Keeping the first network structure weight of the at least one trained first network structure unchanged, and initializing the second network structure weight of the second network structure; The second network structure in the second model is trained using the training data set and the error gradient function to obtain a third network structure weight of the second network structure, wherein the third network structure weight is used to indicate that the first model is obtained when the third network structure weight meets the weight requirements.
4. The method according to claim 2 or 3, further comprising: Obtaining association information between the newly added task and each of the at least one existing task; In the case where the associated information meets the information requirements, the step of acquiring a training data set and a second model is performed.
5. The method according to claim 1, wherein: The acquiring at least one inference result output by the first model according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information comprises: Obtaining a network structure subset whose first reasoning state information in the at least one first network structure meets the information requirement, and using each first network structure in the network structure subset to reason on the input data set to obtain at least one first reasoning result corresponding to the existing task; When the second reasoning state information indicates that the second network structure performs reasoning on the input data set, determine to execute the network structure reasoning branch corresponding to the second network structure, and use the second network structure to perform reasoning on the input data set to obtain a second reasoning result corresponding to the new task.
6. The method according to claim 1, wherein: The acquiring at least one inference result output by the first model according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information comprises: Obtaining a network structure subset whose first reasoning state information in the at least one first network structure meets the information requirement, and using each first network structure in the network structure subset to reason on the input data set to obtain at least one first reasoning result corresponding to the existing task; When the inference state information indicates that the second network structure does not perform inference on the input data set, it is determined to execute a network structure failure branch corresponding to the second network structure.
7. A result reasoning device, comprising: A set acquisition unit, used to acquire an input data set and a first model, wherein the first model includes the at least one trained first network structure and a trained second network structure, wherein the first network structure is used to reason about an existing task, and the second network structure is used to reason about a newly added task; An information acquisition unit, configured to acquire first reasoning state information of each first network structure and second reasoning state information of the second network structure according to the input data set and the reasoning requirement; A result reasoning unit is used to obtain at least one reasoning result output by the first model according to the input data set, the first reasoning branch corresponding to the first reasoning state information, and the second reasoning branch corresponding to the second reasoning state information.
8. The apparatus according to claim 7, further comprising a model training unit, configured to: Get a training data set and a second model, where: The second model includes the at least one trained first network structure and an untrained second network structure, and the second network structure corresponds to the newly added task; In the case of determining to perform a training operation on the second network structure, keeping the parameters of the at least one trained first network structure unchanged, using the training data set to train the untrained second network structure, and obtaining a training result; When the training result meets the result requirement, the first model is acquired, wherein the first model includes the at least one trained first network structure and the at least one trained second network structure.
9. The device according to claim 8, wherein: The model training unit is used to keep the parameters of the at least one trained first network structure unchanged, use the training data set to train the second network structure in the second model, and when obtaining the training result, specifically to: Keeping the first network structure weight of the at least one trained first network structure unchanged, and initializing the second network structure weight of the second network structure; The second network structure in the second model is trained using the training data set and the error gradient function to obtain a third network structure weight of the second network structure, wherein the third network structure weight is used to indicate that the first model is obtained when the third network structure weight meets the weight requirements.
10. The device according to claim 8 or 9, wherein the model training unit is further used for: Obtaining association information between the newly added task and each of the at least one existing task; In the case where the associated information meets the information requirements, the step of acquiring a training data set and a second model is performed.
11. The device according to claim 8, wherein: The result inference unit is used to obtain at least one inference result output by the first model according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information, specifically for: Obtain a network structure subset in which the first reasoning state information of the at least one first network structure meets the information requirement, and use each first network structure in the network structure subset to reason on the input data set to obtain at least one first reasoning result corresponding to the existing task; When the second reasoning state information indicates that the second network structure performs reasoning on the input data set, determine to execute the network structure reasoning branch corresponding to the second network structure, and use the second network structure to perform reasoning on the input data set to obtain a second reasoning result corresponding to the new task.
12. The device according to claim 8, wherein: The result inference unit is used to obtain at least one inference result output by the first model according to the input data set, the first inference branch corresponding to the first inference state information, and the second inference branch corresponding to the second inference state information, specifically for: Obtain a network structure subset in which the first reasoning state information of the at least one first network structure meets the information requirement, and use each first network structure in the network structure subset to reason on the input data set to obtain at least one first reasoning result corresponding to the existing task; When the inference state information indicates that the second network structure does not perform inference on the input data set, it is determined to execute a network structure failure branch corresponding to the second network structure.
13. An electronic device, comprising: at least one processor; as well as A memory communicatively connected to the at least one processor; characterized in that The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.