Methods, apparatuses, devices, media, and products for processing data
By determining the central interval of the data set and mapping it to the target data interval, the problem of simplifying the deployment of deep learning models on mobile devices is solved, and effective deployment on mobile devices with limited computing resources is achieved.
Patent Information
- Application Number
- CN202210106014.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-01-28
AI Technical Summary
Existing technologies make it difficult to simplify the deployment of deep learning models to mobile devices, resulting in excessive computing resource requirements.
By acquiring the initial model data of the deep learning model, determining the data concentration interval based on the data distribution information, and mapping it to the preset target data interval, the target model data is obtained, and finally the deep learning model is deployed on the mobile device.
It simplifies the deployment of deep learning models on mobile devices, reduces computing resource requirements, and adapts to the computing power limitations of mobile devices.
Smart Images

Figure CN114492794B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically the field of deep learning technology. Background Technology
[0002] Currently, with the continuous development of deep learning technology, deep learning models are frequently trained to meet various needs.
[0003] In practice, it has been found that in order to meet the relevant usage requirements of mobile devices, it is necessary to simplify the deployment of deep learning models to mobile devices. Summary of the Invention
[0004] This disclosure provides a method, apparatus, device, medium, and product for processing data.
[0005] According to one aspect of this disclosure, a method for processing data is provided, comprising: acquiring initial model data of a deep learning model; determining a data central interval based on data distribution information of the initial model data; mapping the initial model data to a preset target data interval based on the data central interval to obtain target model data; and deploying a deep learning model on a mobile device based on the target model data.
[0006] According to another aspect of this disclosure, an apparatus for processing data is provided, comprising: a data acquisition unit configured to acquire initial model data of a deep learning model; an interval determination unit configured to determine a data central interval based on data distribution information of the initial model data; a data mapping unit configured to map the initial model data to a preset target data interval based on the data central interval to obtain target model data; and a model deployment unit configured to deploy a deep learning model on a mobile device based on the target model data.
[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement any of the above methods for processing data.
[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform any of the above methods for processing data.
[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the above methods for processing data.
[0010] According to the technology disclosed herein, a method for processing data is provided that enables simplified deployment of deep learning models.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0013] Figure 1 This is an exemplary system architecture diagram to which one embodiment of this disclosure can be applied;
[0014] Figure 2 This is a flowchart of one embodiment of a method for processing data according to the present disclosure;
[0015] Figure 3 This is a schematic diagram of an application scenario of the method for processing data according to this disclosure;
[0016] Figure 4 This is a flowchart of another embodiment of the method for processing data according to the present disclosure;
[0017] Figure 5 This is a schematic diagram of a structure of an embodiment of a data processing apparatus according to the present disclosure;
[0018] Figure 6 This is a block diagram of an electronic device used to implement the data processing method of the embodiments of this disclosure. Detailed Implementation
[0019] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] like Figure 1As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0022] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can send model deployment requests to server 105 via network 104, so that server 105 can respond to the model deployment requests and simplify the deployment of deep learning models on terminal devices 101, 102, and 103.
[0023] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to mobile phones, computers, tablets, etc. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software programs or software modules (e.g., to provide distributed services) or as a single software program or software module. No specific limitations are made here.
[0024] Server 105 can be a server that provides various services. For example, server 105 can receive model deployment requests sent by terminal devices 101, 102, and 103 through network 104, determine the initial model data of the deep learning model to be deployed, and determine the data set interval of the initial model data. Based on the data set interval, the initial model data is mapped to a preset target data interval to obtain the target model data. The target model data is then returned to terminal devices 101, 102, and 103 through network 104 so that terminal devices 101, 102, and 103 can deploy deep learning models on mobile devices.
[0025] It should be noted that server 105 can be either hardware or software. When server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0026] It should be noted that the data processing method provided in this disclosure is usually executed by server 105, and the data processing device is usually located in server 105. This disclosure does not limit this.
[0027] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0028] Continue to refer to Figure 2 The diagram illustrates a flow 200 of an embodiment of a method for processing data according to the present disclosure. The method for processing data according to this embodiment includes the following steps:
[0029] Step 201: Obtain the initial model data for the deep learning model.
[0030] In this embodiment, the execution subject (such as...) Figure 1 The server 105 can retrieve the deep learning model that needs to be simplified for deployment on the mobile device from local storage or other pre-connected electronic devices, and obtain the various model parameters in the deep learning model to obtain initial model data. Furthermore, the number of initial model data is usually multiple.
[0031] The initial model data is typically in floating-point format, such as a 32-bit float. This initial model data is usually high-precision; to simplify the deployment of deep learning models on mobile devices, this high-precision data needs to be converted to low-precision data.
[0032] Step 202: Determine the data center interval based on the data distribution information of the initial model data.
[0033] In this embodiment, the data distribution information can be used to describe the data distribution of the initial model data, and the data central interval can be the numerical range of the central distribution of the initial model data.
[0034] After obtaining the initial model data, the executing entity can directly derive the data distribution information based on it. Alternatively, the executing entity can first perform preprocessing operations on the initial model data to obtain preprocessed data, and then derive the data distribution information based on the preprocessed data.
[0035] In some optional implementations of this embodiment, determining the data centrality interval based on the data distribution information of the initial model data may include: determining a fitting curve corresponding to the initial model data; in response to determining that the goodness of fit between the fitting curve and the normal distribution curve is lower than a threshold, performing data offset processing on the initial model data to obtain a data offset fitting curve, wherein the goodness of fit between the data offset fitting curve and the normal distribution curve is greater than or equal to the threshold. The numerical range of the data centrally distributed in the data offset fitting curve is determined as the aforementioned data centrality interval. Optionally, the numerical range of the data containing a preset proportion of data in the data offset fitting curve can be used as the aforementioned data centrality interval. Using this optional implementation, data fitting can be performed on the initial model data, and based on data offset, the curve corresponding to the data fitting can be continuously adjusted until the curve shape approximates a normal distribution curve. Selecting the interval of the data centrally distributed in the curve at this time as the data centrality interval can improve the rationality of determining the data centrality interval.
[0036] Step 203: Based on the data central interval, map the initial model data to the preset target data interval to obtain the target model data.
[0037] In this embodiment, the preset target data range can be the numerical range of the model data that needs to be obtained, and can be preset. The target model data is data that is within the preset target data range and corresponds to the initial model data.
[0038] Furthermore, the executing entity can determine the central range of the data based on the data type of the target model data to be mapped. For example, if you want to map float type data to int type data, the target data range can be set to [-127, 127].
[0039] Furthermore, after obtaining the data central interval, the executing entity can establish a data mapping relationship within the interval based on the data central interval and the target data interval. Additionally, the executing entity can identify data located within the data central interval from the initial model data and map this data to the preset target data interval based on the aforementioned data mapping relationship. Furthermore, the executing entity can identify data from the initial model data that is greater than the maximum value of the data central interval and map this data to the maximum value of the preset target data interval. Finally, the executing entity can identify data from the initial model data that is less than the minimum value of the data central interval and map this data to the minimum value of the preset target data interval.
[0040] Step 204: Deploy the deep learning model on the mobile device based on the target model data.
[0041] In this embodiment, the target model data obtained by the executing entity can be low-precision data corresponding to the initial model data. Therefore, based on the target model data, a deep learning model can be deployed on a mobile device with weak computing power, thus meeting the mobile device's need for using the deep learning model.
[0042] The specific steps for deploying the model based on the model data can be implemented using existing technologies, and will not be elaborated here.
[0043] See also Figure 3 This illustration shows a schematic diagram of an application scenario of the method for processing data according to this disclosure. Figure 3 In the application scenario, the executing entity can obtain a deep learning model 301 that needs to be simplified and deployed on a mobile device. Then, the executing entity can extract float32 (occupying 32 bits of float) data 302 from the deep learning model 301, and based on the aforementioned data processing method, determine the data central interval based on the data distribution of the float32 data 302. Based on the data central interval and a preset target data interval, the float32 data 302 is mapped to int8 (occupying 8 bits of int) data 303. The deep learning model is then deployed on the mobile device based on the int8 data 303, resulting in the simplified deployment model 304.
[0044] The data processing method provided in the above embodiments of this disclosure can determine the data central interval based on data distribution information, obtain the mapped target model data corresponding to the initial model data based on the data central interval and the preset target data interval, and deploy the deep learning model based on the target model data, thereby realizing the simplified deployment of the deep learning model.
[0045] See also Figure 4 This illustrates a flow 400 of another embodiment of a method for processing data according to the present disclosure. (See diagram 400.) Figure 4 As shown, the method for processing data in this embodiment may include the following steps:
[0046] Step 401: Obtain the initial model data for the deep learning model.
[0047] In this embodiment, for a detailed description of step 401, please refer to the detailed description of step 201, which will not be repeated here.
[0048] Step 402: Based on the pre-trained residual network, determine the target Gaussian distribution parameters corresponding to the initial model data.
[0049] In this embodiment, the pre-trained residual network can be used to determine the central interval of the dataset corresponding to the initial model data. The residual network here is preferably ResNet50 (a residual network structure), but it can also be other residual network structures used in existing technologies or future developments; this embodiment does not limit this.
[0050] The execution entity can input initial model data into a pre-trained residual network, causing the convolutional layers in the pre-trained residual network to convolve the initial model data, resulting in convolutional data. Then, the pre-trained residual network can determine the target Gaussian distribution parameters for the convolutional data. These target Gaussian distribution parameters are used to correct the bias in the convolutional data, ensuring that the curve corresponding to the bias-corrected, convolutional data approximately fits a Gaussian distribution.
[0051] In some optional implementations of this embodiment, the target Gaussian distribution parameters include the Gaussian distribution mean and Gaussian distribution variance. Alternatively, the target Gaussian distribution parameters may also include other parameters from which the Gaussian distribution mean and Gaussian distribution variance can be calculated.
[0052] Step 403: Determine the central interval of the data based on the target Gaussian distribution parameters.
[0053] In this embodiment, the executing entity can determine the fitted Gaussian distribution curve corresponding to the initial model data based on the target Gaussian distribution parameters, and select the numerical interval in the dataset as the aforementioned dataset interval based on the data distribution information in the fitted Gaussian distribution curve.
[0054] In some alternative implementations of this embodiment, the pre-trained residual network is trained based on the following steps: obtaining a sample model data set; inputting each sample model data in the sample model data set into the convolutional network in batches to obtain convolutional sample data in each batch; determining the Gaussian distribution parameters corresponding to each batch of convolutional sample data; determining the target Gaussian distribution parameters based on the Gaussian distribution parameters of each batch; and determining the pre-trained residual network based on the target Gaussian distribution parameters.
[0055] In this implementation, the executing entity can utilize a large amount of sample model data to obtain a sample model dataset. Based on the individual sample model data in the sample model dataset, the residual network to be trained is trained to obtain a relatively accurate pre-trained residual network. Here, the data type of the sample model data can be a high-precision data type.
[0056] Specifically, the execution entity can input the sample model data in batches into the convolutional network of the residual network to be trained, obtaining convolutional sample data for each batch. Then, the execution entity can calculate the mean and variance of each batch of convolutional sample data, mapping the batch of convolutional sample data onto a normal distribution. Based on adjustments to the coefficient and bias values, the mapped curve is corrected to make the corrected distribution curve more closely resemble a Gaussian distribution. The execution entity can obtain the final coefficient and final bias values of each batch of convolutional sample data after correction, using them as the Gaussian distribution parameters corresponding to that batch of convolutional sample data. The final coefficient value is the mean of the Gaussian distribution corresponding to the corrected batch of convolutional sample data, and the final bias value is the variance of the Gaussian distribution corresponding to the corrected batch of convolutional sample data. Subsequently, based on the Gaussian distribution parameters of each batch of convolutional sample data, the execution entity can obtain the target Gaussian distribution parameters using methods such as moving weighted average, direct weighted average, and direct average.
[0057] In some alternative implementations of this embodiment, determining the Gaussian distribution parameters corresponding to each batch of convolutional sample data includes: for each batch of convolutional sample data, determining the convolutional data mean and convolutional data variance of the convolutional sample data of that batch; generating Gaussian distribution mean and Gaussian distribution variance corresponding to the convolutional data mean and convolutional data variance of that batch.
[0058] In this implementation, for each batch of convolutional sample data, the average value of the convolutional sample data in that batch can be calculated to obtain the convolutional data mean. Additionally, the variance of the convolutional sample data in that batch can also be calculated to obtain the convolutional data variance. Subsequently, the executing entity can also use the residual network to be trained to generate Gaussian distributed mean and Gaussian distributed variance corresponding to the convolutional data mean and variance of that batch.
[0059] Specifically, for the first batch of convolutional sample data, the generated Gaussian distribution mean and variance can be pre-defined values. For example, the Gaussian distribution mean might be 1 and the variance 0 corresponding to the first batch of convolutional sample data. Subsequently, for subsequent batches of convolutional sample data, the residual network to be trained continuously adjusts the generated Gaussian distribution mean and variance corresponding to each batch of convolutional sample data based on the training objective. The training objective is that the fit between the curve fitted by the convolutional sample data and the Gaussian distribution curve is higher than a threshold.
[0060] In some alternative implementations of this embodiment, determining the target Gaussian distribution parameter based on the Gaussian distribution parameters of each batch includes: performing a weighted summation of the Gaussian distribution parameters of each batch based on preset weight information to obtain the target Gaussian distribution parameter.
[0061] In this implementation, the executing entity can pre-set the weights for calculating the target Gaussian distribution parameters using a moving weighted average method. Preferably, the preset weight information can be 0.9 and 0.1. For the first batch of Gaussian distribution parameters, the target Gaussian distribution parameters are the Gaussian distribution parameters of the first batch. For the Gaussian distribution parameters of the second batch and subsequent batches, the target Gaussian distribution parameters are the sum of the Gaussian distribution parameters of the previous batch multiplied by the first weight in the preset weight information (e.g., 0.9) and the Gaussian distribution parameters of the current batch multiplied by the second weight in the preset weight information (e.g., 0.1). Finally, the target Gaussian distribution parameters of the last batch are determined as the final target Gaussian distribution parameters.
[0062] Specifically, for each batch of convolutional sample data, the mean and variance of the convolutional data can be calculated based on the following formulas:
[0063]
[0064]
[0065] Where, μ B This refers to the mean of the convolutional data, m refers to the number of data points in each batch of convolutional samples, and x... i This refers to the value of the i-th convolutional sample data in each batch. This refers to the variance of the convolutional data.
[0066] Furthermore, after obtaining the mean and variance of the convolutional data, each batch of convolutional sample data can be mapped to a normal distribution based on the following formula:
[0067]
[0068] in, This refers to the batch of convolutional sample data x i The value mapped to the normal distribution, ∈ refers to a very small number. To avoid the case where the denominator is 0, no specific value is restricted.
[0069] Furthermore, after mapping each batch of convolutional sample data to a normal distribution, the Gaussian distribution mean and variance corresponding to the convolutional data mean and variance of that batch can be used to map the batch of convolutional sample data to a Gaussian distribution. Specifically, the normal distribution of each batch of convolutional sample data can be corrected based on the following formula to obtain the Gaussian distribution:
[0070]
[0071] Among them, y iThis refers to the batch of convolutional sample data x i Values mapped to a normal distribution The offset-corrected values are γ, which refers to the mean of the Gaussian distribution corresponding to the batch of convolutional sample data, and β, which refers to the variance of the Gaussian distribution corresponding to the batch of convolutional sample data.
[0072] Furthermore, the aforementioned γ and β corresponding to each batch of convolutional sample data are the Gaussian distribution parameters for that batch. By performing a moving weighted summation on γ and β based on each batch of convolutional sample data, the final γ and β can be obtained. The final γ and β are then used as the parameters of the trained residual network, serving as the basis for determining the central interval of the dataset for the initial model data.
[0073] For example, assuming three batches of convolutional sample data were trained, and the preset weights are 0.9 and 0.1, the final determination of γ can be achieved as follows:
[0074] γ=γ0
[0075] γ = 0.9 × γ + 0.1 × γ1
[0076] γ = 0.9 × γ + 0.1 × γ²
[0077] Here, γ0 refers to the mean of the Gaussian distribution corresponding to the first batch of convolutional sample data, γ1 refers to the mean of the Gaussian distribution corresponding to the second batch of convolutional sample data, and γ2 refers to the mean of the Gaussian distribution corresponding to the third batch of convolutional sample data. As the residual network is trained using different batches of convolutional sample data, the final γ is continuously updated and iterated.
[0078] Furthermore, the executing entity can define the data center interval as [γ-3×β, γ+3×β], which is the numerical interval in which 99.7% of the data is distributed.
[0079] Step 404: For each data point in the initial model data, in response to determining that the data point is located in the data central interval, the data point is mapped to the target data interval based on the mapping relationship between the data central interval and the target data interval to obtain the target model data.
[0080] In this embodiment, for each data point in the initial model data, the execution entity can determine whether the data point is located in the central data interval. If it is, the data point is mapped to the target data interval based on the mapping relationship between the central data interval and the target data interval to obtain the target model data.
[0081] Step 405: For each data point in the initial model data, in response to determining that the data point is not located in the central interval of the data set and that the data point is greater than the maximum value of the central interval of the data set, the data point is mapped to the maximum value of the target data interval to obtain the target model data.
[0082] In this embodiment, for each data point in the initial model data, if the data point is not located in the central data interval and is greater than the maximum value of the central data interval (e.g., greater than γ+3×β), then the data point is mapped to the maximum value of the target data interval. Specifically, if the target data interval is [-127, 127], then the data point is mapped to 127.
[0083] Step 406: For each data point in the initial model data, in response to determining that the data point is not located in the central interval of the data set and that the data point is less than the minimum value of the central interval of the data set, the data point is mapped to the minimum value of the target data interval to obtain the target model data.
[0084] In this embodiment, for each data point in the initial model data, if the data point is not located in the central data interval and is less than the minimum value of the central data interval (e.g., less than γ-3×β), then the data point is mapped to the minimum value of the target data interval. Specifically, if the target data interval is [-127, 127], then the data point is mapped to -127.
[0085] Step 407: Deploy the deep learning model on the mobile device based on the target model data.
[0086] In this embodiment, for a detailed description of step 407, please refer to the detailed description of step 204, which will not be repeated here.
[0087] The data processing method provided in the above embodiments of this disclosure can also use residual network training to obtain target Gaussian distribution parameters, namely, Gaussian distribution mean and Gaussian distribution variance. Based on the target Gaussian distribution parameters, the initial model data can be mapped and fitted to an approximate Gaussian distribution curve, and the data central interval can be determined based on the fitted approximate Gaussian distribution curve. The model quantization is realized based on the data central interval and the target data interval, thereby improving the accuracy of model quantization.
[0088] Further reference Figure 5 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a device for processing data, which is similar to... Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to electronic devices such as servers.
[0089] like Figure 5 As shown, the data processing device 500 in this embodiment includes: a data acquisition unit 501, an interval determination unit 502, a data mapping unit 503, and a model deployment unit 504.
[0090] The data acquisition unit 501 is configured to acquire the initial model data of the deep learning model.
[0091] The interval determination unit 502 is configured to determine the data concentration interval based on the data distribution information of the initial model data.
[0092] The data mapping unit 503 is configured to map the initial model data to a preset target data interval based on the data central interval, thereby obtaining the target model data.
[0093] Model deployment unit 504 is configured to deploy a deep learning model on a mobile device based on the target model data.
[0094] In some optional implementations of this embodiment, the data mapping unit 503 is further configured to: for each data in the initial model data, in response to determining that the data is located in the data central interval, map the data to the target data interval based on the mapping relationship between the data central interval and the target data interval to obtain the target model data.
[0095] In some optional implementations of this embodiment, the data mapping unit 503 is further configured to: for each data in the initial model data, in response to determining that the data is not located in the data central interval and that the data is greater than the maximum value of the data central interval, map the data to the maximum value of the target data interval to obtain the target model data.
[0096] In some optional implementations of this embodiment, the data mapping unit 503 is further configured to: for each data in the initial model data, in response to determining that the data is not located in the data central interval and that the data is less than the minimum value of the data central interval, map the data to the minimum value of the target data interval to obtain the target model data.
[0097] In some optional implementations of this embodiment, the interval determination unit 502 is further configured to: determine the target Gaussian distribution parameters corresponding to the initial model data based on the pre-trained residual network; and determine the data center interval based on the target Gaussian distribution parameters.
[0098] In some optional implementations of this embodiment, the target Gaussian distribution parameters include the Gaussian distribution mean and the Gaussian distribution variance.
[0099] In some optional implementations of this embodiment, the method further includes: a model training unit configured to acquire a sample model data set; input each sample model data in the sample model data set into the convolutional network in batches to obtain convolutional sample data in each batch; determine the Gaussian distribution parameters corresponding to each batch of convolutional sample data; determine the target Gaussian distribution parameters based on the Gaussian distribution parameters of each batch; and determine the pre-trained residual network based on the target Gaussian distribution parameters.
[0100] In some optional implementations of this embodiment, the model training unit is further configured to: for each batch of convolutional sample data, determine the convolutional data mean and convolutional data variance of the batch of convolutional sample data; and generate Gaussian distribution mean and Gaussian distribution variance corresponding to the convolutional data mean and convolutional data variance of the batch.
[0101] In some optional implementations of this embodiment, the model training unit is further configured to: perform a weighted summation of the Gaussian distribution parameters of each batch based on preset weight information to obtain the target Gaussian distribution parameters.
[0102] It should be understood that units 501 to 504 described in the device 500 for processing data are respectively related to the reference. Figure 2 The steps in the method described above correspond to those in the previous section. Therefore, the operations and features described above for the method of processing data also apply to the apparatus 500 and the units contained therein, and will not be repeated here.
[0103] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0104] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0105] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0106] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0107] The computing unit 601 can be a variety of general-purpose and / or special-purpose 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 special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as methods for processing data. For example, in some embodiments, the methods for processing data may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or 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 methods for processing data described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform methods for processing data by any other suitable means (e.g., by means of firmware).
[0108] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0109] Various embodiments 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-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0110] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0111] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0112] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0113] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0114] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0115] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0116] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for processing data, comprising: receiving, by a server, a model deployment request sent by a terminal device through a network, and determining initial model data of a deep learning model that needs to be deployed; determining target Gaussian distribution parameters corresponding to the initial model data based on a pre-trained residual network; determining a data set interval based on the target Gaussian distribution parameters; mapping the initial model data to a preset target data interval based on the data set interval to obtain target model data, so as to meet simplified deployment requirements of the mobile terminal and enable the mobile terminal to deploy the deep learning model; returning the target model data to the terminal device through the network to enable the terminal device to deploy the deep learning model on the mobile terminal; wherein the method further comprises: when training the residual network, performing weighted summation on Gaussian distribution parameters of each batch based on preset weight information to obtain the target Gaussian distribution parameters; wherein the pre-trained residual network is trained based on the following steps: inputting each sample model data in a sample model data set into a convolution network in batches to obtain convolution sample data of each batch; determining Gaussian distribution parameters corresponding to the convolution sample data of each batch; determining the target Gaussian distribution parameters based on the Gaussian distribution parameters of each batch, wherein the target Gaussian distribution parameters are used to correct the bias of the data after convolution, so that the data after bias correction and convolution approximately fits a Gaussian distribution; determining the pre-trained residual network based on the target Gaussian distribution parameters.
2. The method of claim 1, wherein, The mapping of the initial model data to the preset target data interval based on the data set interval to obtain the target model data comprises: for each data in the initial model data, in response to determining that the data is located in the data set interval, mapping the data to the target data interval based on a mapping relationship between the data set interval and the target data interval to obtain the target model data.
3. The method of claim 1, wherein, The mapping of the initial model data to the preset target data interval based on the data set interval to obtain the target model data comprises: for each data in the initial model data, in response to determining that the data is not located in the data set interval and the data is greater than the maximum value of the data set interval, mapping the data to the maximum value of the target data interval to obtain the target model data.
4. The method of claim 1, wherein, The mapping of the initial model data to the preset target data interval based on the data set interval to obtain the target model data comprises: for each data in the initial model data, in response to determining that the data is not located in the data set interval and the data is less than the minimum value of the data set interval, mapping the data to the minimum value of the target data interval to obtain the target model data.
5. The method of claim 1, wherein, The target Gaussian distribution parameters comprise a Gaussian distribution mean and a Gaussian distribution variance.
6. The method of claim 1, wherein, The determination of the Gaussian distribution parameters corresponding to the convolution sample data of each batch comprises: For each batch of convolution sample data, determine the convolution data mean and the convolution data variance of the batch of convolution sample data; Generate the Gaussian distribution mean and the Gaussian distribution variance corresponding to the convolution data mean and the convolution data variance of the batch.
7. The method of claim 1, wherein, The determination of the target Gaussian distribution parameter based on the Gaussian distribution parameters of the batches comprises: Based on the preset weight information, the Gaussian distribution parameters of the batches are weighted and summed to obtain the target Gaussian distribution parameter.
8. An apparatus for processing data, comprising: A data acquisition unit configured to receive a model deployment request sent by a terminal device through a network, and determine initial model data of a deep learning model that needs to be deployed; A parameter determination unit configured to determine a target Gaussian distribution parameter corresponding to the initial model data based on a pre-trained residual network; An interval determination unit configured to determine an interval in the data set based on the target Gaussian distribution parameter; A data mapping unit configured to map the initial model data to a preset target data interval based on the interval in the data set, to obtain target model data, so as to meet the simplified deployment requirement of the mobile terminal and enable the mobile terminal to deploy the deep learning model; A model deployment unit configured to return the target model data to the terminal device through the network, so that the terminal device deploys the deep learning model on the mobile terminal; wherein further comprising: The parameter determination unit is configured to, when training the residual network, weight and sum the Gaussian distribution parameters of each batch based on preset weight information to obtain the target Gaussian distribution parameter; wherein further comprising: A model training unit configured to input each sample model data in a sample model data set into a convolution network in batches to obtain convolution sample data of each batch, determine the Gaussian distribution parameter corresponding to the convolution sample data of each batch, determine the target Gaussian distribution parameter based on the Gaussian distribution parameters of the batches, wherein the target Gaussian distribution parameter is used for bias correction of the data after convolution, so that the data after convolution after bias correction corresponds to a curve that is approximately fitted as a Gaussian distribution, and determine the pre-trained residual network based on the target Gaussian distribution parameter.
9. The apparatus of claim 8, wherein, The data mapping unit is further configured to: For each data in the initial model data, in response to determining that the data is located in the interval in the data set, map the data to the target data interval based on the mapping relationship between the interval in the data set and the target data interval to obtain the target model data.
10. The apparatus of claim 8, wherein, The data mapping unit is further configured to: For each data in the initial model data, in response to determining that the data is not located in the interval in the data set and the data is greater than the maximum value of the interval in the data set, map the data to the maximum value of the target data interval to obtain the target model data.
11. The apparatus of claim 8, wherein, The data mapping unit is further configured to: For each data in the initial model data, in response to determining that the data is not located in the data set interval and the data is less than the minimum value of the data set interval, the data is mapped to the minimum value of the target data interval, to obtain the target model data.
12. The apparatus of claim 8, wherein, The target Gaussian distribution parameter includes a Gaussian distribution mean and a Gaussian distribution variance.
13. The apparatus of claim 8, wherein, The model training unit is further configured to: For each batch of convolution sample data, determine a convolution data mean and a convolution data variance of the batch of convolution sample data; Generate a Gaussian distribution mean and a Gaussian distribution variance corresponding to the convolution data mean and the convolution data variance of the batch.
14. The apparatus of claim 8, wherein, The model training unit is further configured to: Based on preset weight information, the Gaussian distribution parameters of the batches are weighted and summed to obtain the target Gaussian distribution parameter.
15. An electronic device comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.