CN114492794A - Method, apparatus, device, medium and product for processing data - Google Patents

Method, apparatus, device, medium and product for processing data Download PDF

Info

Publication number
CN114492794A
CN114492794A CN202210106014.6A CN202210106014A CN114492794A CN 114492794 A CN114492794 A CN 114492794A CN 202210106014 A CN202210106014 A CN 202210106014A CN 114492794 A CN114492794 A CN 114492794A
Authority
CN
China
Prior art keywords
data
target
interval
gaussian distribution
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210106014.6A
Other languages
Chinese (zh)
Inventor
戴兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210106014.6A priority Critical patent/CN114492794A/en
Publication of CN114492794A publication Critical patent/CN114492794A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a method, apparatus, device, medium, and product for processing data, relating to the field of computer technology, in particular to the field of deep learning technology. The specific implementation scheme is as follows: acquiring initial model data of a deep learning model; determining a data set 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 set interval to obtain target model data; and deploying a deep learning model at the mobile terminal based on the target model data. The implementation mode can realize simplified deployment of the deep learning model.

Description

Method, apparatus, device, medium and product for processing data
Technical Field
The disclosure relates to the technical field of computers, in particular to the technical field of deep learning.
Background
At present, with the continuous development of deep learning technology, a deep learning model is often trained to realize various requirements.
In practice, it is found that in order to meet the relevant use requirements of the mobile terminal, the deep learning model needs to be simply deployed to the mobile terminal.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, medium, and article of manufacture for processing data.
According to an aspect of the present disclosure, there is provided a method for processing data, including: acquiring initial model data of a deep learning model; determining a data set 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 set interval to obtain target model data; and deploying a deep learning model at the mobile terminal based on the target model data.
According to another aspect of the present disclosure, there is provided an apparatus for processing data, including: a data acquisition unit configured to acquire initial model data of a deep learning model; an interval determination unit configured to determine an interval in the data set based on data distribution information of the initial model data; the data mapping unit is configured to map the initial model data to a preset target data interval based on the data set interval to obtain target model data; and the model deployment unit is configured to deploy the deep learning model at the mobile terminal based on the target model data.
According to another aspect of the present disclosure, there is provided an electronic device including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement a method for processing data as any one of the above.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method for processing data as any one of the above.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements a method for processing data as any one of the above.
According to the technology of the present disclosure, a method for processing data is provided, which can realize simplified deployment of deep learning models.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for processing data according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for processing data according to the present disclosure;
FIG. 4 is a flow diagram of another embodiment of a method for processing data according to the present disclosure;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for processing data according to the present disclosure;
FIG. 6 is a block diagram of an electronic device for implementing a method for processing data of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the present disclosure, the embodiments and the features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may send model deployment requests to the server 105 over the network 104 to enable the server 105 to deploy deep learning model simplifications on the terminal devices 101, 102, 103 in response to the model deployment requests.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, a mobile phone, a computer, a tablet, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, for example, the server 105 may receive a model deployment request sent by the terminal devices 101, 102, 103 through the network 104, determine initial model data of a deep learning model that needs to be deployed, determine a data set interval of the initial model data, map the initial model data to a preset target data interval based on the data set interval, obtain target model data, and return the target model data to the terminal devices 101, 102, 103 through the network 104, so that the terminal devices 101, 102, 103 deploy the deep learning model at a mobile end.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that, the method for processing data provided by the embodiment of the present disclosure is generally performed by the server 105, and the apparatus for processing data is generally disposed in the server 105, which is not limited by the embodiment of the present disclosure.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for processing data in accordance with the present disclosure is shown. The method for processing data of the embodiment comprises the following steps:
step 201, obtaining initial model data of the deep learning model.
In this embodiment, the executing entity (for example, the server 105 in fig. 1) may obtain, from other electronic devices that are locally stored or have connections established in advance, a deep learning model that needs to be simplified and deployed at the mobile end, and obtain each model parameter in the deep learning model to obtain initial model data. Also, the number of initial model data is generally plural.
Wherein the initial model data is typically floating point type data, such as float type occupying 32 bits. It is understood that the initial model data herein is generally high-precision data, and in order to simplify the deployment of the deep learning model on the mobile end, it is necessary to convert the high-precision data into low-precision data.
Step 202, determining a data set interval based on the data distribution information of the initial model data.
In this embodiment, the data distribution information may be used to describe a data distribution condition of the initial model data, and the data concentration interval may be a numerical interval distributed in the initial model data set.
After obtaining the initial model data, the execution subject may obtain data distribution information directly based on the initial model data. Or, the execution main body may execute a preprocessing operation on the initial model data to obtain preprocessed data, and then obtain data distribution information based on the preprocessed data.
In some optional implementations of this embodiment, determining the interval in the data set based on the data distribution information of the initial model data may include: determining a fitted curve corresponding to the initial model data; and in response to the fact that the fitting degree between the fitting curve and the normal distribution curve is lower than a threshold value, carrying out data migration processing on the initial model data to obtain the fitting curve after the data migration processing, wherein the fitting degree between the fitting curve after the data migration processing and the normal distribution curve is larger than or equal to the threshold value. And determining the numerical value interval distributed in the data set in the fitting curve after the data migration processing as the data set interval. Optionally, the fitting curve after the data migration processing may include a numerical interval of preset proportion data as the data set interval. By adopting the optional implementation mode, data fitting can be carried out on initial model data, and the corresponding curve after the data fitting is continuously adjusted on the basis of data migration until the curve form is approximate to a normal distribution curve, the interval of data centralized distribution in the curve at the moment is selected as the data centralized interval, and the determination rationality of the data centralized interval can be improved.
And 203, mapping the initial model data to a preset target data interval based on the data set interval to obtain target model data.
In this embodiment, the preset target data interval may be a numerical range of the model data that needs to be obtained, and may be preset. The target model data is data which is in a preset target data interval and has a corresponding relation with the initial model data.
The execution main body can also determine the interval in the data set based on the data type of the target model data needing to be mapped. For example, if data of float type is to be mapped to data of int type, the target data interval at this time may be set to [ -127, 127 ].
After the execution main body obtains the data set section, the execution main body can establish a data mapping relation in the section based on the data set section and the target data section. And the execution main body can determine the data in the interval in the data set from the initial model data and map the data in the interval in the data set to a preset target data interval based on the data mapping relation in the interval. And the execution body can determine data which is larger than the maximum value of the interval in the data set from the initial model data and map the data which is larger than the maximum value to the maximum value of a preset target data interval. And the execution body can determine data smaller than the minimum value of the interval in the data set from the initial model data and map the data smaller than the minimum value to the minimum value of the preset target data interval.
And step 204, deploying a deep learning model at the mobile terminal based on the target model data.
In this embodiment, the target model data obtained by the executing agent may be low-precision data corresponding to the initial model data, and therefore, based on the target model data, a deep learning model can be deployed at a mobile terminal with weak computing power, so that the use requirement of the mobile terminal for the deep learning model is met.
For the specific steps of deploying the model based on the model data, a related implementation method in the prior art may be adopted, which is not described herein again.
With continued reference to fig. 3, a schematic diagram of one application scenario of a method for processing data according to the present disclosure is shown. In the application scenario of fig. 3, the executing agent may acquire a deep learning model 301 that needs to be deployed on the mobile side for simplification. Then, the execution subject may extract data 302 of float32 (float occupying 32 bits) type in the deep learning model 301, determine a data set interval based on the data distribution of data 302 of float32 type based on the above method for processing data, map data 302 of float32 type to data 303 of int8 (int occupying 8 bits) type based on the data set interval and a preset target data interval, deploy a deep learning model at the mobile end based on data 303 of int8 type, and obtain a simplified deployed model 304.
The method for processing data provided by the above embodiment of the present disclosure can determine the data concentration interval based on the data distribution information, obtain the mapped target model data corresponding to the initial model data based on the data concentration interval and the preset target data interval, and perform deployment of the deep learning model based on the target model data, thereby implementing simplified deployment of the deep learning model.
With continued reference to FIG. 4, a flow 400 of another embodiment of a method for processing data in accordance with the present disclosure is shown. As shown in fig. 4, the method for processing data of the present embodiment may include the steps of:
step 401, obtaining initial model data of the deep learning model.
In this embodiment, please refer to the detailed description of step 201 for the detailed description of step 401, which is not repeated herein.
And step 402, determining a target Gaussian distribution parameter corresponding to the initial model data based on the residual error network trained in advance.
In this embodiment, the residual network trained in advance may be used to determine the interval in the data set corresponding to the initial model data. The residual network is preferably ResNet50 (a residual network structure), and may also be a residual network structure adopted in other prior arts or in future development, which is not limited in this embodiment.
The execution main body may input the initial model data into the residual error network trained in advance, so that the convolution layer in the residual error network trained in advance convolves the initial model data to obtain the convolved data. And then, the residual error network trained in advance can determine corresponding target Gaussian distribution parameters for the convolved data. And the target Gaussian distribution parameters are used for carrying out deviation correction on the convolved data so as to approximately fit a curve corresponding to the convolved data after deviation correction into Gaussian distribution.
In some optional implementations of the present embodiment, the target gaussian distribution parameters include a gaussian distribution mean and a gaussian distribution variance. Alternatively, the target gaussian distribution parameters may include other parameters that can be calculated to obtain the mean and variance of the gaussian distribution.
And step 403, determining an interval in the data set based on the target Gaussian distribution parameters.
In this embodiment, the execution subject may determine a fitted gaussian distribution curve corresponding to the initial model data based on the target gaussian distribution parameter, and select a numerical value interval in the data set as the data set interval based on data distribution information in the fitted gaussian distribution curve.
In other optional implementations of this embodiment, the residual network trained in advance is obtained by training based on the following steps: acquiring a sample model data set; inputting each sample model data in the sample model data set into a convolution network in batches to obtain convolution sample data of each batch; determining Gaussian distribution parameters corresponding to convolution sample data of each batch; determining a target Gaussian distribution parameter based on the Gaussian distribution parameters of each batch; and determining a residual error network which is trained in advance based on the target Gaussian distribution parameters.
In this implementation, the execution subject may combine a large amount of sample model data to obtain a sample model data set. And training the residual error network to be trained based on each sample model data in the sample model data set to obtain a relatively accurate residual error network which is trained in advance. The data type of the sample model data may be a data type with higher precision.
Specifically, the execution subject may input each sample model data into a convolution network in the residual error network to be trained in batches, so as to obtain convolution sample data corresponding to each batch. Then, the execution subject may calculate the mean and the variance of each batch of convolution sample data, map the batch of convolution sample data to a normal distribution, and correct the mapped curve based on adjusting the coefficient value and the deviation value, so that the corrected distribution curve fits a gaussian distribution better. The execution agent may obtain a final coefficient value and a final offset value for each batch of convolution sample data to be corrected, and use the final coefficient value and the final offset value as the gaussian distribution parameters corresponding to the batch of convolution sample data. And the final coefficient value is the mean value of the Gaussian distribution corresponding to the batch of corrected convolution sample data, and the final deviation value is the variance of the Gaussian distribution corresponding to the batch of corrected convolution sample data. Then, the execution subject may obtain the target gaussian distribution parameter based on the gaussian distribution parameter of each batch of convolution sample data, and based on a moving weighted average, a direct averaging, and the like.
In other optional implementation manners of this embodiment, determining a gaussian distribution parameter corresponding to each batch of convolution sample data includes: for each batch of convolution sample data, determining the convolution data mean and the convolution data variance of the batch of convolution sample data; a Gaussian distribution mean and a Gaussian distribution variance are generated corresponding to the convolved data mean and the convolved data variance of the batch.
In this implementation, for each batch of convolution sample data, the average value of the batch of convolution sample data may be obtained to obtain the convolution data average value. And the variance of the convolution sample data of the batch can be obtained to obtain the variance of the convolution data. Then, the execution subject may further generate a gaussian distribution mean and a gaussian distribution variance corresponding to the convolution data mean and the convolution data variance of the batch by using a residual network to be trained.
Specifically, the generated gaussian distribution mean and gaussian distribution variance may be predetermined specified values for the first batch of convolution sample data, for example, the generated gaussian distribution mean corresponding to the first batch of convolution sample data is 1 and the generated gaussian distribution variance is 0. Then, for the convolution sample data of the next batch, the residual error network to be trained continuously adjusts the generated gaussian distribution mean and gaussian distribution variance corresponding to the convolution sample data of each batch based on the training target. And the fitting degree of the curve fitted by the convolution sample data and the Gaussian distribution curve is higher than a threshold value as the training target.
In other optional implementations of this embodiment, the determining the target gaussian distribution parameter based on the gaussian distribution parameters of each batch includes: and based on preset weight information, carrying out weighted summation on the Gaussian distribution parameters of each batch to obtain the target Gaussian distribution parameters.
In this implementation, the execution subject may preset a weight for calculating the target gaussian distribution parameter by using a moving weighted average. Preferably, the preset weight information may be 0.9 and 0.1. For the gaussian distribution parameter of the first batch, the target gaussian distribution parameter is the gaussian distribution parameter of the first batch. For the gaussian distribution parameters after the second batch, the target gaussian distribution parameter is the sum of the gaussian distribution parameter of the previous batch multiplied by a first weight (e.g. 0.9) in the preset weight information and the gaussian distribution parameter of the current batch multiplied by a second weight (e.g. 0.1) in the preset weight information. And finally determining the target Gaussian distribution parameter of the last batch as the final target Gaussian distribution parameter.
Specifically, for each batch of convolution sample data, the convolution data mean and the convolution data variance of the batch of convolution sample data may be calculated based on the following formulas:
Figure BDA0003493953140000081
Figure BDA0003493953140000082
wherein, muBRefers to the mean of the convolution data, m refers to the data number of convolution sample data per batch, xiRefers to the value of the ith convolution sample data for each batch,
Figure BDA0003493953140000085
refers to the variance of the convolved data.
And after obtaining the convolution data mean and the convolution data variance, mapping the convolution sample data of each batch to a normal distribution based on the following formula:
Figure BDA0003493953140000083
wherein the content of the first and second substances,
Figure BDA0003493953140000084
is the convolution sample data x of the batchiThe value after being mapped to the normal distribution, e, is a number with a very small value, and in order to avoid the condition that the denominator is 0, specific values are not limited.
And after mapping each batch of convolution sample data to a normal distribution, mapping the batch of convolution sample data to a gaussian distribution using a gaussian distribution mean and a gaussian distribution variance corresponding to the batch of convolution data mean and convolution data variance. Specifically, the normal distribution of the convolution sample data of each batch can be corrected based on the following formula to obtain gaussian distribution:
Figure BDA0003493953140000091
wherein, yiRefers to the convolution sample data x for that batchiValue mapped to normal distribution
Figure BDA0003493953140000092
The offset-corrected value γ is a gaussian distribution mean value corresponding to the batch of convolution sample data, and β is a gaussian distribution variance corresponding to the batch of convolution sample data.
And the gamma and the beta corresponding to each batch of convolution sample data are Gaussian distribution parameters of the batch, the final gamma and beta can be obtained by performing mobile weighted summation based on the gamma and the beta of each batch of convolution sample data, and the final gamma and beta are determined as parameters of a residual error network after training and are used as a basis for determining a data set interval for the initial model data.
For example, assuming that three batches of convolution sample data are trained and the preset weight information is 0.9 and 0.1, the final γ determination process may be as follows:
γ=γ0
γ=0.9×γ+0.1×γ1
γ=0.9×γ+0.1×γ2
wherein, γ0Means the mean value of the Gaussian distribution, gamma, corresponding to the first batch of convolution sample data1Means the mean value of Gaussian distribution, gamma, corresponding to the second batch of convolution sample data2Means the mean gaussian distribution corresponding to the third batch of convolution sample data. And in the process that convolution sample data of different batches are input into the residual error network to be trained for training, the final gamma is continuously updated and iterated.
And, the execution subject may determine the interval in the dataset as [ γ -3 × β, γ +3 × β ], that is, a numerical interval in which 99.7% of the data is distributed.
Step 404, 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 the mapping relationship between the data set interval and the target data interval to obtain the target model data.
In this embodiment, for each data in the initial model data, the executing entity may determine whether the data is located in the data set interval, and if so, map the data to the target data interval based on the mapping relationship between the data set interval and the target data interval to obtain the target model data.
Step 405, 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 target model data.
In this embodiment, for each data in the initial model data, if the data is not located in the data set interval and the data is greater than the maximum value of the data set interval, such as greater than γ +3 × β, the data is mapped to the maximum value of the target data interval. Wherein if the target data interval is [ -127, 127], the data is mapped to 127.
Step 406, 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 smaller 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.
In this embodiment, for each data in the initial model data, if the data is not located in the data set interval and the data is smaller than the minimum value of the data set interval, such as smaller than γ -3 × β, the data is mapped to the minimum value of the target data interval. Wherein if the target data interval is [ -127, 127], the data is mapped to-127.
Step 407, deploying a deep learning model at the mobile terminal based on the target model data.
In this embodiment, please refer to the detailed description of step 204 for the detailed description of step 407, which is not repeated herein.
The method for processing data provided by the above embodiments of the present disclosure may further use residual error network training to obtain target gaussian distribution parameters, that is, a gaussian distribution mean and a gaussian distribution variance, based on the target gaussian distribution parameters, the initial model data may be mapped and fitted to a curve that is approximately gaussian distributed, and based on the curve that is approximately gaussian distributed and obtained by fitting, a data set interval is determined, and based on the data set interval and the target data interval, quantization of the model is achieved, so that accuracy of model quantization is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for processing data, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to electronic devices such as servers.
As shown in fig. 5, the apparatus 500 for processing data of the present embodiment includes: a data acquisition unit 501, an interval determination unit 502, a data mapping unit 503, and a model deployment unit 504.
A data acquisition unit 501 configured to acquire initial model data of the deep learning model.
An interval determination unit 502 configured to determine an interval in the data set based on data distribution information of the initial model data.
The data mapping unit 503 is configured to map the initial model data to a preset target data interval based on the data set interval, so as to obtain target model data.
A model deployment unit 504 configured to deploy the deep learning model at the mobile terminal based on the target model data.
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 set interval, mapping the data to the target data interval based on the mapping relation between the data set interval and the target data interval to obtain target model data.
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 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 target model data.
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 set interval and the data is smaller than the minimum value of the data set interval, mapping the data to the minimum value of the target data interval to obtain target model data.
In some optional implementations of this embodiment, the interval determining unit 502 is further configured to: determining a target Gaussian distribution parameter corresponding to initial model data based on a residual error network trained in advance; and determining an interval in the data set based on the target Gaussian distribution parameters.
In some optional implementations of the present embodiment, the target gaussian distribution parameters include a gaussian distribution mean and a gaussian distribution variance.
In some optional implementations of this embodiment, the method further includes: a model training unit configured to obtain a sample model data set; inputting each sample model data in the sample model data set into a convolution network in batches to obtain convolution sample data of each batch; determining Gaussian distribution parameters corresponding to convolution sample data of each batch; determining a target Gaussian distribution parameter based on the Gaussian distribution parameters of each batch; and determining a residual error network which is trained in advance based on the target Gaussian distribution parameters.
In some optional implementations of this embodiment, the model training unit is further configured to: for each batch of convolution sample data, determining the convolution data mean and the convolution data variance of the batch of convolution sample data; a gaussian distribution mean and a gaussian distribution variance are generated corresponding to the convolved data mean and the convolved data variance of the batch.
In some optional implementations of this embodiment, the model training unit is further configured to: and based on preset weight information, carrying out weighted summation on the Gaussian distribution parameters of each batch to obtain the target Gaussian distribution parameters.
It should be understood that the units 501 to 504, which are described in the apparatus 500 for processing data, correspond to the respective steps in the method described with reference to fig. 2, respectively. Thus, the operations and features described above for the method for processing data are equally applicable to the apparatus 500 and the units included therein and will not be described again here.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 601 performs the respective methods and processes described above, such as a method for processing data. For example, in some embodiments, the method for processing data may be implemented as a computer software program tangibly embodied on 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 onto the device 600 via the ROM 602 and/or the 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 method for processing data described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured by any other suitable means (e.g. by means of firmware) to perform the method for processing data.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a 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 may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (21)

1. A method for processing data, comprising:
acquiring initial model data of a deep learning model;
determining a data set interval based on the data distribution information of the initial model data;
mapping the initial model data to a preset target data interval based on the data set interval to obtain target model data;
and deploying the deep learning model at the mobile terminal based on the target model data.
2. The method of claim 1, wherein mapping the initial model data to a preset target data interval based on the data set interval to obtain 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 the mapping relation between the data set interval and the target data interval to obtain the target model data.
3. The method of claim 1, wherein mapping the initial model data to a preset target data interval based on the data set interval to obtain 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 mapping the initial model data to a preset target data interval based on the data set interval to obtain 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 smaller 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 determining a data set interval based on the data distribution information of the initial model data comprises:
determining a target Gaussian distribution parameter corresponding to the initial model data based on a residual error network trained in advance;
and determining the interval in the data set based on the target Gaussian distribution parameter.
6. The method of claim 5, wherein the target Gaussian distribution parameters include a Gaussian distribution mean and a Gaussian distribution variance.
7. The method of claim 6, wherein the pre-trained residual network is trained based on the following steps:
acquiring a sample model data set;
inputting each sample model data in the sample model data set into a convolution network in batches to obtain convolution sample data of each batch;
determining Gaussian distribution parameters corresponding to convolution sample data of each batch;
determining the target Gaussian distribution parameters based on the Gaussian distribution parameters of the various batches;
and determining the residual error network which is trained in advance based on the target Gaussian distribution parameters.
8. The method of claim 7, wherein the determining the gaussian distribution parameters corresponding to each batch of convolution sample data comprises:
for each batch of convolution sample data, determining the convolution data mean and the convolution data variance of the batch of convolution sample data;
a gaussian distribution mean and a gaussian distribution variance are generated corresponding to the convolved data mean and the convolved data variance of the batch.
9. The method of claim 7, wherein said determining a target Gaussian distribution parameter based on the Gaussian distribution parameters of the respective batches comprises:
and carrying out weighted summation on the Gaussian distribution parameters of each batch based on preset weight information to obtain the target Gaussian distribution parameters.
10. An apparatus for processing data, comprising:
a data acquisition unit configured to acquire initial model data of a deep learning model;
an interval determination unit configured to determine an interval in a data set based on data distribution information of the initial model data;
the data mapping unit is configured to map the initial model data to a preset target data interval based on the data set interval to obtain target model data;
a model deployment unit configured to deploy the deep learning model at a mobile terminal based on the target model data.
11. The apparatus of claim 10, 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 data set interval, mapping the data to the target data interval based on the mapping relation between the data set interval and the target data interval to obtain the target model data.
12. The apparatus of claim 10, 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 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.
13. The apparatus of claim 10, 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 smaller 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.
14. The apparatus of claim 10, wherein the interval determination unit is further configured to:
determining a target Gaussian distribution parameter corresponding to the initial model data based on a residual error network trained in advance;
and determining the interval in the data set based on the target Gaussian distribution parameter.
15. The apparatus of claim 14, wherein the target gaussian distribution parameters comprise a gaussian distribution mean and a gaussian distribution variance.
16. The apparatus of claim 15, further comprising:
a model training unit configured to obtain a sample model data set; inputting each sample model data in the sample model data set into a convolution network in batches to obtain convolution sample data of each batch; determining Gaussian distribution parameters corresponding to convolution sample data of each batch; determining the target Gaussian distribution parameters based on the Gaussian distribution parameters of the various batches; and determining the residual error network which is trained in advance based on the target Gaussian distribution parameters.
17. The apparatus of claim 16, wherein the model training unit is further configured to:
for each batch of convolution sample data, determining the convolution data mean and the convolution data variance of the batch of convolution sample data;
a gaussian distribution mean and a gaussian distribution variance are generated corresponding to the convolved data mean and the convolved data variance of the batch.
18. The apparatus of claim 16, wherein the model training unit is further configured to:
and carrying out weighted summation on the Gaussian distribution parameters of each batch based on preset weight information to obtain the target Gaussian distribution parameters.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
CN202210106014.6A 2022-01-28 2022-01-28 Method, apparatus, device, medium and product for processing data Pending CN114492794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210106014.6A CN114492794A (en) 2022-01-28 2022-01-28 Method, apparatus, device, medium and product for processing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210106014.6A CN114492794A (en) 2022-01-28 2022-01-28 Method, apparatus, device, medium and product for processing data

Publications (1)

Publication Number Publication Date
CN114492794A true CN114492794A (en) 2022-05-13

Family

ID=81477311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210106014.6A Pending CN114492794A (en) 2022-01-28 2022-01-28 Method, apparatus, device, medium and product for processing data

Country Status (1)

Country Link
CN (1) CN114492794A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115630630A (en) * 2022-10-25 2023-01-20 北京百度网讯科技有限公司 Language model processing method, service processing method, device, equipment and medium
WO2023221360A1 (en) * 2022-05-19 2023-11-23 北京百度网讯科技有限公司 Training method, apparatus and system for deep learning model, and device and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023221360A1 (en) * 2022-05-19 2023-11-23 北京百度网讯科技有限公司 Training method, apparatus and system for deep learning model, and device and medium
CN115630630A (en) * 2022-10-25 2023-01-20 北京百度网讯科技有限公司 Language model processing method, service processing method, device, equipment and medium
CN115630630B (en) * 2022-10-25 2024-02-13 北京百度网讯科技有限公司 Language model processing method, service processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN114492794A (en) Method, apparatus, device, medium and product for processing data
CN112560996A (en) User portrait recognition model training method, device, readable storage medium and product
CN113870334A (en) Depth detection method, device, equipment and storage medium
CN112528995A (en) Method for training target detection model, target detection method and device
CN114742237A (en) Federal learning model aggregation method and device, electronic equipment and readable storage medium
CN115456167A (en) Lightweight model training method, image processing device and electronic equipment
CN113642711B (en) Processing method, device, equipment and storage medium of network model
CN114708345A (en) CT image reconstruction method, device, equipment and storage medium
CN113052063A (en) Confidence threshold selection method, device, equipment and storage medium
CN112651453A (en) Loss function adaptive method, device, equipment and storage medium
CN114399513B (en) Method and device for training image segmentation model and image segmentation
CN115660991A (en) Model training method, image exposure correction method, device, equipment and medium
CN113408641B (en) Training of resource generation model and generation method and device of service resource
CN114758130A (en) Image processing and model training method, device, equipment and storage medium
CN114580740A (en) Bus load prediction method and device, electronic equipment and storage medium
CN115482443A (en) Image feature fusion and model training method, device, equipment and storage medium
CN114707638A (en) Model training method, model training device, object recognition method, object recognition device, object recognition medium and product
CN113032071A (en) Page element positioning method, page testing method, device, equipment and medium
CN112560883A (en) Method and device for setting learning rate of target detection model
CN113407844B (en) Version recommendation method, device and equipment of applet framework and storage medium
CN114399555B (en) Data online calibration method and device, electronic equipment and computer readable medium
CN114494818B (en) Image processing method, model training method, related device and electronic equipment
CN114742263B (en) Load prediction method, device, electronic equipment and storage medium
CN116611495B (en) Compression method, training method, processing method and device of deep learning model
CN114429211A (en) Method, apparatus, device, medium and product for generating information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination