Model usage and device
By combining the correlation operators in the deep learning model, the model structure is optimized according to the conditions such as usage frequency and complexity, the singularity problem of optimization of deep learning model in the existing technology is solved, and faster model inference speed is achieved and shorter reasoning time.
Patent Information
- Application Number
- CN202010611595.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-06-29
AI Technical Summary
The existing method of optimizing the inference speed of deep learning models is relatively single, and it is impossible to effectively improve the inference efficiency of the model.
By obtaining the usage information of multiple operators in the deep learning model, combining the correlation operators according to the usage frequency, number and complexity, generating the combined deep learning model, reducing the number of operators in the model, and optimizing the model's The reasoning process.
This reduces the number of times the execution results of operators are stored and read in memory during model inference, and improves the model's inference speed and computing performance.
Smart Images

Figure CN111753999B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer communication technology, and in particular to a model use method and device. Background Art
[0002] After the deep learning model is constructed, the deep learning model is trained and the trained deep learning model is deployed in the terminal.
[0003] Currently, the inference speed of deep learning models is optimized by configuring high-performance hardware resources for terminals. The existing methods for optimizing the inference speed of models are relatively simple. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a model using method and device.
[0005] According to a first aspect of an embodiment of the present disclosure, a model use method is provided, which is applied to a terminal, wherein the terminal has a built-in deep learning model, and the method includes:
[0006] Obtaining usage information of multiple operators in the deep learning model during a period of running time, wherein the multiple operators include usage-associated operators;
[0007] After determining that the usage information of the usage-associated operators meets the preset information condition, combining the usage-associated operators according to the usage order of the usage-associated operators to obtain a combined first deep learning model;
[0008] In response to satisfying a usage condition of the first deep learning model, the first deep learning model is used.
[0009] Optionally, the determining that the usage information of the operator associated with the usage satisfies a preset information condition includes at least one of the following:
[0010] Determining that the usage frequency of the operator associated with the usage is greater than or equal to a preset frequency;
[0011] It is determined that the usage-associated operator is used a number of times greater than or equal to a preset number of times.
[0012] Optionally, the complexity of the use-associated operators is different; after determining that the use information of the use-associated operators meets a preset information condition, combining the use-associated operators according to the use order of the use-associated operators includes:
[0013] After determining that the usage information of the operators with associated usage and different complexities meets the preset information condition, the operators with associated usage and different complexities are combined according to the usage order of the operators with associated usage and different complexities.
[0014] Optionally, the use-associated operators include two operators with different complexities, and the operator with higher complexity is used before the operator with lower complexity; after determining that the use information of the use-associated operators with different complexities meets the preset information condition, combining the use-associated operators with different complexities according to the use order of the use-associated operators with different complexities, comprises:
[0015] After determining that the usage information of the two operators with different complexities meets the preset information condition, the two operators with different complexities are combined in the order of the operator with higher complexity before the operator with lower complexity.
[0016] Optionally, one of the multiple operators is associated with the other multiple operators; and the method further includes:
[0017] In a case where the one operator and a part of the other multiple operators have been combined, in response to usage information of the one operator and another part of the other multiple operators satisfying the preset information condition, combining the one operator in the target deep learning model and another part of the other multiple operators to obtain a combined second deep learning model, wherein the target deep learning model is a model obtained based on the deep learning model, in which the one operator and an operator used thereafter are not combined;
[0018] In response to satisfying a usage condition of the second deep learning model, the second deep learning model is used.
[0019] Optionally, the target deep learning model includes the deep learning model without combination.
[0020] According to a second aspect of an embodiment of the present disclosure, a model using device is provided, which is applied to a terminal, wherein the terminal has a built-in deep learning model, and the device includes:
[0021] An acquisition module is configured to acquire usage information of a plurality of operators in the deep learning model during a period of running time, wherein the plurality of operators include usage-associated operators;
[0022] A first combining module is configured to, after determining that the usage information of the usage-associated operators meets a preset information condition, combine the usage-associated operators according to the usage order of the usage-associated operators to obtain a combined first deep learning model;
[0023] The first using module is configured to use the first deep learning model in response to satisfying a use condition of the first deep learning model.
[0024] Optionally, the device further comprises:
[0025] The determination module is configured to determine that the usage frequency of the usage-associated operator is greater than or equal to a preset frequency, and / or determine that the number of times the usage-associated operator is used is greater than or equal to a preset number of times.
[0026] Optionally, the complexity of the operators associated with said use is different;
[0027] The first combination module is configured to combine the operators with associated usage and different complexities according to the usage order of the operators with associated usage and different complexities after determining that the usage information of the operators with associated usage and different complexities meets the preset information condition.
[0028] Optionally, the associated operator includes two operators of different complexity, and the operator with higher complexity is used before the operator with lower complexity;
[0029] The first combination module is configured to combine the two operators with different complexities in the order of the operator with higher complexity before the operator with lower complexity after determining that the usage information of the two operators with different complexities meets the preset information condition.
[0030] Optionally, one of the multiple operators is associated with the other multiple operators; and the device further includes:
[0031] A second combining module is configured to, in a case where the one operator and a part of the other multiple operators have been combined, in response to usage information of the one operator and another part of the other multiple operators satisfying the preset information condition, combine the one operator in the target deep learning model with another part of the other multiple operators to obtain a combined second deep learning model, wherein the target deep learning model is a model obtained based on the deep learning model in which the one operator and an operator used thereafter are not combined;
[0032] The second using module is configured to use the second deep learning model in response to satisfying the use condition of the second deep learning model.
[0033] Optionally, the target deep learning model includes the deep learning model without combination.
[0034] According to a third aspect of an embodiment of the present disclosure, there is provided a non-temporary computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0035] According to a fourth aspect of an embodiment of the present disclosure, a terminal is provided, comprising: an internal bus, and a memory, a processor, and an external interface connected via the internal bus; wherein:
[0036] The external interface is used to obtain data;
[0037] The memory is used to store machine-readable instructions corresponding to model usage;
[0038] The processor is configured to read the machine-readable instructions on the memory and execute the machine-executable instructions to implement the following operations:
[0039] Obtaining usage information of multiple operators in the deep learning model during a period of running time, wherein the multiple operators include usage-associated operators;
[0040] After determining that the usage information of the usage-associated operators meets the preset information condition, combining the usage-associated operators according to the usage order of the usage-associated operators to obtain a combined first deep learning model;
[0041] In response to satisfying a usage condition of the first deep learning model, the first deep learning model is used.
[0042] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0043] In an embodiment of the present disclosure, the terminal combines the usage-related operators among the multiple operators according to the usage information of the multiple operators in the deep learning model during a period of running time, so as to reduce the number of operators in the deep learning model and obtain the combined first deep learning model. Compared with the deep learning model before the combination, the number of operators in the combined deep learning model is smaller, thus reducing the number of times the execution results of the operators are placed in the memory and read from the memory for use by other operators during the model reasoning process, thereby speeding up the reasoning speed of the model and shortening the reasoning time of the model. Therefore, an embodiment of the present disclosure provides a new method for optimizing the reasoning speed of a model.
[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart of a method for using a model according to an exemplary embodiment;
[0046] Figure 2 is a block diagram of a model using device according to an exemplary embodiment;
[0047] Figure 3The diagram is a schematic diagram of the structure of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0049] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0050] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0051] Figure 1 is a flow chart of a model using method according to an exemplary embodiment. Figure 1 The method shown is applied to a terminal, and the terminal has a built-in deep learning model. The method includes:
[0052] In step 101, usage information of multiple operators in a deep learning model during a period of running time is obtained, and the multiple operators include usage-associated operators.
[0053] The terminal may be installed with an application program, and the application program may have a deep learning model built in. When the application program is running and using the deep learning model, the terminal may combine operators in the deep learning model and optimize the deep learning model using the method provided in the embodiment of the present disclosure.
[0054] Alternatively, the deep learning model can be directly built into the terminal, for example, the deep learning model is built into the system software of the terminal. When using the deep learning model, the terminal can adopt the method provided in the embodiment of the present disclosure to combine the operators in the deep learning model and optimize the deep learning model.
[0055] Operators with usage associations may include multiple operators with input-output relationships, for example, the execution result (i.e., output) of one operator is used as the input of another operator when it is executed. For example, the execution result of operator A is used as the input of operator B when it is executed, and the execution result of operator B is used as the input of operator C when it is executed. In this case, it can be said that operator A and operator B have a usage association, operator B and operator C have a usage association, or operator A, operator B and operator C have a usage association.
[0056] The multiple operators described in this step may include all operators in the deep learning model, or may include some operators in the deep learning model. The terminal can obtain usage information of some preset operators in the deep learning model.
[0057] The multiple operators include operators associated with use, and the usage information of the multiple operators within a period of time may include usage information of operators associated with use within a period of time. The usage information of operators associated with use within a period of time may include at least one of the following: usage frequency of operators associated with use, and number of times the operators associated with use are used. The usage frequency of operators associated with use may be understood as the frequency with which operators associated with use are used successively, and the number of times the operators associated with use may be understood as the number of times the operators associated with use are used successively.
[0058] The length of a running time can be set as needed, and the present disclosure does not limit this.
[0059] In step 102, after determining that usage information of the associated operators meets a preset information condition, the associated operators are combined in a usage order of the associated operators to obtain a combined first deep learning model.
[0060] The terminal combines the associated operators according to the order in which the associated operators are used, and the number of operators after the combination is less than the number of operators before the combination.
[0061] The combined operators are used as independent operators. The purpose of the combination is to directly use the calculation result of one operator for the next calculation instead of writing the calculation result of one operator into the memory.
[0062] For example, there are a, b, and c for addition calculation. One way is: after calculating a+b, the calculation result is written to the memory. In the next step, the calculation result of a+b is obtained from the memory, the calculation result of a+b is added to c, and the result is written to the memory. Another way is: a, b, and c are combined to calculate a+b+c, and the result is written to the memory. Comparing the two ways, it can be seen that by combining operators, the operations of writing data to the memory and reading data from the memory can be reduced.
[0063] In one embodiment, there are multiple ways to combine operators. For example, when the method provided by the embodiment of the present disclosure is executed once, all operators that are associated are combined into one operator, such as combining the above-mentioned operator A, operator B, and operator C into one operator. For another example, each time the method provided by the embodiment of the present disclosure is executed, only some operators that are associated are combined, and after executing the method multiple times, all operators that are associated are combined, such as combining operator A and operator B when the method is executed once, and combining the combined operator A and operator B with operator C when the method is executed next time.
[0064] Exemplarily, the deep learning model has the function of speech recognition. After a piece of audio is input into the deep learning model, the operator unit in the deep learning model is repeatedly executed. When the operator unit is executed once, two operators with input-output relationship in the operator unit are combined. After the operator unit is executed multiple times, the combination of multiple operators in the operator unit is completed.
[0065] In one embodiment, determining that usage information of an associated operator satisfies a preset information condition may include at least one of the following: determining that a usage frequency of the associated operator is greater than or equal to a preset frequency; determining that a usage count of the associated operator is greater than or equal to a preset count.
[0066] In one embodiment, the complexity of the associated operators is different. After determining that the usage information of the associated operators with different complexities meets the preset information condition, the terminal can combine the associated operators with different complexities according to the usage order of the associated operators with different complexities.
[0067] In this embodiment, the complexity of the operator is used as the basis for combining operators, and operators with different complexities that are associated with each other are combined.
[0068] In one embodiment, the associated operators include two operators with different complexities, and the operator with higher complexity is used before the operator with lower complexity. After determining that the usage information of the two operators with different complexities meets the preset information conditions, the terminal combines the two operators with different complexities in the order of the operator with higher complexity before the operator with lower complexity.
[0069] In this embodiment, the operators in the deep learning model are combined in a high-complexity operator-low-complexity operator combination manner.
[0070] For example, batch normalization is a regularization operator, sigmoid is an activation function in a neural network, and bias add is a bias term. Compared with the convolution operator and the fully connected operator, the complexity of the above three operators is lower. During the use of the model, the convolution operator and batchnormalization can be combined, the convolution operator and sigmoid can be combined, the fully connected operator and the bias add operator can be combined, and so on.
[0071] In step 103 , in response to satisfying a use condition of the first deep learning model, the first deep learning model is used.
[0072] Usually, there are a large number of operators in a deep learning model. A large number of operators can form multiple operator execution paths. Each operator execution path involves a certain number of operators, and certain functions are achieved by executing the operators involved in the operator execution path.
[0073] The terminal can combine the operators involved in the operator execution path in the deep learning model to obtain a combined first deep learning model. When it is necessary to execute multiple operators involved in the operator execution path, the terminal executes the combined operators involved in the operator execution path in the first deep learning model.
[0074] Since the number of operators after combination is less than the number of operators before combination, the number of times the execution results of operators are placed in memory and read from memory for use by other operators during the model reasoning process is reduced, thereby speeding up the reasoning speed of the model, shortening the reasoning time of the model, and improving the computing performance of the model.
[0075] The model reasoning process described in the embodiments of the present disclosure may be understood as a model usage process or a model application process.
[0076] In one embodiment, the terminal obtains usage information of multiple operators in a deep learning model during a period of running time, one of the multiple operators is associated with other multiple operators, and the output of one operator is used as the input of multiple operators.
[0077] When an operator and a part of other multiple operators have been combined, if the terminal detects that the usage information of an operator and another part of the other multiple operators meets the preset information conditions, an operator in the target deep learning model and another part of the other multiple operators are combined to obtain a combined second deep learning model, and in response to meeting the usage conditions of the second deep learning model, the application is controlled to use the second deep learning model.
[0078] The target deep learning model is a model obtained based on the deep learning model without combination, in which the above-mentioned one operator and the operators used thereafter are not combined.
[0079] There are multiple target deep learning models. For example, the target deep learning model is a deep learning model without combination, that is, an initial deep learning module. During the process of optimizing the model, the terminal saves the deep learning model without combination.
[0080] For another example, the target deep learning model is a model in which some operators in the deep learning model have been combined, but the above-mentioned operator and the operators used subsequently have not been combined.
[0081] By executing the method provided in this embodiment, a combined deep learning model corresponding to different operator execution paths is obtained.
[0082] In an embodiment of the present disclosure, the terminal combines the usage-related operators among the multiple operators according to the usage information of the multiple operators in the deep learning model during a period of running time, so as to reduce the number of operators in the deep learning model and obtain the combined first deep learning model. Compared with the deep learning model before the combination, the number of operators in the combined deep learning model is smaller, thus reducing the number of times the execution results of the operators are placed in the memory and read from the memory for use by other operators during the model reasoning process, thereby speeding up the reasoning speed of the model and shortening the reasoning time of the model. Therefore, an embodiment of the present disclosure provides a new method for optimizing the reasoning speed of a model.
[0083] For the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.
[0084] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0085] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding terminal embodiment.
[0086] Figure 2 is a block diagram of a model using device according to an exemplary embodiment. Figure 2 The model using device shown is applied to a terminal, and the terminal has a built-in deep learning model. The device includes: an acquisition module 21, a first combination module 22 and a first use module 23; wherein,
[0087] The acquisition module 21 is configured to acquire usage information of multiple operators in the deep learning model during a period of running time, wherein the multiple operators include usage-associated operators;
[0088] The first combination module 22 is configured to combine the use-associated operators according to the use order of the use-associated operators after determining that the use information of the use-associated operators meets the preset information condition, so as to obtain a combined first deep learning model;
[0089] The first using module 23 is configured to use the first deep learning model in response to satisfying the use condition of the first deep learning model.
[0090] In one embodiment, Figure 2 Based on the model using device shown, the device may further include: a determination module;
[0091] The determination module is configured to determine that a usage frequency of the usage-associated operator is greater than or equal to a preset frequency, and / or determine that a usage count of the usage-associated operator is greater than or equal to a preset count.
[0092] In one embodiment, Figure 2 Based on the model usage device shown, the complexity of the operators associated with the usage varies;
[0093] The first combining module 22 may be configured to combine the operators with associated usage and different complexities according to the usage order of the operators with associated usage and different complexities after determining that usage information of the operators with associated usage and different complexities meets the preset information condition.
[0094] In one embodiment, the use-associated operator includes two operators of different complexity, and the operator with higher complexity is used before the operator with lower complexity;
[0095] The first combining module 22 may be configured to combine the two operators with different complexities in the order of the operator with higher complexity before the operator with lower complexity after determining that the usage information of the two operators with different complexities meets the preset information condition.
[0096] In one embodiment, Figure 2 Based on the model using device shown, one of the multiple operators is associated with the other multiple operators; the device may also include: a second combining module and a second using module;
[0097] The second combination module is configured to, in a case where the one operator and a part of the other multiple operators have been combined, in response to usage information of the one operator and another part of the other multiple operators satisfying the preset information condition, combine the one operator in the target deep learning model with another part of the other multiple operators to obtain a combined second deep learning model, wherein the target deep learning model is a model obtained based on the deep learning model, in which the one operator and an operator used thereafter are not combined;
[0098] The second using module is configured to use the second deep learning model in response to satisfying a use condition of the second deep learning model.
[0099] In one embodiment, the target deep learning model includes the deep learning model without combination.
[0100] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.
[0101] Figure 3 is a schematic diagram of a terminal structure according to an exemplary embodiment, the terminal may include: an internal bus 310, and a memory 320, a processor 330 and an external interface 340 connected through the internal bus 310; wherein,
[0102] External interface 340, used to obtain data;
[0103] Memory 320, for storing machine-readable instructions corresponding to model usage;
[0104] The processor 330 is configured to read the machine-readable instructions on the memory 320 and execute the machine-executable instructions to implement the following operations:
[0105] Obtaining usage information of multiple operators in the deep learning model during a period of running time, wherein the multiple operators include usage-associated operators;
[0106] After determining that the usage information of the usage-associated operators meets the preset information condition, combining the usage-associated operators according to the usage order of the usage-associated operators to obtain a combined first deep learning model;
[0107] In response to satisfying a usage condition of the first deep learning model, the first deep learning model is used.
[0108] The embodiment of the present disclosure also provides a non-temporary computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above-mentioned model use method are implemented.
[0109] In the disclosed embodiments, the computer-readable storage medium may be in various forms. For example, in different examples, the machine-readable storage medium may be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of storage disk (such as a CD, DVD, etc.), or similar storage medium, or a combination thereof. In particular, the computer-readable medium may also be paper or other suitable medium capable of printing programs. Using these media, these programs may be acquired electrically (e.g., optically scanned), compiled, interpreted, and processed in a suitable manner, and then stored in a computer medium.
[0110] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0111] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for using a model, characterized in that: Applied to a terminal, the terminal has a built-in deep learning model, the deep learning model has a speech recognition function, and the method includes: Obtaining usage information of multiple operators in the deep learning model during a period of running time, wherein the multiple operators include usage-associated operators; After determining that the usage information of the usage-associated operators meets the preset information conditions, the usage-associated operators are combined according to the usage order of the usage-associated operators to obtain a combined first deep learning model; the combined operators are used as independent operators, and the calculation results of the combined operators are written into the memory of the terminal; In response to satisfying a use condition of the first deep learning model, using the first deep learning model; Obtaining usage information of multiple operators in the deep learning model during a period of running time; one of the multiple operators is associated with other multiple operators; In a case where the one operator and a part of the other multiple operators have been combined, in response to usage information of the one operator and another part of the other multiple operators satisfying the preset information condition, combining the one operator in the target deep learning model and another part of the other multiple operators to obtain a combined second deep learning model, wherein the target deep learning model is a model obtained based on the deep learning model, in which the one operator and an operator used thereafter are not combined; In response to satisfying a usage condition of the second deep learning model, the second deep learning model is used.
2. The method according to claim 1, characterized in that The determining that the usage information of the operator associated with the usage satisfies a preset information condition includes at least one of the following: Determining that the usage frequency of the operator associated with the usage is greater than or equal to a preset frequency; It is determined that the usage-associated operator is used a number of times greater than or equal to a preset number of times.
3. The method according to claim 1, characterized in that The complexity of the use-associated operators is different; after determining that the use information of the use-associated operators meets the preset information condition, combining the use-associated operators according to the use order of the use-associated operators, including: After determining that the usage information of the operators with associated usage and different complexities meets the preset information condition, the operators with associated usage and different complexities are combined according to the usage order of the operators with associated usage and different complexities.
4. The method according to claim 3, characterized in that The use-associated operators include two operators with different complexities, and the operator with higher complexity is used before the operator with lower complexity; after determining that the use information of the use-associated operators with different complexities meets the preset information condition, combining the use-associated operators with different complexities according to the use order of the use-associated operators with different complexities, including: After determining that the usage information of the two operators with different complexities meets the preset information condition, the two operators with different complexities are combined in the order of the operator with higher complexity before the operator with lower complexity.
5. A model using device, characterized in that: Applied to a terminal, the terminal has a built-in deep learning model, the deep learning model has a speech recognition function, and the device includes: An acquisition module is configured to acquire usage information of a plurality of operators in the deep learning model during a period of running time, wherein the plurality of operators include usage-associated operators; A first combination module is configured to, after determining that the usage information of the usage-associated operators meets a preset information condition, combine the usage-associated operators according to the usage order of the usage-associated operators to obtain a combined first deep learning model; the combined operators are used as independent operators, and the calculation results of the combined operators are written into the memory of the terminal; A first using module, configured to use the first deep learning model in response to satisfying a use condition of the first deep learning model; Obtaining usage information of multiple operators in the deep learning model during a period of running time; one of the multiple operators is associated with other multiple operators; A second combining module is configured to, in a case where the one operator and a part of the other multiple operators have been combined, in response to usage information of the one operator and another part of the other multiple operators satisfying the preset information condition, combine the one operator in the target deep learning model with another part of the other multiple operators to obtain a combined second deep learning model, wherein the target deep learning model is a model obtained based on the deep learning model in which the one operator and an operator used thereafter are not combined; The second using module is configured to use the second deep learning model in response to satisfying the use condition of the second deep learning model.
6. The device according to claim 5, characterized in that The device also includes: The determination module is configured to determine that the usage frequency of the usage-associated operator is greater than or equal to a preset frequency, and / or determine that the number of times the usage-associated operator is used is greater than or equal to a preset number of times.
7. The device according to claim 5, characterized in that The complexity of the operators associated with said use is different; The first combination module is configured to combine the operators with associated usage and different complexities according to the usage order of the operators with associated usage and different complexities after determining that the usage information of the operators with associated usage and different complexities meets the preset information condition.
8. The device according to claim 7, characterized in that The associated operators include two operators of different complexity, and the operator with higher complexity is used before the operator with lower complexity; The first combination module is configured to combine the two operators with different complexities in the order of the operator with higher complexity before the operator with lower complexity after determining that the usage information of the two operators with different complexities meets the preset information condition.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
10. A terminal, characterized in that: It includes: an internal bus, and a memory, a processor and an external interface connected through the internal bus; wherein, The external interface is used to obtain data; The memory is used to store machine-readable instructions corresponding to model usage; The processor is configured to read the machine-readable instructions on the memory and execute the machine-executable instructions to implement the following operations: Obtaining usage information of multiple operators in a deep learning model during a period of running time, wherein the multiple operators include operators associated with usage; the deep learning model has a speech recognition function; After determining that the usage information of the usage-associated operators meets the preset information conditions, the usage-associated operators are combined according to the usage order of the usage-associated operators to obtain a combined first deep learning model; the combined operators are used as independent operators, and the calculation results of the combined operators are written into the memory of the terminal; In response to satisfying a use condition of the first deep learning model, using the first deep learning model; Obtaining usage information of multiple operators in the deep learning model during a period of running time; one of the multiple operators is associated with other multiple operators; In a case where the one operator and a part of the other multiple operators have been combined, in response to usage information of the one operator and another part of the other multiple operators satisfying the preset information condition, combining the one operator in the target deep learning model and another part of the other multiple operators to obtain a combined second deep learning model, wherein the target deep learning model is a model obtained based on the deep learning model, in which the one operator and an operator used thereafter are not combined; In response to satisfying a usage condition of the second deep learning model, the second deep learning model is used.
Citation Information
Patent Citations
A structure search method and system of convolution neural network based on evolutionary algorithm
CN109299142A
Data processing method and device, electronic device and readable storage medium
CN109754073A
