WO2024259877A1 - 数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品 - Google Patents

数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品 Download PDF

Info

Publication number
WO2024259877A1
WO2024259877A1 PCT/CN2023/130346 CN2023130346W WO2024259877A1 WO 2024259877 A1 WO2024259877 A1 WO 2024259877A1 CN 2023130346 W CN2023130346 W CN 2023130346W WO 2024259877 A1 WO2024259877 A1 WO 2024259877A1
Authority
WO
WIPO (PCT)
Prior art keywords
operator
target
quantization
trained
model
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.)
Ceased
Application number
PCT/CN2023/130346
Other languages
English (en)
French (fr)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Publication of WO2024259877A1 publication Critical patent/WO2024259877A1/zh
Priority to US19/309,132 priority Critical patent/US20250378331A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0475Generative networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0495Quantised networks; Sparse networks; Compressed networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the field of computers, and in particular to a data processing method, device, electronic device, computer-readable storage medium, and computer program product.
  • a generative model is a model that can generate new sample data sets from a random vector. It is an important type of model in the field of machine learning.
  • the embodiments of the present application provide a data processing method, device, electronic device, computer-readable storage medium and computer program product, which can reduce the training time of the generated model and improve the training efficiency.
  • the present application provides a data processing method, which is applied to an electronic device, and the method includes:
  • the training input object is used to train the generated model to be trained to obtain a trained generated model.
  • the present application also provides a data processing device, the device comprising:
  • a model acquisition unit configured to acquire an initial generation model and determine a target operator to be quantized from the initial generation model
  • a strategy determination unit configured to determine a preset quantization strategy for quantizing the target operator according to the type and quantity of the target operator
  • a quantization processing unit configured to perform quantization processing on the target operator through the preset quantization strategy to obtain a generation model to be trained
  • the model training unit is configured to train the generated model to be trained using the training input object to obtain a trained generated model.
  • An embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the data processing method provided in the embodiment of the present application.
  • An embodiment of the present application provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in the data processing method provided in the embodiment of the present application.
  • An embodiment of the present application provides a computer program product, including a computer program/instruction, which, when executed by a processor, implements the steps in the data processing method provided in the embodiment of the present application.
  • the initial generation model can be obtained first, and then the target operator can be found from the initial generation model. After the target operator is found, the target operator can be quantized according to the category of the target operator by a preset quantization strategy, thereby obtaining the generation model to be trained. Subsequently, the generation model to be trained can be trained using the training input object, thereby obtaining the trained generation model.
  • the target operator is an operator or a combination of multiple operators arranged in a set order. Therefore, the initial generation model can be obtained first, and the target operator can be searched from the initial generation model. Then, based on the preset quantization strategy corresponding to the category of the target operator, the target operator is quantized to obtain the quantized initial generation model, and then the above model is trained to obtain the trained generation model.
  • the model structure of the initial generation model can be simplified, thereby improving the training efficiency of the model; and the processing steps of searching for a preset target operator and implementing the quantization of the target operator according to the corresponding preset quantization strategy can be applied in batches to the training of the generation model, thereby improving the problem that the prior art is time-consuming and has low work efficiency.
  • FIG. 1a is a schematic diagram of a use scenario of a data processing method provided in an embodiment of the present application
  • FIG1b is a schematic diagram of a flow chart of a data processing method provided in an embodiment of the present application.
  • FIG1c is a schematic structural block diagram of an operator replacement process
  • FIG1d is a schematic structural block diagram of performing operator combination insertion processing and operator fusion processing on Conv;
  • FIG1e is a schematic structural block diagram of operator combination insertion processing and operator fusion processing for Conv+BN+ReLU;
  • FIG1f is a schematic structural block diagram of performing operator combination insertion processing and operator fusion processing on Conv+BN+Add;
  • FIG1g is a schematic structural diagram of the model structure part where data accuracy needs to be maintained
  • FIG2 is a flow chart of a data processing method provided by another embodiment of the present application.
  • FIG3 is a schematic diagram of a structure of a data processing device provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • Generative model a model that generates a new sample data set from a random vector.
  • Deep learning algorithms are composed of computing units, which are called operators.
  • operators correspond to the computing logic in the layer.
  • the convolution layer is a convolution operator
  • RELU is an operator used as an activation function in the network model.
  • Quantization processing also known as quantization operation, refers to the discretization of the input of the operator so that the input is suitable for low-bit representation and storage.
  • Quantization operator refers to an operator that can perform quantization processing.
  • Dequantization also known as dequantization operation, is to restore the quantized data to high-precision floating point numbers or integers.
  • Dequantization operation is the inverse operation of quantization operation, which can restore the information loss caused by quantization.
  • Dequantization operator refers to an operator that can perform dequantization operation (Dequantization).
  • Embodiments of the present application provide a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product.
  • the data processing device may be integrated in an electronic device, which may be a terminal, a server or other device.
  • the terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC), or may be an intelligent device with computing functions.
  • the server may be a single server or a server cluster consisting of multiple servers.
  • the data processing device may also be integrated into multiple electronic devices.
  • the data processing device may be integrated into multiple servers, and the data processing method of the present application may be implemented by multiple servers.
  • the server may also be implemented in the form of a terminal.
  • the data processing method provided in the embodiment of the present application includes: obtaining an initial generation model; determining a target operator from the initial generation model; quantizing the target operator according to the category and quantity of the target operator through a preset quantization strategy to obtain a generation model to be trained; and training the generation model to be trained using a training input object to obtain a trained generation model.
  • the processing steps of determining a preset target operator and implementing quantization processing on the target operator according to the corresponding preset quantization strategy can be applied in batches to the training of the generation model, thereby improving the problem of long training time and low work efficiency in the prior art of the generation model.
  • a data processing method is provided. As shown in FIG. 1b , the data processing method is applied to an electronic device.
  • the implementation process of the method may include the following steps 110 to 140:
  • Step 110 Obtain an initial generation model, and determine a target operator to be quantized from the initial generation model.
  • the initial generation model is a model that can generate a new sample data set from a random vector.
  • the initial generation model can be a non-probabilistic generation model that can be learned and generated by means of a neural network, for example, an autoencoder (AutoEncoder), a generative adversarial network (GAN), a PixelCNN, and other models.
  • the target operator to be quantized can be pre-selected and set, and the target operator can be an operator or an operator combination formed by multiple operators. When the target operator is an operator combination formed by multiple operators, the multiple operators can be arranged in a certain order to form the target operator.
  • the target operator is a target operator, such as a convolution operator Conv, a deconvolution operator Deconv, a linear transformation operator (Linear Transformation, Linear), etc.
  • the target operator can also be an operator combination formed by a fixed order, for example, it can be an operator combination formed by a convolution operator Conv, a batch normalization operator (Batch Normalization, BN) and an activation function ReLU: Conv+BN+ReLU; for another example, it can be a convolution operator Conv, a batch normalization operator (Batch Normalization, BN) and an addition operator.
  • the operator combination formed by (Addition Operation, Add) is: Conv+BN+Add. It should be understood that the specific combination form of the target operator should not be understood as a limitation to the present application.
  • the preset quantization strategy is a pre-set strategy for quantizing the target operator.
  • the preset quantization strategy can be a replacement strategy or an insertion strategy.
  • Each target operator corresponds to a preset quantization strategy, and the preset quantization strategy corresponding to the target operator can be determined by the category and number of the target operators.
  • the preset quantization strategy when the number of the target operators is one, the preset quantization strategy is determined to perform operator replacement processing on the target operator; when the number of the target operators is at least two, or the number of the target operators is one, and the category of the target operator is a convolution operator, the preset quantization strategy is determined to insert a quantization operator combination into the target position, and the quantization operator combination is used for quantization processing, and the quantization operator combination includes a quantization operator and a dequantization operator.
  • the quantization processing process that the target operator needs to perform can be determined according to the priority of the processing process. For example, the priority of the operator replacement processing can be set higher than the priority of inserting a quantization operator combination into the target position. Therefore, if there is a case where the target operator can perform both the process of operator replacement processing and the process of inserting a quantization operator combination into the target position (for example, the convolution operator Conv), the process of operator replacement processing can be executed according to the priority.
  • the process of inserting a quantization operator combination into the target position is executed; if the process of operator replacement processing is successfully executed, there is no need to execute the process of inserting a quantization operator combination into the target position.
  • the process of operator replacement processing can be performed on the target operator according to the pre-set priority. If the process of operator replacement processing is successfully executed, there is no need to execute the process of inserting a quantization operator combination into the target position; if the process of operator replacement processing cannot be completed due to a fault, the process of inserting a quantization operator combination into the target position is executed again.
  • the process of operator replacement processing can save more computational effort of the model than the process of inserting a quantization operator combination into the target position. Therefore, setting the priority of operator replacement processing higher than the priority of inserting a quantization operator combination into the target position is more conducive to improving the processing efficiency of the model.
  • the target operator when the number of the target operator is one, that is, when the target operator is a single operator, the target operator is quantized by a preset quantization strategy, that is, the target operator is replaced by an operator to obtain a generative model to be trained.
  • the target operator is replaced by an operator, the operator combination in the direction of the input quantity of the target operator is obtained, and the quantization operator is determined; then, the operator combination is replaced by the quantization operator to obtain the generative model to be trained.
  • the value of the quantization operator can be determined by the input quantity and weight of the target operator.
  • the value of the quantization operator can be the product of the input quantity and the weight, or an integer multiple of the product of the input quantity and the weight.
  • the categories of the target operator may be: a convolution operator Conv, a deconvolution operator Deconv, and a linear transformation operator Linear.
  • the convolution operator Conv is used as an example for explanation:
  • the operator combination in the input direction of the convolution operator Conv can be obtained, that is, the operator combination framed by the dotted box shown in Figure 1c. Then, the operator combination framed by the dotted box shown in Figure 1c is replaced with the quantized operator (Quant OP).
  • Quant OP is related to the input amount and weight of the operator to be operated framed by the dotted box shown in Figure 1c.
  • Quant OP can be the product of the input amount of the operator to be operated and the weight of the operator to be operated; in another embodiment, Quant OP can also be an integer multiple of the product of the input amount of the operator to be operated and the weight of the operator to be operated. Exemplarily, the value of the integer can be 3, or it can be other values, such as 2. The specific value of the integer should not be understood as a limitation on the present application.
  • the original target operator is replaced by the quantization operator, which can better simplify the model. Operator structure, thereby improving the operation speed of the model.
  • the operator combination framed by the dotted box shown in FIG1c may include a quantization operator for performing a quantization operation and an inverse quantization operator for performing an inverse quantization operation, or may not include a quantization operator and an inverse quantization operator.
  • the quantization operator and the inverse quantization operator are shown in FIG1c to illustrate that the convolution operation operator Conv can also perform quantization processing by inserting a quantization operator combination into the target position.
  • the preset quantization strategy can also be to insert a quantization operator combination into the target position, and the target position is the position between the input amount and the convolution operator, that is, when the number of target operators is one and the target operator is the convolution operator, step 130 is implemented by inserting the quantization operator combination into the position between the input amount and the convolution operator, and adding a quantization operator combination for quantizing the weight of the convolution operator to the initial generation model.
  • the generation model to be trained is obtained at this time; if the input position of the convolution operator is not connected to the batch normalization operator, the quantization operator is inserted into the output position of the convolution operator to obtain the generation model to be trained.
  • the preset quantization strategy is also to insert a quantization operator combination into the target position, wherein the target position may be the position between the input and the convolution operator. Then, at this time, the target operator is quantized by using the preset quantization strategy, that is, the quantization operator combination is inserted into the position between the input and the convolution operator, and the quantization operator combination is used for quantization, and the quantization operator combination includes a quantization operator and an inverse quantization operator.
  • a quantization operator combination for quantizing the weights of the convolution operator is added to the initial generation model; when the target operator includes a batch normalization operator and an activation function sequentially connected to the output position of the convolution operator, the output of the convolution operator is not quantized, and at this time, the generation model to be trained is obtained.
  • the target operator when the number of target operators is at least two, the target operator may be: a combination of operators formed by a convolution operator Conv, a batch normalization operator (Batch Normalization, BN) and an activation function ReLU: Conv+BN+ReLU; the target operator may also be: a combination of operators formed by a convolution operator Conv, a batch normalization operator (Batch Normalization, BN) and an addition operator (Add): Conv+BN+Add.
  • Each target operator has its own corresponding target position.
  • the quantization operator combination includes a quantization operator and an inverse quantization operator. After finding out at least one target position corresponding to each target operator, the corresponding quantization operator combination can be inserted into each target position of the at least one target position, thereby realizing quantization processing for the target operator.
  • the target operator when the target operator is a single operator, the target operator can be replaced by an operator; when the number of the target operators is at least two, that is, the target operator is a combination of multiple operators, or the target operator is a single convolution operator, a quantization operator combination can be inserted into the target position.
  • the above two processing methods achieve coverage for more operators, thereby expanding the scope of application of the solution.
  • the operator structure of the target operator can be simplified or the numerical type of the input quantity can be changed, thereby improving the operation speed of the generated model to be trained and reducing the training operation amount of the generated model to be trained.
  • the number of target operators is at least two, or the number of target operators is one, and the category of the target operator is a convolution operator, it is also necessary to add a quantization operator combination for quantizing the weights of the convolution operator to the initial generation model, so as to obtain the generation model to be trained.
  • a quantization operator combination can be inserted between the input and the convolution operator: a quantization operator and an anti-quantization operator.
  • a quantization operator combination for quantizing the weights of the convolution operator will also be added to the initial generation model: a quantization operator and an anti-quantization operator.
  • the target operator when the number of target operators is at least two and the target operator includes a convolution operator: if the target operator also includes a batch normalization operator and an activation function sequentially connected to the output position of the convolution operator, the output of the convolution operator is not quantized.
  • the target operator when the number of target operators is at least two, and the target operator includes a convolution operator, and the target operator includes a batch normalization operator that is sequentially connected to the output position of the convolution operator, and the batch normalization operator is also connected to the first input branch of the addition operator, the output of the convolution operator is not quantized, a quantization operator combination is inserted into the second input branch of the addition operator, and the quantization operator is inserted into the output position of the addition operator.
  • a quantization operator is an operator that can perform quantization operations.
  • quantization operations usually refer to discretizing the input quantity so that the input quantity can be represented and stored in low bits, thereby reducing the memory usage and energy consumption of the model.
  • the dequantization operator is an operator that can perform dequantization operations.
  • the dequantization operation usually refers to: restoring the quantized data to high-precision floating point numbers or integers.
  • the dequantization operation is the inverse operation of the quantization operation, which can restore the information loss caused by quantization.
  • the quantization operator and the inverse quantization operator are inserted in sequence to form a pseudo quantization node.
  • a pseudo quantization node For details, please refer to the dotted box shown in (1) in FIG. 1d.
  • the positions of consecutive Conv+BN+ReLUs can be first found, and then at least one target position corresponding to Conv+BN+ReLU can be obtained. See (1) in FIG. 1e for details, and the target position corresponding to Conv+BN+ReLU is between the input amount and Conv.
  • the corresponding operator combination can be inserted into each target position, and the above example is continued for explanation:
  • the quantization operator and the dequantization operator can be inserted sequentially between the input and Conv.
  • it is also necessary to add a quantization operator combination for the weight of Conv that is, sequentially inserting the quantization operator and the dequantization operator, as shown in (1) in Figure 1e.
  • Conv+BN+Add please refer to (1) in Figure 1f for details. You can first find the positions of consecutive Conv+BN+Add, and then obtain at least one target position corresponding to Conv+BN+Add. Please refer to (1) in Figure 1f for details. The positions between input quantity 1 and Add, between input quantity 2 and Conv, and between Add and output are all target positions corresponding to Conv+BN+Add.
  • the corresponding operator combination can be inserted into each target position, and the above example is continued:
  • the quantization operator and the dequantization operator can be inserted in sequence between the input quantity one and Add; the quantization operator and the dequantization operator can be inserted in sequence between the input quantity two and Conv; the quantization operator can be inserted between Add and the output.
  • it is also necessary to add a quantization operator combination for the weight of Conv that is, insert the quantization operator and the dequantization operator in sequence, as shown in (1) in Figure 1f.
  • the implementation process of the quantization operator performing the quantization operation may be: implementing the quantization operation in a symmetric quantization manner. That is, mapping the floating point interval with symmetric positive and negative ranges to the integer interval [-a, a] in equal proportion. Wherein, the value of a is a positive integer. In some embodiments, a may be 127.
  • the distribution range of floating-point numbers can be truncated first, that is, for the complete distribution range of floating-point numbers, the positive and negative symmetrical areas where floating-point numbers are more frequently distributed can be selected for value truncation.
  • mapping relationship between floating-point numbers and integers can be established using the given scaling factor (scale) and offset (zero_point):
  • x is a floating point number
  • xq is the corresponding integer after mapping
  • round() means rounding down.
  • the scaling factor scale can be calculated based on the distribution range of floating-point numbers [-cmax, cmax] and the integer interval [-a, a].
  • the distribution range of floating-point numbers [-cmax, cmax] can be obtained by staff based on observation, that is, staff can select positive and negative symmetrical areas where floating-point numbers are more frequently distributed for numerical interception through observation.
  • [-a, a] can be a pre-set fixed value. It should be understood that, on the premise that a is a positive integer, its specific value range should not be understood as a limitation on the present application.
  • the embodiment of the present application can also be implemented through a variety of methods, including: sliding average method, histogram statistical method, etc.
  • the implementation process of implementing the quantization operation should also not be understood as a limitation to the present application.
  • the corresponding quantization operator combination can be inserted into each target position of at least one target position, thereby realizing quantization processing for the target operator, achieving the effect of simplifying the model structure or changing the numerical type, and helping to reduce the model calculation time.
  • the step of "inserting a quantization operator combination into a target position” may include the following steps A1 to A2:
  • Numeric type is one of the most basic and commonly used data types in computer programming, which is used to store and operate various numerical data, such as integers, floating-point numbers, complex numbers, etc.
  • A2 Determine a corresponding quantization operator combination based on the numerical type of the input quantity.
  • the quantization operator combination inserted at the target position can be determined according to the numerical type of the input quantity corresponding to the target position, thereby facilitating the unification of the numerical type of the trained model.
  • step A2 may include the following steps A21 to A22:
  • the numerical type of the input quantity is a floating point number, determine that the corresponding quantization operator combination includes a quantization operator and a dequantization operator.
  • the floating-point number may be a 32-bit floating-point number. If the numerical type of the input is a floating-point number, the input of the floating-point numerical type may be sequentially subjected to a quantization operator and an inverse quantization operator, thereby sequentially performing quantization operation processing and inverse quantization operation processing on the input of the floating-point numerical type, so that the numerical type of the result is still a floating-point number.
  • the integer may be an 8-bit integer. If the numerical type of the input is an integer, the input of the integer numerical type may be subjected to a dequantization operator, thereby performing a dequantization operation on the input of the integer numerical type, so that the numerical type of the result is changed to a floating point number.
  • the numerical type of the output result can be adjusted to a floating point type by introducing a corresponding quantization operator combination, thereby paving the way for subsequent calculations of the model and further improving the calculation speed of the model.
  • step 130 may include: when the model structure to which the target operator belongs is not included in the target structure list, quantizing the target operator using the preset quantization strategy to obtain a generated model to be trained.
  • the embodiment of the present application may further include the following step: when the model structure to which the target operator belongs is included in the target structure list, maintaining the target operator unchanged.
  • the target structure list is a structure whitelist set by the staff based on their work experience.
  • the model structure in the target structure list may be a model structure that needs to maintain the accuracy of the output data.
  • the target operator can still be maintained unchanged, that is, the target operator is not quantized.
  • the target operator can be maintained unchanged at the model structure where data accuracy needs to be maintained, and no operator adjustment is performed.
  • no quantization processing can be performed at the last few layers of the model.
  • Figure 1g The Conv at the position of the solid line box shown in Figure 1g does not need to be adjusted.
  • step 140 may include the following steps 141 to 144:
  • GAN Generative Adversarial Networks
  • the loss function of GAN mainly consists of two parts: the loss function of the generator and the loss function of the discriminator.
  • z is the noise sampled from the prior distribution
  • G represents the generator
  • D represents the discriminator
  • the ultimate goal of the discriminator is to maximize the discrimination probability of real data and minimize the discrimination probability of generated data.
  • the loss function is calculated using the given parameters to obtain the loss value corresponding to that iteration.
  • the loss value meets the target requirement, it is determined that the training of the generated model to be trained is completed, and the trained generated model is obtained.
  • the target requirement is a pre-set requirement.
  • the multiple loss values converge and the loss values meet the target requirement, it is determined that the training of the generated model to be trained is completed, and the trained generated model is obtained.
  • the initial generation model after the operator is adjusted can be obtained first, and then the above model is trained based on the above steps 141 to 144, so as to obtain a trained generation model. After the operator of the initial generation model is adjusted, the operation speed of the model is accelerated and the operation time is shortened. Training the initial generation model after the operator is adjusted can take into account both the accuracy of the model's result output and the acceleration of the operation speed.
  • the quantization operator combination includes a quantization operator and an inverse quantization operator. Accordingly, the embodiment of the present application may further include the following step 150:
  • TorchScript is a feature in the PyTorch framework that can convert trained PyTorch models into a serialized and reusable format for use in other environments, such as other programming languages such as C++, Java, or JavaScript.
  • the trained generative model may be adjusted by deleting the inverse quantization operator to obtain a target generative model.
  • step 150 may include:
  • (2) in Figure 1d can be obtained by simplifying (1) in Figure 1d through operators. Compared with the model structure shown in (1) in Figure 1d, the model structure shown in (2) in Figure 1d deletes the dequantization operator between the input and the convolution operator, deletes the quantization operator at the output position of the convolution operator, and represents the weight of the convolution operator with an integer numerical type. In the above implementation, while simplifying the model structure, the input and output of Conv shown in (2) in Figure 1d are adjusted from the original floating point numbers to integers, further simplifying the amount of calculation.
  • step 150 may include:
  • the model generated after training includes a combination of a convolution operator, a batch normalization operator, and an activation function
  • the dequantization operator between the input and the convolution operator is deleted, the weight of the convolution operator is represented by an integer numerical type, and the combination of the convolution operator, the batch normalization operator, and the activation function is fused into a new convolution operator.
  • step 150 may include:
  • the model generated after training includes a combination of a convolution operator, a batch normalization operator, and an addition operator
  • the dequantization operator between the first input and the addition operator is deleted
  • the dequantization operator between the second input and the convolution operator is deleted
  • the quantization operator at the output position of the addition operator is deleted
  • the weight of the convolution operator is represented by an integer numerical type
  • the combination of the convolution operator, the batch normalization operator, and the addition operator is fused into a new convolution operator.
  • (2) in Figure 1f can be obtained by operator fusion processing of (1) in Figure 1f.
  • the model structure shown in (2) in Figure 1f deletes the dequantization operator between input quantity one and the addition operator, deletes the dequantization operator between input quantity two and the convolution operator, deletes the quantization operator at the output position of the addition operator, and represents the weight of the convolution operator with an integer numerical type; and the combination of the convolution operator, the batch normalization operator and the addition operator is fused into a new convolution operator.
  • the two input quantities and output quantities of Conv shown in (2) in Figure 1f are adjusted from the original floating point numbers to integers, which further simplifies the amount of calculation.
  • the target generation model may be exported.
  • the export process is as follows:
  • step 150 the embodiment of the present application may further include the following step 160:
  • the input object is data that can be generated by the generative model, such as images, text, or audio.
  • the target generation model has a simplified model structure and the numerical types of input and output quantities are adjusted, so that the computational efficiency of the target generation model can be improved as much as possible.
  • the initial generation model can be obtained first, and then the target operator can be searched from the initial generation model. After the target operator is found, the target operator can be quantized according to the category of the target operator by a preset quantization strategy, so as to obtain the quantized initial generation model, and record it as the generation model to be trained. Subsequently, the training input object can be used to train the generation model to be trained, so as to obtain the trained generation model.
  • the target operator is an operator or a combination of multiple operators arranged in a set order. Therefore, the initial generation model can be obtained first, and the target operator can be searched from the initial generation model.
  • the target operator is quantized to obtain the quantized initial generation model, and then the above model is trained to obtain the trained generation model.
  • the model structure of the initial generation model can be simplified, thereby improving the training efficiency of the model; and the processing steps of searching for the preset target operator and realizing the quantization of the target operator according to the corresponding preset quantization strategy can be applied in batches to the training of the generation model.
  • the embodiments of the present application can improve the problem of the prior art being time-consuming and having low working efficiency.
  • the method of the embodiment of the present application is described in detail by taking the generation model as GAN and the input object as an example.
  • the quantization operator combination is used for quantization processing, and the quantization operator combination includes a quantization operator and a dequantization operator.
  • both step 203 and step 204 can be implemented when the model structure to which the target operator belongs is not included in the target structure list.
  • the target operator is maintained unchanged.
  • the embodiment of the present application may further include: when the output position of the convolution operation operator is not connected to the batch normalization operator, inserting the quantization operator into the output position of the convolution operation operator to obtain the generated model to be trained.
  • the embodiment of the present application may further include: when the target operator is the convolution operation operator, inserting the quantization operator into the output position of the convolution operation operator.
  • the embodiment of the present application may further include: when the number of the target operators is at least two, and the target operators include a convolution operator, and the target operators include batch normalization operators sequentially connected to the output positions of the convolution operators, and the batch normalization operator is also connected to the first input branch of the addition operator, the output of the convolution operator is not quantized, a quantization operator combination is inserted into the second input branch of the addition operator, and the quantization operator is inserted into the output position of the addition operator.
  • step 201 to step 210 has been described above, and the execution process of step 201 to step 210 may refer to the above description.
  • the initial generation model can be obtained first, and then the target operator to be quantized is determined from the initial generation model, and the target operator is quantized by a preset quantization strategy according to the category and number of the target operator, so as to obtain the initial generation model after quantization, and record it as the generation model to be trained.
  • the training input object can be used to train the generation model to be trained, so as to obtain the training generation model.
  • the target operator is an operator or a combination of multiple operators arranged in a set order. Therefore, the initial generation model can be obtained first, and the target operator can be searched from the initial generation model.
  • the target operator is quantized to obtain the initial generation model after quantization, and then the above model is trained to obtain the training generation model.
  • the model structure of the initial generation model can be simplified, thereby improving the training efficiency of the model; and the processing steps of searching for the preset target operator and realizing the quantization of the target operator according to the corresponding preset quantization strategy can be applied in batches to the training of the generation model.
  • the embodiments of the present application can improve the problem of the prior art being time-consuming and having low working efficiency.
  • the embodiment of the present application also provides a data processing device, which can be integrated in an electronic device, and the electronic device can be a terminal, a server and other devices.
  • the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, or a personal computer (Personal Computer, PC) and other devices;
  • the server can be a single server or a server cluster composed of multiple servers.
  • the method of the embodiment of the present application will be described by taking the data processing device integrated in the terminal of the electronic device as an example.
  • the data processing device may include:
  • a model acquisition unit 301 is configured to acquire an initial generation model and determine a target operator to be quantized from the initial generation model
  • a strategy determination unit 302 is configured to determine a preset quantization strategy for quantizing the target operator according to the type and quantity of the target operator;
  • a quantization processing unit 303 is configured to perform quantization processing on the target operator by using the preset quantization strategy to obtain a generation model to be trained;
  • the model training unit 304 is configured to train the generated model to be trained using the training input object to obtain a trained generated model.
  • the strategy determination unit 302 is further configured to, when the number of the target operator is one, determine that the preset quantization strategy is to perform operator replacement processing on the target operator.
  • the quantization processing unit 303 is also configured to obtain an operator combination in the input quantity direction of the target operator and determine a quantization operator; and replace the operator combination with the quantization operator to obtain a generation model to be trained.
  • the strategy determination unit 302 is further configured to determine that the preset quantization strategy is to insert a quantization operator combination into the target position when the number of the target operators is at least two and the target operators include a convolution operator, or when the number of the target operators is one and the category of the target operator is a convolution operator, and the quantization operator combination is used for quantization processing, and the quantization operator combination includes a quantization operator and a dequantization operator.
  • the quantization processing unit 303 is further configured to, when the number of the target operator is one and the category of the target operator is a convolution operator, insert a quantization operator combination into the position between the input quantity and the convolution operator; add a quantization operator combination for quantizing the weight of the convolution operator to the initial generation model, and when a batch normalization operator is connected to the output position of the convolution operator, obtain the generation model to be trained.
  • the device also includes: a quantization operator insertion unit, configured to insert the quantization operator into the output position of the convolution operator when the output position of the convolution operator is not connected to the batch normalization operator, so as to obtain a generation model to be trained.
  • a quantization operator insertion unit configured to insert the quantization operator into the output position of the convolution operator when the output position of the convolution operator is not connected to the batch normalization operator, so as to obtain a generation model to be trained.
  • the quantization processing unit 303 is further configured to, when the number of the target operators is at least two and the target operator includes a convolution operator, insert a quantization operator combination into a position between the input quantity and the convolution operator; add a quantization operator combination for quantizing the weight of the convolution operator in the initial generation model; and obtain a generation model to be trained when the target operator includes a batch normalization operator and an activation function sequentially connected to the output position of the convolution operator.
  • the device also includes: a combination unit, configured to, when the number of the target operators is at least two, and the target operators include a convolution operator, and the target operators include batch normalization operators sequentially connected to the output positions of the convolution operators, and the batch normalization operator is also connected to the first input branch of the addition operator, not quantize the output of the convolution operator, insert a quantization operator combination into the second input branch of the addition operator, and insert the quantization operator into the output position of the addition operator.
  • a combination unit configured to, when the number of the target operators is at least two, and the target operators include a convolution operator, and the target operators include batch normalization operators sequentially connected to the output positions of the convolution operators, and the batch normalization operator is also connected to the first input branch of the addition operator, not quantize the output of the convolution operator, insert a quantization operator combination into the second input branch of the addition operator, and insert the quantization operator into the output position of the addition operator.
  • the model training unit 304 includes:
  • a sampling processing subunit configured to perform sampling processing on a training input object using the generation model to be trained to obtain a random vector
  • a generation processing subunit configured to perform generation processing on the random vector using the generation model to be trained to obtain a new generated object
  • a loss value calculation subunit configured to calculate a loss value based on the newly generated object and the training input object
  • the model training subunit is configured to determine that the training of the generated model to be trained is completed when the loss value meets the target requirement, and obtain the trained generated model.
  • the quantization processing unit 303 is further configured to, when the model structure to which the target operator belongs is not included in the target structure list, perform quantization processing on the target operator according to the category of the target operator to obtain an initial generation model that has been quantized;
  • the device also includes:
  • the combination maintaining unit is configured to maintain the target operator unchanged when the model structure to which the target operator belongs is included in the target structure list.
  • the quantization operator combination includes a quantization operator and a dequantization operator; accordingly, the device further includes:
  • the operator deletion unit is configured to obtain a target generation model according to the trained generation model after deleting the dequantization operator.
  • the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities.
  • the specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
  • the initial generation model can be obtained first, and then the target operator can be found from the initial generation model. After finding the target operator, the target operator can be quantized by a preset quantization strategy according to the category of the target operator, thereby obtaining the quantized initial generation model, and recording it as the generation model to be trained. Subsequently, the generation model to be trained can be trained using the training input object to obtain the trained generation model.
  • the target operator is an operator or a combination of multiple operators arranged in a set order.
  • the initial generation model can be obtained first, and the target operator to be quantized can be determined from the initial generation model; according to the category and number of the target operator, the preset quantization strategy for quantizing the target operator can be determined; the target operator can be quantized by the preset quantization strategy to obtain the generation model to be trained; the generation model to be trained can be trained using the training input object to obtain the trained generation model.
  • searching and quantizing the target operator the model structure of the initial generation model can be simplified, thereby improving the training efficiency of the model; and the processing steps of searching for a pre-set target operator and quantizing the target operator according to the corresponding preset quantization strategy can be applied in batches to the training of the generation model.
  • the embodiments of the present application can improve the problem of the prior art being time-consuming and having low working efficiency.
  • the embodiment of the present application also provides an electronic device, which can be a terminal, a server, etc.
  • the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc.
  • the server can be a single server or a server cluster composed of multiple servers, etc.
  • the data processing device may also be integrated into multiple electronic devices.
  • the data processing device may be integrated into multiple servers, and the data processing method of the present application may be implemented by multiple servers.
  • the electronic device of this embodiment is a server as an example for detailed description.
  • FIG4 is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application.
  • the electronic device may include components such as a processor 401 of one or more processing cores, a memory 402 of one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405.
  • the electronic device structure shown in FIG4 does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or or a combination of certain components, or different arrangements of components.
  • the processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402.
  • the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
  • the memory 402 can be used to store software programs and modules.
  • the processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402.
  • the memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc.
  • the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
  • the electronic device also includes a power supply 403 for supplying power to various components.
  • the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system.
  • the power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device may further include an input module 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • an input module 404 which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • the electronic device may further include a communication module 405.
  • the communication module 405 may include a wireless module.
  • the electronic device may perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing the user with wireless broadband Internet access.
  • the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.
  • the electronic device may further include a display unit, etc., which will not be described in detail herein.
  • the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:
  • an initial generation model is obtained, and a target operator to be quantized is determined from the initial generation model; a preset quantization strategy for quantizing the target operator is determined according to the category and quantity of the target operator; the target operator is quantized by the preset quantization strategy to obtain a generation model to be trained; the generation model to be trained is trained using a training input object to obtain a trained generation model.
  • an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any data processing method provided in the embodiment of the present application.
  • the instructions can execute the following steps:
  • Acquire an initial generation model search for a target operator from the initial generation model; perform quantization processing on the target operator according to the category of the target operator by using a preset quantization strategy to obtain a quantized initial generation model, which is recorded as a generation model to be trained; train the generation model to be trained using a training input object to obtain a training model. Generate a model after training.
  • the storage medium may include: read-only memory (ROM), random access memory (RAM), disk or CD, etc.
  • a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium.
  • a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations provided in the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本申请实施例公开一种数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品,包括:先获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。

Description

数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品
相关申请的交叉引用
本申请基于申请号为202310733698.7、申请日为2023年6月19日的中国专利申请提出,并要求以上中国专利申请的优先权,以上中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请涉及计算机领域,尤其涉及一种数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品。
背景技术
生成模型(Generative model)是指可以从一个随机向量中生成新的样本数据集的模型。它是机器学习领域中重要的一类模型。
现有技术中,在对生成模型进行训练的过程中,通常需要工作人员逐个进行模型的调整,耗费时间较多且工作效率较低。
发明内容
本申请实施例提供一种数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品,能够降低生成模型的训练时长,提高训练效率。
本申请实施例提供一种数据处理方法,应用于电子设备,所述方法包括:
获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;
根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;
通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;
利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
本申请实施例还提供一种数据处理装置,所述装置包括:
模型获取单元,配置为获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;
策略确定单元,配置为根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;
量化处理单元,配置为通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;
模型训练单元,配置为利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
本申请实施例提供一种电子设备,包括处理器和存储器,所述存储器存储有多条指令;所述处理器从所述存储器中加载指令,以执行本申请实施例提供的数据处理方法中的步骤。
本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行本申请实施例提供的数据处理方法中的步骤。
本申请实施例提供一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现本申请实施例提供的数据处理方法中的步骤。
本申请实施例提供的数据处理方法中,可以先获取初始生成模型,然后从初始生成模型中查找目标算子。在查找到目标算子之后,可以根据目标算子的类别,通过预设量化策略对目标算子进行量化处理,从而得到待训练生成模型。随后,可以利用训练输入对象对待训练生成模型进行训练,从而得到训练后生成模型。
本申请实施例中,目标算子为一个算子或按照设定顺序排列的多个算子组成的组合。因此,可以先获取初始生成模型,并从初始生成模型中查找目标算子。然后基于目标算子的类别所对应的预设量化策略,对目标算子进行量化处理,得到经过量化处理的初始生成模型,随后对上述的模型进行训练,得到训练后生成模型。通过针对目标算子的查找以及量化处理,可以简化初始生成模型的模型结构,从而可以提高模型的训练效率;并且查找预先设定的目标算子,以及依据相应的预设量化策略实现对目标算子进行量化处理的处理步骤可以批量应用于生成模型的训练中,从而可以改善现有技术耗费时间较多且工作效率较低的问题。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a是本申请实施例提供的数据处理方法的使用场景示意图;
图1b是本申请一实施例提供的数据处理方法的流程示意图;
图1c是算子替换处理过程的示意性结构框图;
图1d是对Conv进行算子组合插入处理和算子融合处理的示意性结构框图;
图1e是对Conv+BN+ReLU进行算子组合插入处理和算子融合处理的示意性结构框图;
图1f是对Conv+BN+Add进行算子组合插入处理和算子融合处理的示意性结构框图;
图1g是需保持数据精度的模型结构部分的示意性结构图;
图2是本申请另一实施例提供的数据处理方法的流程示意图;
图3是本申请一实施例提供的数据处理装置的一种结构示意图;
图4是本申请实施例提供的电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下,对本申请涉及的术语进行解释。
1)生成模型,从一个随机向量中生成新的样本数据集的模型。
2)算子,深度学习算法由一个个计算单元组成,称这些计算单元为算子。在网络模型中,算子对应层中的计算逻辑,例如:卷积层(Convolution Layer)是一个卷积运算算子,RELU为网络模型中被用做激活函数的算子。
3)量化处理,又可称为量化操作,是指对算子的输入量进行离散化处理,使输入量适应于低比特位(bit)的表示和存储。
4)量化算子,是指能够执行量化处理的算子。
5)反量化处理,又可称为反量化操作,是将经量化操作的数据重新还原为高精度的浮点数或整数。反量化操作是量化操作的逆运算,可以将量化带来的信息损失恢复。
6)反量化算子,是指能够执行反量化操作(Dequantization)的算子。
本申请实施例提供一种数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品。
其中,该数据处理装置可以集成在电子设备中,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、或者个人电脑(Personal Computer,PC)等设备,也可以是具备运算功能的智能设备。服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。
在一些实施例中,该数据处理装置还可以集成在多个电子设备中,比如,数据处理装置可以集成在多个服务器中,由多个服务器来实现本申请的数据处理方法。
在一些实施例中,服务器也可以以终端的形式来实现。
请参见图1a,本申请实施例提供的数据处理方法中,包括:获取初始生成模型;从所述初始生成模型中确定目标算子;根据所述目标算子的类别和数量,通过预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
上述方法中,确定预先设定的目标算子,以及依据相应的预设量化策略实现对目标算子进行量化处理的处理步骤可以批量应用于生成模型的训练中,从而可以改善现有技术中生成模型的训练耗费时间较长且工作效率较低的问题。
可以理解的是,在本申请的实施例中,涉及到用户信息等相关的数据,当本申请实施例运用到具体产品或技术中时,需要获得用户许可或者同意,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。
以下对本申请实施例提供的数据处理方法、数据处理装置、电子设备分别进行说明。需说明的是,以下实施例的序号不作为对实施例优选顺序的限定。
在本申请实施例中,提供了一种数据处理方法,如图1b所示,该数据处理方法应用在电子设备,该方法的实现流程可以包括如下步骤110至步骤140:
步骤110、获取初始生成模型,从初始生成模型中确定待量化的目标算子。
初始生成模型为能够从一个随机向量中生成新的样本数据集的模型。在一些实施例中,初始生成模型可以是能够通过神经网络等手段进行学习和生成的非概率生成模型,例如可以是自编码器(AutoEncoder)、生成对抗网络(Generative Adversarial Network,GAN)、PixelCNN等模型。待量化的目标算子可以是预选设置的,目标算子可以是一个算子,也可以为多个算子形成的算子组合。当目标算子是多个算子形成的算子组合时,多个算子可以按一定的顺序排列形成目标算子。
举例来说,目标算子为一个目标算子,例如,卷积运算算子Conv,反卷积运算算子Deconv,线性变换算子(Linear Transformation,Linear)等。目标算子也可以为按固定顺序排列形成的算子组合,例如,可以是卷积运算算子Conv、批标准化算子(Batch Normalization,BN)以及激活函数ReLU形成的算子组合:Conv+BN+ReLU;又如,可以是卷积运算算子Conv、批标准化算子(Batch Normalization,BN)以及加法运算算子 (Addition Operation,Add)形成的算子组合:Conv+BN+Add。应当理解,目标算子的具体组合形式不应该理解为是对本申请的限制。
120、根据目标算子的类别和数量,确定对目标算子进行量化处理的预设量化策略。
预设量化策略为预先设置的,用于对目标算子进行量化的策略。预设量化策略可以是替换策略或者插入策略。每个目标算子均对应有预设量化策略,目标算子对应的预设量化策略可以由目标算子的类别和数量确定。在一些实施例中,在所述目标算子的数量为一个的情况下,确定所述预设量化策略为对所述目标算子进行算子替换处理;在所述目标算子的数量为至少两个,或所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,确定所述预设量化策略为向目标位置插入量化算子组合,所述量化算子组合用于量化处理,所述量化算子组合包括量化算子和反量化算子。
在一些实施例中,若存在目标算子既能够进行算子替换处理的过程,又能够进行向目标位置插入量化算子组合的过程的情况,则可以按照处理过程的优先级确定该目标算子所需执行的量化处理过程。例如,可以设置算子替换处理的优先级高于向目标位置插入量化算子组合的优先级。因此,若存在目标算子既能够进行算子替换处理的过程,又能够进行向目标位置插入量化算子组合的过程的情况(例如卷积运算算子Conv),则可以根据优先级执行算子替换处理的过程,若算子替换处理的过程因故障无法完成执行,再执行向目标位置插入量化算子组合的过程;若算子替换处理的过程顺利执行,则无需再执行向目标位置插入量化算子组合的过程。
在上述的实施方式中,若某目标算子既能够进行算子替换处理的过程,又能够进行向目标位置插入量化算子组合的过程,则可以按照预先设置的优先级,对该目标算子执行算子替换处理的过程。若算子替换处理的过程顺利执行,则无需再执行向目标位置插入量化算子组合的过程;若算子替换处理的过程因故障无法完成执行,再执行向目标位置插入量化算子组合的过程。算子替换处理的过程相较于向目标位置插入量化算子组合的过程,更能够节省模型的运算量,因此,设置算子替换处理的优先级高于向目标位置插入量化算子组合的优先级,更利于提高模型的处理效率。
130、通过预设量化策略对所述目标算子进行量化处理,得到待训练生成模型。
在一种实施方式中,在所述目标算子的数量为一个的情况下,也即目标算子为单个算子的情况下,通过预设量化策略对目标算子进行量化处理,也即对所述目标算子进行算子替换处理,得到待训练生成模型。在对目标算子进行算子替换处理时,获取目标算子的输入量方向的算子组合,并确定量化算子;然后利用量化算子替换算子组合,得到待训练生成模型。其中,量化算子的取值可以是通过目标算子的输入量和权重确定的,示例性地,可以量化算子的取值可以是输入量与权重的乘积,还可以是输入量与权重的乘积的整数倍。
在一些实施例中,目标算子的类别可以为:卷积运算算子Conv、反卷积运算算子Deconv,以及线性变换算子Linear。为便于描述,以卷积运算算子Conv为例进行说明:
请参见图1c,在查找到卷积运算算子Conv后,便可以获取卷积运算算子Conv的输入量方向的算子组合,即图1c示出的虚线框所框出的算子组合。然后利用量化算子(quantized operator,Quant OP)替换图1c示出的虚线框所框出的算子组合。Quant OP的取值与图1c示出的虚线框所框出的待运算算子的输入量及权重相关。在一种实施方式中,Quant OP可以为待运算算子的输入量与待运算算子的权重的乘积;在另一种实施方式中,Quant OP还可以为待运算算子的输入量与待运算算子的权重的乘积的整数倍,示例性地,该整数的数值可以为3,也可以为其他数值,例如2,整数的具体数值不应该理解为是对本申请的限制。
在上述实施方式中,利用量化算子替换掉原本的目标算子,可以较好地简化模型的 算子结构,从而提高模型的运算速度。
在一些实施例中,图1c示出的虚线框所框出的算子组合可以包括有执行量化操作的量化算子以及反量化操作的反量化算子,也可以不包括量化算子和反量化算子。在图1c中示出量化算子以及反量化算子是为了说明卷积运算算子Conv也可以通过向目标位置插入量化算子组合的方式进行量化处理。
在一种实施方式中,在目标算子的数量为一个,且所述目标算子为所述卷积运算算子,也即目标算子为单个卷积运算算子的情况下,预设量化策略还可以为向目标位置插入量化算子组合,目标位置为输入量与卷积运算算子之间的位置,也即在目标算子的数量为一个,且所述目标算子为所述卷积运算算子的情况下,步骤130在实现时,是向输入量与卷积运算算子之间的位置插入量化算子组合,并在初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合,如果卷积运算算子的输出位置连接批标准化算子的情况下,那么此时即得到了待训练生成模型;如果卷积算子的输入位置未连接批标准化算子的情况下,向卷积运算算子的输出位置插入所述量化算子,得到待训练生成模型。
请参见图1d中的(1),若卷积运算算子Conv的输出位置未连接批标准化算子,则会向卷积运算算子的输出位置插入量化算子。
在另一种实施方式中,在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,预设量化策略也为向目标位置插入量化算子组合,其中,目标位置可以是输入量与所述卷积运算算子之间的位置。那么此时通过通过预设量化策略对所述目标算子进行量化处理,也即向输入量与所述卷积运算算子之间的位置插入量化算子组合,所述量化算子组合用于量化处理,所述量化算子组合包括量化算子和反量化算子。并在初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合;在所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子以及激活函数的情况下,不对所述卷积运算算子的输出进行量化,那么此时也就得到了待训练生成模型。
在一些实施例中,对于目标算子的数量为至少两个的情况,目标算子可以为:卷积运算算子Conv、批标准化算子(Batch Normalization,BN)以及激活函数ReLU形成的算子组合:Conv+BN+ReLU;目标算子也可以为:卷积运算算子Conv、批标准化算子(Batch Normalization,BN)以及加法运算算子(Addition Operation,Add)形成的算子组合:Conv+BN+Add。每个目标算子均有自身对应的目标位置。
量化算子组合包括量化算子和反量化算子。在查找出每个目标算子分别对应的至少一个目标位置之后,便可以向至少一个目标位置中的每个目标位置分别插入相应的量化算子组合,从而实现针对目标算子进行的量化处理。
在上述实施方式中,在所述目标算子为单个算子的情况下,可以对所述目标算子进行算子替换处理;在所述目标算子的数量为至少两个,也即目标算子为多算子组合,或所述目标算子为单个的卷积运算算子的情况下,可以向目标位置插入量化算子组合。上述两种处理方式实现了针对更多算子的覆盖,从而扩大了方案的适用范围。
在上述的实施方式中,通过对目标算子进行量化处理,可以简化目标算子的算子结构或改变输入量的数值类型,从而使得待训练生成模型的运算速度提升,并减少待训练生成模型的训练运算量。
在目标算子的数量为至少两个,或目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,还需要在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合,从而得到待训练生成模型。
请参见图1d中的(1)、图1e中的(1)以及图1f中的(1),若目标算子包括有 卷积运算算子Conv,则可以在输入量与卷积运算算子之间的位置插入量化算子组合:量化算子以及反量化算子。并且在同时,也会在初始生成模型中添加用于量化卷积运算算子的权重的量化算子组合:量化算子以及反量化算子。
在另一种实施方式中,在满足目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下:若目标算子还包含依次连接在所述卷积运算算子的输出位置的批标准化算子以及激活函数的情况下,不对所述卷积运算算子的输出进行量化。
请参见图1e中的(1),若卷积运算算子Conv的输出位置依次连接有批标准化算子BN以及激活函数ReLU的组合,则不再对所述卷积运算算子的输出进行量化。
在又一种实施方式中,在目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子,且目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子,且批标准化算子还与加法运算算子的第一输入分支连接的情况下,则不对所述卷积运算算子的输出进行量化,向加法运算算子的第二输入分支插入量化算子组合,并向所述加法运算算子的输出的位置插入所述量化算子。
请参见图1f中的(1),若目标算子的输出位置连接有批标准化算子BN,且所述批标准化算子BN还与加法运算算子Add的第一输入分支连接,则不对所述卷积运算算子的输出进行量化,向加法运算算子Add的第二输入分支插入量化算子组合:量化算子以及反量化算子,并向所述加法运算算子Add的输出的位置插入所述量化算子。
量化算子为能够执行量化操作(Quantization)的算子。在生成模型中,量化操作通常指:对输入量进行离散化处理,使输入量适应于低比特位(bit)的表示和存储,从而减小模型的内存占用和能耗。
反量化算子为能够执行反量化操作(Dequantization)的算子。在生成模型中,反量化操作通常指:将经量化操作的数据重新还原为高精度的浮点数或整数。反量化操作是量化操作的逆运算,可以将量化带来的信息损失恢复。
其中,顺次插入量化算子以及反量化算子构成一个伪量化结点,详情请参见图1d中的(1)示出的虚线框。
在一种实施方式中,对于Conv+BN+ReLU来说,详情请参见图1e中的(1),可以先查找到连续的Conv+BN+ReLU的位置,然后获取Conv+BN+ReLU对应的至少一个目标位置。详情请参见图1e中的(1),输入量与Conv之间便是Conv+BN+ReLU对应的目标位置。
随后,便可以在每个目标位置分别插入相应的算子组合,接上文的举例继续进行说明:详情请参见图1e中的(1),可以在输入量与Conv之间顺次插入量化算子以及反量化算子;除了在输入量与Conv之间顺次插入量化算子以及反量化算子以外,还需要针对Conv的权重添加量化算子组合,即顺次插入量化算子以及反量化算子,如图1e中的(1)所示。
对于Conv+BN+Add来说,详情请参见图1f中的(1),可以先查找到连续的Conv+BN+Add的位置,然后获取Conv+BN+Add对应的至少一个目标位置。详情请参见图1f中的(1),输入量一与Add之间、输入量二与Conv之间、以及Add与输出量之间均是Conv+BN+Add对应的目标位置。
随后,便可以在每个目标位置分别插入相应的算子组合,接上文的举例继续进行说明:详情请参见图1f中的(1),可以在输入量一与Add之间顺次插入量化算子以及反量化算子;可以在输入量二与Conv之间顺次插入量化算子以及反量化算子;可以在Add与输出量之间插入量化算子。除了上述添加的量化算子以及反量化算子以外,还需要针对Conv的权重添加量化算子组合,即顺次插入量化算子以及反量化算子,如图1f中的(1)所示。
在一种实施方式中,量化算子进行量化操作的实现过程可以为:采用对称量化的方式实现量化操作。即:将正负数范围对称的浮点数区间等比例地映射到整数区间[-a,a]。其中,a的取值为正整数。在一些实施例中,a可以为127。
由于浮点数的分布通常情况下并不对称,因此可以先对浮点数的分布范围进行截取处理,即对于完整的浮点数的分布范围,可以选取浮点数分布较为频繁的正负对称区域进行数值截取。
在完成浮点数的分布范围截取之后,可以使用给定的缩放因子(scale)和偏移量(zero_point)建立起浮点数映射至整数的映射关系:
xq=round(x/scale+zero_point)
其中,x为浮点数,xq为映射后对应的整数,round()指的是向下取整。
在上述的实施方式中,可以基于浮点数的分布范围[-cmax,cmax]以及整数区间[-a,a]计算缩放因子scale。其中,浮点数的分布范围[-cmax,cmax]可以由工作人员基于观察获得,即工作人员可以通过观察,选取浮点数分布较为频繁的正负对称区域进行数值截取。[-a,a]可以为预先设置的固定值。应当理解,a在满足为正整数的前提下,其具体取值范围不应该理解为是对本申请的限制。
本申请实施例除了通过上述过程实现量化操作外,还可以通过多种方法实现,包括:滑动平均方法、直方图统计方法等。实现量化操作的实现过程同样不应该理解为是对本申请的限制。
在上述的实施方式中,在查找出每个目标算子分别对应的至少一个目标位置之后,便可以向至少一个目标位置中的每个目标位置分别插入相应的量化算子组合,从而实现针对目标算子进行的量化处理,实现简化模型结构或改变数值类型的效果,利于缩减模型运算时间。
在一种具体实施方式中,步骤“向目标位置插入量化算子组合”可以包括如下步骤A1至步骤A2:
A1、获取所述目标位置对应的输入量的数值类型。
数值类型是计算机编程中最基本和常用的数据类型之一,用于存储和操作各种数值数据,如整数、浮点数、复数等。
A2、基于所述输入量的数值类型,确定对应的量化算子组合。
在上述的实施方式中,可以依据目标位置对应的输入量的数值类型,确定目标位置处所插入的量化算子组合,从而有助于实现训练后模型的数值类型的统一。
在一种具体实施方式中,步骤A2可以包括如下步骤A21至步骤A22:
A21、若所述输入量的数值类型为浮点数,则确定对应的所述量化算子组合包括量化算子和反量化算子。
示例性地,浮点数可以为32位浮点数(32-bit Floating-point Numbers)。若输入量的数值类型是浮点数,则可以将该浮点数数值类型的输入量依次经过量化算子和反量化算子,从而对该浮点数数值类型的输入量依次进行量化操作处理和反量化操作处理,使得得到的结果的数值类型依然为浮点数。
A22、若所述输入量的数值类型为整数,则确定对应的所述量化算子组合为反量化操作算子。
示例性地,整数可以为8位整数(8-bit Integer)。若输入量的数值类型是整数,则可以将该整数数值类型的输入量经过反量化算子,从而对该整数数值类型的输入量进行反量化操作处理,使得得到的结果的数值类型变为浮点数。
在上述的实施方式中,无论输入量是浮点数类型还是整数类型,均可以通过引入对应的量化算子组合的方式,将输出的结果的数值类型调整为浮点数类型,从而为模型的后续运算做好铺垫,进一步提高模型的运算速度。
在一种具体实施方式中,步骤130可以包括:在所述目标算子所属的模型结构未包含在目标结构名单的情况下,通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型。
相应的,本申请实施例还可以包括如下步骤:在所述目标算子所属的模型结构包含在目标结构名单的情况下,维持所述目标算子不变。
目标结构名单为工作人员依据工作经验设定的结构白名单。在一些实施例中,位于目标结构名单中的模型结构可以为需要保持输出数据精度的模型结构。
在上述的实施方式中,若目标算子所属的模型结构位于目标结构名单中,即使目标算子满足预设量化策略,则依然可以维持目标算子保持不变,即不对目标算子进行量化。
通过上述的处理过程,可以在需要保持数据精度的模型结构处维持目标算子不变,不进行算子调整,例如,可以在模型的最后几层(layer)处不做量化处理,请参见图1g,图1g示出的实线框位置的Conv便可以不进行算子调整处理。通过上述过程,可以在维持生成模型的输出精度与运算速度两方面实现一定程度的兼顾。
140、利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
在一种具体实施方式中,步骤140可以包括如下步骤141至步骤144:
141、利用所述待训练生成模型对训练输入对象进行采样处理,得到随机向量。
142、利用所述待训练生成模型对所述随机向量进行生成处理,得到新生成对象。
143、基于所述新生成对象和所述训练输入对象,计算损失值。
为便于描述,不妨以待训练生成模型是生成式对抗网络(Generative Adversarial Networks,GAN)为例进行说明。GAN由两个神经网络组成:生成器(Generator)和判别器(Discriminator)。
相应的,GAN的损失函数主要由两部分构成:生成器的损失函数和判别器的损失函数。
(1)生成器的损失函数
生成器的目标是生成尽可能逼真的样本,其损失函数如公式(1)所示:
L_G=-log(D(G(z)))             (1);
其中,z是从先验分布中采样得到的噪声,G代表生成器,D代表判别器。
(2)判别器的损失函数
判别器的目标是判断输入数据是真实数据还是生成数据,其损失函数可以分为公式(2)和公式(3)示出的两部分:
L_D_real=-log(D(x))           (2);
L_D_fake=-log(1-D(G(z))              (3);
其中,x是真实数据,G代表生成器,D代表判别器,z是从先验分布中采样得到的噪声。L_D_real表示判别器将真实数据判断为真实数据时的损失函数,L_D_fake表示判别器将生成数据判断为真实数据时的损失函数。
因此,判别器的损失函数如公式(4)所示:
L_D=L_D_real+L_D_fake                (4);
判别器的最终目标是最大化真实数据的判别概率,并最小化生成数据的判别概率。
综上所述,GAN的总体损失函数如公式(5)所示:
L=L_D+L_G                      (5);
在每一次迭代过程中,使用给定的参数计算出损失函数的运算结果,便可以得到该次迭代过程对应的损失值。
144、若损失值满足目标要求,则判定所述待训练生成模型训练完成,得到训练后生成模型。
目标要求为预先设置的要求。在一种实施方式中,对于多次训练过程获取到的多个损失值,若多个损失值收敛,确定损失值满足目标要求,此时判定待训练生成模型训练完成,得到训练后生成模型。
在上述的实施方式中,可以先得到算子经过调整的初始生成模型,然后基于上述的步骤141至步骤144对上述的模型进行训练,从而得到训练完成的训练后生成模型。初始生成模型在算子经过调整之后,模型的运算速度得到加快,运算时长得到缩短。对算子经过调整的初始生成模型进行训练,可以兼顾模型的结果输出的准确以及运算速度的加快。
在一些实施例中,量化算子组合包含量化算子和反量化算子。相应的,本申请实施例还可以包括如下步骤150:
150、根据删除所述反量化算子后的所述训练后生成模型,得到目标生成模型。
目标生成模型可以支持原生TorchScript部署方式。TorchScript是PyTorch框架中的一个功能,它可以将训练好的PyTorch模型转换为一种序列化和可重用的格式,以便在其他环境中使用,其他环境例如:在C++、Java或JavaScript等其他编程语言中。
在一些实施例中,可以通过删除反量化算子的方式对训练后生成模型进行调整,从而得到目标生成模型。
在一种具体实施方式中,步骤150可以包括:
若训练后生成模型中包括卷积运算算子,且所述卷积运算算子的输出位置未连接批标准化算子,则删除输入量与所述卷积运算算子之间的反量化算子,删除所述卷积运算算子的输出位置的量化算子,以及将所述卷积运算算子的权重以整数的数值类型表示。
接上文的举例继续进行说明:
请参见图1d中的(2),图1d中的(2)可以由图1d中的(1)经算子简化处理得到;图1d中的(2)示出的模型结构与图1d中的(1)示出的模型结构相比,删除了输入量与所述卷积运算算子之间的反量化算子,删除了所述卷积运算算子的输出位置的量化算子,并且将所述卷积运算算子的权重以整数的数值类型表示。上述实施方式中,在简化模型结构的同时,还将图1d中的(2)示出的Conv的输入量以及输出量由原本的浮点数调整成为整数,进一步简化了运算量。
在另一种具体实施方式中,步骤150可以包括:
若训练后生成模型中包括卷积运算算子、批标准化算子以及激活函数的组合,则删除输入量与所述卷积运算算子之间的反量化算子,将所述卷积运算算子的权重以整数的数值类型表示,并将卷积运算算子、批标准化算子以及激活函数的组合融合为新的卷积运算算子。
请参见图1e中的(2),图1e中的(2)可以由图1e中的(1)经算子融合处理得到;图1e中的(2)示出的模型结构与图1e中的(1)示出的模型结构相比,删除了输入量与所述卷积运算算子之间的反量化算子,并将所述卷积运算算子的权重以整数的数值类型表示,还将卷积运算算子、批标准化算子以及激活函数的组合融合为新的卷积运算算子。上述实施方式中,在简化模型结构的同时,还将图1e中的(2)示出的Conv的输入量以及输出量由原本的浮点数调整成为整数,进一步简化了运算量。
在又一种具体实施方式中,步骤150可以包括:
若训练后生成模型中包括卷积运算算子、批标准化算子以及加法运算算子的组合,则删除第一输入量与所述加法运算算子之间的反量化算子,删除第二输入量与所述卷积运算算子之间的反量化算子,删除所述加法运算算子输出位置的量化算子,将所述卷积运算算子的权重以整数的数值类型表示,并将卷积运算算子、批标准化算子以及加法运算算子的组合融合为新的卷积运算算子。
请参见图1f中的(2),图1f中的(2)可以由图1f中的(1)经算子融合处理得到;图1f中的(2)示出的模型结构与图1f中的(1)示出的模型结构相比,删除了输入量一与加法运算算子之间的反量化算子,删除了输入量二与卷积运算算子之间的反量化算子,删除了加法运算算子输出位置的量化算子,将所述卷积运算算子的权重以整数的数值类型表示;并且将卷积运算算子、批标准化算子以及加法运算算子的组合融合为新的卷积运算算子。上述实施方式中,在简化模型结构的同时,还将图1f中的(2)示出的Conv的两个输入量以及输出量由原本的浮点数调整成为整数,进一步简化了运算量。
在步骤150得到目标生成模型后,可以对目标生成模型进行导出处理,导出处理过程如下:
将目标生成模型保存为CheckPoint格式文件;
定义量化网络,该量化网络与目标生成模型的网络格式相同;
加载上述保存的CheckPoint格式文件;
导出目标生成模型。
在一种具体实施方式中,在步骤150之后,本申请实施例还可以包括如下步骤160:
160、利用目标生成模型对输入对象进行处理,生成新的对象数据。
输入对象为能够被生成模型生成的数据,例如图像、文本或音频等。
在上述的实施方式中,目标生成模型既被简化了模型结构,又被调整了输入量以及输出量的数值类型,因此可以尽可能地提高目标生成模型的运算效率。
本申请实施例提供的数据处理方法中,可以先获取初始生成模型,然后从初始生成模型中查找目标算子。在查找到目标算子之后,可以根据目标算子的类别,通过预设量化策略对目标算子进行量化处理,从而得到经过量化处理的初始生成模型,并将其记为待训练生成模型。随后,可以利用训练输入对象对待训练生成模型进行训练,从而得到训练后生成模型。本申请实施例中,目标算子为一个算子或按照设定顺序排列的多个算子组成的组合。因此,可以先获取初始生成模型,并从初始生成模型中查找目标算子。然后基于目标算子的类别所对应的预设量化策略,对目标算子进行量化处理,得到经过量化处理的初始生成模型,随后对上述的模型进行训练,得到训练后生成模型。通过针对目标算子的查找以及量化处理,可以简化初始生成模型的模型结构,从而可以提高模型的训练效率;并且查找预先设定的目标算子,以及依据相应的预设量化策略实现对目标算子进行量化处理的处理步骤可以批量应用于生成模型的训练中。
本申请实施例可以改善现有技术耗费时间较多且工作效率较低的问题。
根据上述实施例所描述的方法,以下将作进一步详细说明。
在本实施例中,将以生成模型是GAN,输入对象是图像为例,对本申请实施例的方法进行详细说明。
如图2所示,本申请实施例提供的数据处理方法的实现流程如下:
201、获取初始生成模型,从所述初始生成模型中确定待量化的目标算子。
202、根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略。
203、在所述目标算子的数量为一个的情况下,对所述目标算子进行算子替换处理,得到待训练生成模型。
204、在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,或所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,确定所述预设量化策略为向目标位置插入量化算子组合,所述量化算子组合用于量化处理,所述量化算子组合包括量化算子和反量化算子。
在一些实施例中,上述步骤203以及步骤204均可以在目标算子所属的模型结构未包含在目标结构名单的情况下实现。在所述目标算子所属的模型结构包含在目标结构名单的情况下,维持所述目标算子不变。
在一些实施例中,步骤204具体可以包括:在所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,向输入量与所述卷积运算算子之间的位置插入量化算子组合;在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合,在所述卷积运算算子的输出位置连接批标准化算子的情况下,得到待训练生成模型。
在一种具体实施方式中,本申请实施例还可以包括:在所述卷积运算算子的输出位置未连接批标准化算子的情况下,向所述卷积运算算子的输出位置插入所述量化算子,得到待训练生成模型。
在一种具体实施方式中,本申请实施例还可以包括:在目标算子为所述卷积运算算子的情况下,向所述卷积运算算子的输出位置插入所述量化算子。
在一些实施例中,步骤204具体可以包括:在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,向输入量与所述卷积运算算子之间的位置插入量化算子组合;在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合;在所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子以及激活函数的情况下,得到待训练生成模型。
在又一种具体实施方式中,本申请实施例还可以包括:在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子,且所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子,且所述批标准化算子还与加法运算算子的第一输入分支连接的情况下,不对所述卷积运算算子的输出进行量化,向加法运算算子的第二输入分支插入量化算子组合,并向所述加法运算算子的输出位置插入所述量化算子。
205、利用所述待训练生成模型对训练输入对象进行采样处理,得到随机向量。
206、利用所述待训练生成模型对所述随机向量进行生成处理,得到新生成对象。
207、基于所述新生成对象和所述训练输入对象,确定损失值。
208、当损失值满足目标要求时,确定所述待训练生成模型训练完成,得到训练后生成模型。
209、根据删除所述反量化算子后的所述训练后生成模型,得到目标生成模型。
210、利用目标生成模型对输入图像进行处理,生成新的图像数据。
关于步骤201至步骤210的执行过程在上文已经进行说明,步骤201至步骤210的执行过程可参考上文说明。
本申请实施例提供的数据处理方法中,可以先获取初始生成模型,然后从初始生成模型中确定出待量化的目标算子,并根据目标算子的类别和数量,通过预设量化策略对目标算子进行量化处理,从而得到经过量化处理的初始生成模型,并将其记为待训练生成模型。随后,可以利用训练输入对象对待训练生成模型进行训练,从而得到训练后生成模型。本申请实施例中,目标算子为一个算子或按照设定顺序排列的多个算子组成的组合。因此,可以先获取初始生成模型,并从初始生成模型中查找目标算子。然后基于目标算子的类别所对应的预设量化策略,对目标算子进行量化处理,得到经过量化处理的初始生成模型,随后对上述的模型进行训练,得到训练后生成模型。通过针对目标算子的查找以及量化处理,可以简化初始生成模型的模型结构,从而可以提高模型的训练效率;并且查找预先设定的目标算子,以及依据相应的预设量化策略实现对目标算子进行量化处理的处理步骤可以批量应用于生成模型的训练中。
本申请实施例可以改善现有技术耗费时间较多且工作效率较低的问题。
为了更好地实施以上方法,本申请实施例还提供一种数据处理装置,该数据处理装置可以集成在电子设备中,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、或者个人电脑(Personal Computer,PC)等设备;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。比如,在本实施例中,将以数据处理装置集成在电子设备的终端为例,对本申请实施例的方法进行说明。
例如,如图3所示,该数据处理装置可以包括:
模型获取单元301,配置为获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;
策略确定单元302,配置为根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;
量化处理单元303,配置为通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;
模型训练单元304,配置为利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
在一种实施方式中,策略确定单元302,还配置为在所述目标算子的数量为一个的情况下,确定所述预设量化策略为对所述目标算子进行算子替换处理。
对应地,量化处理单元303,还配置为获取目标算子的输入量方向的算子组合,并确定量化算子;利用所述量化算子替换所述算子组合,得到待训练生成模型。
在一种实施方式中,策略确定单元302,还配置为在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,或所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,确定所述预设量化策略为向目标位置插入量化算子组合,所述量化算子组合用于量化处理,所述量化算子组合包括量化算子和反量化算子。
在一种实施方式中,量化处理单元303,还配置为在所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,向输入量与所述卷积运算算子之间的位置插入量化算子组合;在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合,在所述卷积运算算子的输出位置连接批标准化算子的情况下,得到待训练生成模型。
在一种实施方式中,所述装置还包括:量化算子插入单元,配置为在所述卷积运算算子的输出位置未连接批标准化算子的情况下,向所述卷积运算算子的输出位置插入所述量化算子,得到待训练生成模型。
在一种实施方式中,量化处理单元303,还配置为在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,向输入量与所述卷积运算算子之间的位置插入量化算子组合;在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合;在所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子以及激活函数的情况下,得到待训练生成模型。
在一种实施方式中,所述装置还包括:组合单元,配置为在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子,且所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子,且所述批标准化算子还与加法运算算子的第一输入分支连接的情况下,不对所述卷积运算算子的输出进行量化,向所述加法运算算子的第二输入分支插入量化算子组合,并向所述加法运算算子的输出位置插入所述量化算子。
在一种实施方式中,模型训练单元304,包括:
采样处理子单元,配置为利用所述待训练生成模型对训练输入对象进行采样处理,得到随机向量;
生成处理子单元,配置为利用所述待训练生成模型对所述随机向量进行生成处理,得到新生成对象;
损失值计算子单元,配置为基于所述新生成对象和所述训练输入对象,计算损失值;
模型训练子单元,配置为当损失值满足目标要求时,确定所述待训练生成模型训练完成,得到训练后生成模型。
在一种实施方式中,量化处理单元303,还配置为在所述目标算子所属的模型结构未包含在目标结构名单的情况下,根据所述目标算子的类别,对所述目标算子进行量化处理,得到经过量化处理的初始生成模型;
所述装置还包括:
组合维持单元,配置为在所述目标算子所属的模型结构包含在目标结构名单的情况下,维持所述目标算子不变。
在一种实施方式中,所述量化算子组合包含量化算子和反量化算子;相应的,所述装置还包括:
算子删除单元,配置为根据删除所述反量化算子后的所述训练后生成模型,得到目标生成模型。
具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元的具体实施可参见前面的方法实施例,在此不再赘述。
本申请实施例提供的数据处理方法中,可以先获取初始生成模型,然后从初始生成模型中查找目标算子。在查找到目标算子之后,可以根据目标算子的类别,通过预设量化策略对目标算子进行量化处理,从而得到经过量化处理的初始生成模型,并将其记为待训练生成模型。随后,可以利用训练输入对象对待训练生成模型进行训练,从而得到训练后生成模型。本申请实施例中,目标算子为一个算子或按照设定顺序排列的多个算子组成的组合。因此,可以先获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。通过针对目标算子的查找以及量化处理,可以简化初始生成模型的模型结构,从而可以提高模型的训练效率;并且查找预先设定的目标算子,以及依据相应的预设量化策略实现对目标算子进行量化处理的处理步骤可以批量应用于生成模型的训练中。
本申请实施例可以改善现有技术耗费时间较多且工作效率较低的问题。
本申请实施例还提供一种电子设备,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、个人电脑,等等;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群,等等。
在一些实施例中,该数据处理装置还可以集成在多个电子设备中,比如,数据处理装置可以集成在多个服务器中,由多个服务器来实现本申请的数据处理方法。
在本实施例中,将以本实施例的电子设备是服务器为例进行详细描述,图4是本申请实施例提供的电子设备的结构示意图,如图4所示:该电子设备可以包括一个或者一个以上处理核心的处理器401、一个或一个以上计算机可读存储介质的存储器402、电源403、输入模块404以及通信模块405等部件。本领域技术人员可以理解,图4中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或 者组合某些部件,或者不同的部件布置。其中:
处理器401是该电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器402内的软件程序和/或模块,以及调用存储在存储器402内的数据,执行电子设备的各种功能和处理数据。在一些实施例中,处理器401可包括一个或多个处理核心;在一些实施例中,处理器401可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器401中。
存储器402可用于存储软件程序以及模块,处理器401通过运行存储在存储器402的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器402可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器402还可以包括存储器控制器,以提供处理器401对存储器402的访问。
电子设备还包括给各个部件供电的电源403,在一些实施例中,电源403可以通过电源管理系统与处理器401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源403还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
该电子设备还可包括输入模块404,该输入模块404可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。
该电子设备还可包括通信模块405,在一些实施例中通信模块405可以包括无线模块,电子设备可以通过该通信模块405的无线模块进行短距离无线传输,从而为用户提供了无线的宽带互联网访问。比如,该通信模块405可以用于帮助用户收发电子邮件、浏览网页和访问流式媒体等。
尽管未示出,电子设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,电子设备中的处理器401会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器402中,并由处理器401来运行存储在存储器402中的应用程序,从而实现各种功能,如下:
先获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例提供一种计算机可读存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本申请实施例所提供的任一种数据处理方法中的步骤。例如,该指令可以执行如下步骤:
获取初始生成模型;从所述初始生成模型中查找目标算子;根据所述目标算子的类别,通过预设量化策略对所述目标算子进行量化处理,得到经过量化处理的初始生成模型,记为待训练生成模型;利用训练输入对象对所述待训练生成模型进行训练,得到训 练后生成模型。
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
根据本申请的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述实施例中提供的各种可选实现方式中提供的方法。
由于该存储介质中所存储的指令,可以执行本申请实施例所提供的任一种数据处理方法中的步骤,因此,可以实现本申请实施例所提供的任一种数据处理方法所能实现的有益效果,详见前面的实施例,在此不再赘述。
以上对本申请实施例所提供的一种数据处理方法、装置、电子设备和计算机可读存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (14)

  1. 一种数据处理方法,应用于电子设备,所述方法包括:
    获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;
    根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;
    通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;
    利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
  2. 如权利要求1所述的方法,其中,所述根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略,包括:
    在所述目标算子的数量为一个的情况下,确定所述预设量化策略为对所述目标算子进行算子替换处理;
    对应地,通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型,包括:
    获取目标算子的输入量方向的算子组合,并确定量化算子;
    利用所述量化算子替换所述算子组合,得到待训练生成模型。
  3. 如权利要求1所述的方法,其中,所述根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略,包括:
    在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,或所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,确定所述预设量化策略为向目标位置插入量化算子组合,所述量化算子组合用于量化处理,所述量化算子组合包括量化算子和反量化算子。
  4. 如权利要求3所述的方法,其中,所述通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型,包括:
    在所述目标算子的数量为一个,且所述目标算子的类别为卷积运算算子的情况下,向输入量与所述卷积运算算子之间的位置插入量化算子组合;
    在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合,在所述卷积运算算子的输出位置连接批标准化算子的情况下,得到待训练生成模型。
  5. 如权利要求4中所述的方法,其中,所述方法还包括:
    在所述卷积运算算子的输出位置未连接批标准化算子的情况下,向所述卷积运算算子的输出位置插入所述量化算子,得到待训练生成模型。
  6. 如权利要求3所述的方法,其中,所述通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型,包括:
    在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子的情况下,向输入量与所述卷积运算算子之间的位置插入量化算子组合;
    在所述初始生成模型中添加,用于量化所述卷积运算算子的权重的量化算子组合;
    在所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子以及激活函数的情况下,得到待训练生成模型。
  7. 如权利要求6所述的方法,其中,所述方法还包括:
    在所述目标算子的数量为至少两个,且所述目标算子中包括卷积运算算子,且所述目标算子中包含依次连接在所述卷积运算算子的输出位置的批标准化算子,且所述批标准化算子还与加法运算算子的第一输入分支连接的情况下,不对所述卷积运算算子的输出进行量化,向所述加法运算算子的第二输入分支插入量化算子组合,并向所述加法运算算子的输出位置插入所述量化算子。
  8. 如权利要求1至7任一项所述的方法,其中,所述利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型,包括:
    利用所述待训练生成模型对训练输入对象进行采样处理,得到随机向量;
    利用所述待训练生成模型对所述随机向量进行生成处理,得到新生成对象;
    基于所述新生成对象和所述训练输入对象,确定损失值;
    当所述损失值满足目标要求时,确定所述待训练生成模型训练完成,得到训练后生成模型。
  9. 如权利要求1至7任一项所述的方法,其中,所述通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型包括:
    在所述目标算子所属的模型结构未包含在目标结构名单的情况下,通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;
    所述方法还包括:
    在所述目标算子所属的模型结构包含在目标结构名单的情况下,维持所述目标算子不变。
  10. 如权利要求1至7中任意一项所述的方法,其中,所述量化算子组合包含量化算子和反量化算子;
    所述方法还包括:
    根据删除所述反量化算子后的所述训练后生成模型,得到目标生成模型。
  11. 一种数据处理装置,所述装置包括:
    模型获取单元,配置为获取初始生成模型,从所述初始生成模型中确定待量化的目标算子;
    策略确定单元,配置为根据所述目标算子的类别和数量,确定对所述目标算子进行量化处理的预设量化策略;
    量化处理单元,配置为通过所述预设量化策略对所述目标算子进行量化处理,得到待训练生成模型;
    模型训练单元,配置为利用训练输入对象对所述待训练生成模型进行训练,得到训练后生成模型。
  12. 一种电子设备,包括处理器和存储器,所述存储器存储有多条指令;所述处理器从所述存储器中加载指令,以执行如权利要求1至10任一项所述的数据处理方法中的步骤。
  13. 一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1至10任一项所述的数据处理方法中的步骤。
  14. 一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现权利要求1至10任一项所述的数据处理方法中的步骤。
PCT/CN2023/130346 2023-06-19 2023-11-08 数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品 Ceased WO2024259877A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US19/309,132 US20250378331A1 (en) 2023-06-19 2025-08-25 Data processing method and apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310733698.7A CN116975628A (zh) 2023-06-19 2023-06-19 数据处理方法、装置、电子设备、存储介质和程序产品
CN202310733698.7 2023-06-19

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US19/309,132 Continuation US20250378331A1 (en) 2023-06-19 2025-08-25 Data processing method and apparatus, electronic device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2024259877A1 true WO2024259877A1 (zh) 2024-12-26

Family

ID=88473996

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/130346 Ceased WO2024259877A1 (zh) 2023-06-19 2023-11-08 数据处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品

Country Status (3)

Country Link
US (1) US20250378331A1 (zh)
CN (1) CN116975628A (zh)
WO (1) WO2024259877A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116975628A (zh) * 2023-06-19 2023-10-31 腾讯科技(深圳)有限公司 数据处理方法、装置、电子设备、存储介质和程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022088063A1 (zh) * 2020-10-30 2022-05-05 华为技术有限公司 神经网络模型的量化方法和装置、数据处理的方法和装置
WO2022111617A1 (zh) * 2020-11-30 2022-06-02 华为技术有限公司 一种模型训练方法及装置
WO2023279935A1 (zh) * 2021-07-06 2023-01-12 京东科技信息技术有限公司 目标重识别模型的训练方法、目标重识别方法及装置
WO2023011002A1 (zh) * 2021-08-05 2023-02-09 鹏城实验室 溢出感知的量化模型训练方法、装置、介质及终端设备
CN116975628A (zh) * 2023-06-19 2023-10-31 腾讯科技(深圳)有限公司 数据处理方法、装置、电子设备、存储介质和程序产品

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022088063A1 (zh) * 2020-10-30 2022-05-05 华为技术有限公司 神经网络模型的量化方法和装置、数据处理的方法和装置
WO2022111617A1 (zh) * 2020-11-30 2022-06-02 华为技术有限公司 一种模型训练方法及装置
WO2023279935A1 (zh) * 2021-07-06 2023-01-12 京东科技信息技术有限公司 目标重识别模型的训练方法、目标重识别方法及装置
WO2023011002A1 (zh) * 2021-08-05 2023-02-09 鹏城实验室 溢出感知的量化模型训练方法、装置、介质及终端设备
CN116975628A (zh) * 2023-06-19 2023-10-31 腾讯科技(深圳)有限公司 数据处理方法、装置、电子设备、存储介质和程序产品

Also Published As

Publication number Publication date
CN116975628A (zh) 2023-10-31
US20250378331A1 (en) 2025-12-11

Similar Documents

Publication Publication Date Title
CN116663525B (zh) 一种文档审核方法、装置、设备及存储介质
US20230334325A1 (en) Model Training Method and Apparatus, Storage Medium, and Device
US8494996B2 (en) Creation and revision of network object graph topology for a network performance management system
CN112036125B (zh) 一种文档管理方法、装置及计算机设备
CN118170360A (zh) 请求处理的方法、装置、设备和存储介质
CN114357180B (zh) 知识图谱的更新方法及电子设备
CN115392592B (zh) 一种存储产品参数配置推荐方法、装置、设备及介质
US20250378331A1 (en) Data processing method and apparatus, electronic device, and computer-readable storage medium
CN118520975A (zh) 一种大语言模型训练方法、装置、电子设备及存储介质
CN108875035A (zh) 分布式文件系统的数据存储方法及相关设备
CN118884232A (zh) 电池健康状态评估方法、装置、设备及存储介质
CN118520115A (zh) 基于rpa和ai技术的信息管理系统及方法
CN111783843A (zh) 一种特征选择方法、装置及计算机系统
CN118070879B (zh) 一种模型更新方法、装置、设备及可读存储介质
CN120706547A (zh) 智能计算中心云平台基于算力资源动态调整的推理加速方法及装置
WO2025194818A1 (zh) 生成查询指令的方法、装置、设备和存储介质
CN111582346A (zh) 一种图像识别方法、设备、电子设备和存储介质
EP4293540A1 (en) Model recommendation method and apparatus, and computer device
CN119494296A (zh) 动作预测、训练方法、程序产品、电子设备和芯片系统
CN116760020A (zh) 基于lstm的办公建筑能耗短期预测优化方法及系统
CN115543428A (zh) 一种基于策略模板的模拟数据生成方法和装置
CN113886401A (zh) 一种数据纳管方法、装置、设备和计算机可读存储介质
CN114942961A (zh) 一种基于ai和数字孪生技术的素材可视化调取方法及系统
CN119759591B (zh) 面向普惠算力智能计算中心算力资源垃圾删除方法及装置
CN110674179A (zh) 一种查询接口的生成方法、装置及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23942144

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE