Method for training neural network model, method and device for data processing

By stacking building units and using multiple data to be trained to update parameters, the problem of optimizing the structural parameters and weight parameters of the neural network model in multimedia data recognition is solved, and the recognition accuracy and stability of the model are improved.

CN112561028BActive Publication Date: 2024-10-22HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910914033.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-25
Publication Date
2024-10-22
Estimated Expiration
2039-09-25

AI Technical Summary

Technical Problem

It is difficult to ensure the stability and recognition performance of the model when training a neural network model with the existing technology. Especially in multimedia data recognition tasks, it is difficult to optimize the structural parameters and weight parameters to simultaneously improve the recognition accuracy.

Method used

By acquiring multiple building units and stacking them to form an initial neural network model, the first to-be-trained data and the second to-be-trained data are used to update the weight parameters and structural parameters respectively, and the gradient values ​​are used to optimize the parameters to ensure the recognition performance of the model.

Benefits of technology

The recognition accuracy and stability of the neural network model in multimedia data recognition are improved, the recognition performance of the model is increased, and the accurate processing of multimedia data is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112561028B_ABST
    Figure CN112561028B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of computer vision in the field of artificial intelligence. The present application provides a method for training a neural network model, including: obtaining multiple building units and data to be trained; stacking multiple building units to obtain an initial neural network model, the parameters of the initial neural network model include structural parameters and weight parameters; inputting the data to be trained into the initial neural network model, and updating the structural parameters according to the gradient value obtained by calculating the second-order gradient of the weight parameters according to the first loss function, so as to obtain a neural network model that meets the preset requirements and is used to identify multimedia data, and the first loss function is used to update the weight parameters. The present application provides a method for training a neural network model, a method and a device for data processing, with the aim of providing a method for accurately identifying multimedia data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision in the field of artificial intelligence, and more specifically, to a method for training a neural network model, a method and device for data processing. Background Art

[0002] Artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is also the study of the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, basic AI theory, etc.

[0003] As an important branch of artificial intelligence, neural network (NN) is a network structure that imitates the behavioral characteristics of animal neural networks to process information. The structure of a neural network is composed of a large number of nodes (or neurons) connected to each other. It processes information by learning and training input information based on a specific operation model. A neural network includes an input layer, a hidden layer, and an output layer. The input layer is responsible for receiving input signals, the output layer is responsible for outputting the calculation results of the neural network, and the hidden layer is responsible for the calculation process such as learning and training. It is the memory unit of the network. The memory function of the hidden layer is represented by a weight matrix, and usually each neuron corresponds to a weight coefficient.

[0004] The structure of a neural network is often complex and diverse, which is conducive to obtaining stable test results. The reliability and stability of the neural network model obtained by artificial design are poor, so a neural network can be constructed by a neural architecture search (NAS) method. The neural network structure search method includes: defining a search space (the search space may include various types of building blocks, such as chain structure building blocks, multi-fork structure building blocks, cell-based building blocks, etc.); then determining multiple building blocks from the search space; then obtaining a search network by stacking the multiple building blocks; using a training data set to update the parameters in the search network, a neural network for solving specific problems or being applied to specific scenarios can be obtained. Therefore, in order to ensure that the final neural network has good stability and can accurately solve problems in actual scenarios, a solution for selecting optimal neural network model parameters should be provided. Summary of the invention

[0005] The present application provides a method for training a neural network model, a method and a device for data processing, aiming to provide a method for accurately identifying multimedia data.

[0006] In a first aspect, a method for training a neural network model is provided, comprising: obtaining a plurality of construction units, a first data to be trained, and a second data to be trained; stacking the plurality of construction units to obtain an initial neural network model, wherein the parameters of the initial neural network model include a structural parameter and a weight parameter; inputting the first data to be trained into the initial neural network model to obtain a first output result, wherein the first data to be trained is used to update the weight parameter; inputting the second data to be trained into the initial neural network model to obtain a second output result, wherein the second data to be trained is used to update the structural parameter; updating the structural parameter according to a first gradient value, a second gradient value, and a third gradient value to obtain a target neural network model that meets preset requirements and is used to identify multimedia data, wherein the first gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter using the second loss function, the second gradient value is a gradient value obtained by calculating a second-order gradient of the weight parameter using the first loss function, the third gradient value is a gradient value obtained by calculating a first-order gradient of the structural parameter using the second loss function, the first loss function is used to determine the similarity between a first label corresponding to the first data to be trained and the first output result, and the second loss function is used to determine the similarity between a second label corresponding to the second data to be trained and the second output result.

[0007] The data to be trained may be multimedia data, such as pictures, audio files (such as voice), video files, etc.

[0008] The data to be trained may be obtained, for example, from a database or storage medium, or by receiving data sent by other devices or equipment through a communication network, or by photographing with a camera, recording with a microphone, or the like.

[0009] The initial neural network model may be a neural network model that needs to train optimal structural parameters and optimal weight parameters, that is, it is not a neural network model with optimal structural parameters and optimal weight parameters. This application does not limit the type of the initial neural network model. The type of the initial neural network model may be a convolutional neural network model, a deep neural network model, etc.

[0010] Both the structural parameters and the weight parameters can be regarded as variables. By assigning specific values ​​to the structural parameters and the weight parameters, the initial neural network model can recognize the training data. By optimizing the values ​​assigned to the structural parameters and the weight parameters, the accuracy of the initial neural network model in recognizing data can be improved, and finally a neural network model with better recognition performance can be obtained.

[0011] The update of the weight parameter is based on the initial value of the weight parameter, for example, ω 1 =ω 0 +Δω, where ω 1 can be the updated weight parameter, ω 0 It can be the initial value of the weight parameter, and Δω can be the update amount of the weight parameter. In multiple iterations, the weight parameter can be updated multiple times. Then, the currently updated weight parameter can be regarded as the initial value of the weight parameter after the next update starts.

[0012] In order to improve the convergence of training optimal structural parameters and optimal weight parameters, different data can be input into the initial neural network model to update the structural parameters and weight parameters respectively. The main purpose of inputting the first data to be trained into the initial neural network model is to update the weight parameters. The main purpose of inputting the second data to be trained into the initial neural network model is to update the structural parameters.

[0013] The loss function is used to represent the similarity between the output result of the initial neural network model and the label of the input data. For example, when the similarity between the output result and the label of the input data is small, the function value of the loss function is large; when the similarity between the output result and the label of the input data is large, the function value of the loss function is small. The similarity between the output result and the input data can be represented by the similarity between feature 1 and feature 2, where feature 1 is used to characterize the input data and feature 2 is used to characterize the output result.

[0014] The first loss function in the present application corresponds to the weight parameter. That is, the first loss function is used to train the optimal weight parameter. For example, using the gradient descent method, the optimal weight parameter can be trained according to the gradient of the first loss function to the weight parameter. However, since the structural parameters in the initial neural network model are not optimal, the first loss function may include weight parameters (variables) and structural parameters (variables).

[0015] The second loss function in the present application corresponds to the structural parameters. That is, the second loss function is used to train the optimal structural parameters. For example, using the gradient descent method, the optimal structural parameters can be trained according to the gradient of the second loss function to the structural parameters. However, since the weight parameters in the initial neural network model are not optimal, the second loss function can include weight parameters (variables) and structural parameters (variables).

[0016] The specific expressions of the first gradient value, the second gradient value, and the third gradient value may all be in the form of vectors, matrices, etc. The first gradient value, the second gradient value, and the third gradient value may all be estimated values.

[0017] In one example, the value of the weight parameter (variable) in the second loss function may be the value of the most recently updated weight parameter. In one example, the value of the weight parameter (variable) in the second loss function may be the value obtained by updating the initial weight parameter, and the value of the initial weight parameter is the value of the most recently updated weight parameter.

[0018] In an embodiment of the present application, a machine can construct a neural network model architecture by stacking construction units; and, in the process of multiple iterations, comprehensive consideration of the influence of weight parameters and structural parameters on the iteration results is conducive to selecting appropriate neural network model parameters, thereby obtaining a neural network model that can accurately identify multimedia data such as pictures, audio, video, and text.

[0019] In combination with the first aspect, in some implementations of the first aspect, the method further includes: updating the weight parameter according to a fourth gradient value, where the fourth gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter by the first loss function.

[0020] In an embodiment of the present application, updating the weight parameters through the first-order gradient of the weight parameters by the first loss function is conducive to selecting a suitable update direction to reduce the error of updating the weight parameters and improve the efficiency of determining the weight parameters and structural parameters of the neural network model.

[0021] In one example, the updated weight parameter where λ 1 Update the learning rate for the weight parameters.

[0022] In combination with the first aspect, in some implementations of the first aspect, the second gradient value is expressed as:

[0023]

[0024] in, It is used to express the gradient of the weight parameter, L 1 (α,ω) is the first loss function, L 2 (α,ω) is the second loss function, α 0 is the structural parameter currently used, ω 1 is the updated weight parameter, and ε is the coefficient.

[0025] In the embodiment of the present application, since the value of the most recently updated weight parameter can be considered as the value with the closest similarity to the optimal weight parameter, selecting the updated weight parameter is conducive to improving the efficiency of determining the parameters of the neural network model; and updating the structural parameters after updating the weight parameters can reduce the impact of the weight parameters caused by the incorrect selection of the structural parameters. Since the first loss function is used to update the weight parameters, but the weight parameters in the initial neural network model are not the optimal weight parameters, the value of the weight parameter will affect the accuracy of the function value of the first loss function, thereby indirectly affecting the structural parameters updated based on the second loss function. In the present application, the impact of the value of the weight parameter on the first loss function can be considered through the second gradient value, which is conducive to improving the accuracy of the parameters of the neural network model.

[0026] In combination with the first aspect, in some implementations of the first aspect, the structural parameter is used to indicate a skip connection operation or a convolution operation.

[0027] In an embodiment of the present application, the method provided in the present application can accurately determine the parameters of the neural network model. Therefore, while the amount of calculation remains basically unchanged, the parameters to be determined in the neural network model can be increased. For example, the neural network model can include multiple data conversion operations.

[0028] In combination with the first aspect, in certain implementations of the first aspect, the multiple building units include a first building unit and a second building unit, the structural parameters include a first structural parameter corresponding to the first building unit and a second structural parameter corresponding to the second building unit, and the first structural parameter is different from the second structural parameter.

[0029] In an embodiment of the present application, the method provided in the present application can accurately determine the parameters of the neural network model. Therefore, while the amount of calculation remains basically unchanged, the parameters to be determined in the neural network model can be increased. For example, the optimal operations in multiple construction units can be determined separately.

[0030] In combination with the first aspect, in some implementations of the first aspect, any two building blocks among the multiple building blocks have the same structural type.

[0031] In a second aspect, a method for training a neural network model is provided, comprising: obtaining a plurality of building units, a third data to be trained, and a fourth data to be trained; stacking the plurality of building units to obtain an initial neural network model, wherein the parameters of the initial neural network model include structural parameters and weight parameters; inputting the third data to be trained into the initial neural network model to obtain a third output result, wherein the third data to be trained is used to update the weight parameters; inputting the fourth data to be trained into the initial neural network model to obtain a fourth output result, wherein the fourth data to be trained is used to update the structural parameters; updating the weight parameters according to a fifth gradient value, a sixth gradient value, and a seventh gradient value. The parameters are updated to obtain a neural network model that meets preset requirements and is used to identify multimedia data, the fifth gradient value is the gradient value obtained by the fourth loss function for the first-order gradient of the structural parameter, the sixth gradient value is the gradient value obtained by the third loss function for the second-order gradient of the structural parameter, the seventh gradient value is the gradient value obtained by the third loss function for the first-order gradient of the weight parameter, the third loss function is used to determine the similarity between the third label corresponding to the third data to be trained and the third output result, and the fourth loss function is used to determine the similarity between the fourth label corresponding to the fourth data to be trained and the fourth output result.

[0032] The data to be trained may be multimedia data, such as pictures, audio files (such as voice), video files, etc.

[0033] The data to be trained may be obtained, for example, from a database or storage medium, or by receiving data sent by other devices or equipment through a communication network, or by photographing with a camera, recording with a microphone, or the like.

[0034] The initial neural network model may be a neural network model that needs to train optimal structural parameters and optimal weight parameters, that is, it is not a neural network model with optimal structural parameters and optimal weight parameters. This application does not limit the type of the initial neural network model. The type of the initial neural network model may be a convolutional neural network model, a deep neural network model, etc.

[0035] Both the structural parameters and the weight parameters can be regarded as variables. By assigning specific values ​​to the structural parameters and the weight parameters, the initial neural network model can recognize the data. By optimizing the values ​​assigned to the structural parameters and the weight parameters, the accuracy of the initial neural network model in recognizing the data can be improved, and finally a neural network model with better recognition performance can be obtained.

[0036] The update of structural parameters is based on the initial value of the structural parameters, such as α 1 =α 0 +Δα, where α 1 can be the updated structural parameters, α 0 It can be the initial value of the structural parameter, and Δα can be the update amount of the structural parameter. In the process of multiple iterations, the structural parameter can be updated multiple times, then the currently updated structural parameter can be regarded as the initial value of the structural parameter after the next update starts.

[0037] In order to improve the convergence of training optimal structural parameters and optimal weight parameters, different data can be input into the initial neural network model to update the structural parameters and weight parameters respectively. The main purpose of inputting the first data to be trained into the initial neural network model is to update the weight parameters. The main purpose of inputting the second data to be trained into the initial neural network model is to update the structural parameters.

[0038] The loss function is used to represent the similarity between the output result of the initial neural network model and the label of the input data. For example, when the similarity between the output result and the label of the input data is small, the function value of the loss function is large; when the similarity between the output result and the label of the input data is large, the function value of the loss function is small. The similarity between the output result and the input data can be represented by the similarity between feature 1 and feature 2, where feature 1 is used to characterize the input data and feature 2 is used to characterize the output result.

[0039] The third loss function in the present application corresponds to the weight parameter. That is, the third loss function is used to train the optimal weight parameter. For example, using the gradient descent method, the optimal weight parameter can be trained according to the gradient of the third loss function to the weight parameter. However, since the structural parameters in the initial neural network model are not optimal, the third loss function may include weight parameters (variables) and structural parameters (variables).

[0040] The fourth loss function in the present application corresponds to the structural parameters. That is, the fourth loss function is used to train the optimal structural parameters. For example, using the gradient descent method, the optimal structural parameters can be trained according to the gradient of the fourth loss function to the structural parameters. However, since the weight parameters in the initial neural network model are not optimal, the fourth loss function can include weight parameters (variables) and structural parameters (variables).

[0041] The specific forms of expression of the fifth gradient value, the sixth gradient value, and the seventh gradient value may all be vectors, matrices, etc. The fifth gradient value, the sixth gradient value, and the seventh gradient value may all be estimated values.

[0042] In one example, the value of the weight parameter (variable) in the fourth loss function may be the value of the most recently updated weight parameter. In one example, the value of the weight parameter (variable) in the fourth loss function may be the value obtained by updating the initial weight parameter, and the value of the initial weight parameter is the value of the most recently updated weight parameter.

[0043] In an embodiment of the present application, a machine can construct a neural network model architecture by stacking construction units; and, in the process of multiple iterations, comprehensive consideration of the influence of weight parameters and structural parameters on the iteration results is conducive to selecting appropriate neural network model parameters, thereby obtaining a neural network model that can accurately identify multimedia data such as pictures, audio, video, and text.

[0044] In combination with the second aspect, in certain implementations of the second aspect, the method further includes: updating the structural parameters according to an eighth gradient value, where the eighth gradient value is the gradient value obtained by calculating the first-order gradient of the structural parameters by the fourth loss function.

[0045] In an embodiment of the present application, updating the structural parameters by using the first-order gradient of the structural parameters of the fourth loss function is beneficial to selecting a suitable update direction to reduce the error of updating the structural parameters and improve the efficiency of determining the structural parameters and weight parameters of the neural network model.

[0046] In one example, the updated structural parameters where λ 3 Update the learning rate for the structure parameters.

[0047] In conjunction with the second aspect, in some implementations of the second aspect, the sixth gradient value is expressed as:

[0048]

[0049] in, It is used to express the gradient of the structure function, L 3 (α, ω) is the third loss function, L 4 (α,ω) is the fourth loss function, α 1 is the updated structural parameter, ω 0 is the weight parameter currently used, and δ is the coefficient.

[0050] In an embodiment of the present application, since the value of the most recently updated structural parameter can be considered to be the value with the closest similarity to the optimal structural parameter, selecting the updated structural parameter is beneficial to improving the efficiency of determining the parameters of the neural network model; and updating the weight parameter after updating the structural parameter can reduce the impact on the structural parameter caused by the wrong selection of the weight parameter. Since the fourth loss function is used to update the structural parameters, but the structural parameters in the initial neural network model are not the optimal structural parameters, the value of the structural parameter will affect the accuracy of the function value of the fourth loss function, thereby indirectly affecting the weight parameter updated based on the third loss function. In the present application, the influence of the value of the structural parameter on the third loss function can be considered through the sixth gradient value, which is beneficial to improving the accuracy of the parameters of the neural network model.

[0051] In combination with the second aspect, in some implementations of the second aspect, the structural parameter is used to indicate a skip connection operation or a convolution operation.

[0052] In an embodiment of the present application, the method provided in the present application can accurately determine the parameters of the neural network model. Therefore, while the amount of calculation remains basically unchanged, the parameters to be determined in the neural network model can be increased. For example, the neural network model can include multiple data conversion operations.

[0053] In combination with the second aspect, in certain implementations of the second aspect, the multiple building units include a third building unit and a fourth building unit, the structural parameters include a third structural parameter corresponding to the third building unit and a fourth structural parameter corresponding to the fourth building unit, and the third structural parameter is different from the fourth structural parameter.

[0054] In an embodiment of the present application, the method provided in the present application can accurately determine the parameters of the neural network model. Therefore, while the amount of calculation remains basically unchanged, the parameters to be determined in the neural network model can be increased. For example, the optimal operations in multiple construction units can be determined separately.

[0055] In combination with the second aspect, in some implementations of the second aspect, any two building blocks among the multiple building blocks have the same structural type.

[0056] In a third aspect, a method for data processing is provided, comprising: acquiring a multimedia file; processing the multimedia data using a target neural network model to obtain a processing result for the multimedia data, wherein the target neural network model is obtained by stacking a plurality of construction units, and the parameters of the target neural network model include weight parameters and structure parameters, and the structure parameters are determined by a first gradient value, a second gradient value, and a third gradient value, the first gradient value being a gradient value obtained by calculating a first-order gradient of the weight parameter using a second loss function, the second gradient value being a gradient value obtained by calculating a second-order gradient of the weight parameter using the first loss function, the third gradient value being a gradient value obtained by calculating a first-order gradient of the structure parameter using the second loss function, the first loss function being used to update the weight parameters, and the second loss function being used to update the structure parameters.

[0057] In an embodiment of the present application, a machine can construct a neural network model architecture by stacking construction units; and, in the process of multiple iterations, comprehensive consideration of the influence of weight parameters and structural parameters on the iteration results is conducive to selecting appropriate neural network model parameters, thereby obtaining a neural network model that can accurately recognize multimedia data such as pictures, audio, video, and text.

[0058] In combination with the third aspect, in certain implementations of the third aspect, the weight parameter is determined by a fourth gradient value, and the fourth gradient value is a gradient value obtained by calculating a first-order gradient of the first loss function on the weight parameter.

[0059] In combination with the third aspect, in some implementations of the third aspect, the second gradient value is expressed as:

[0060]

[0061] in, It is used to express the gradient of the weight parameter, L 1 (α,ω) is the first loss function, L 2 (α,ω) is the second loss function, α 0 is the structural parameter currently used, ω 1 is the updated weight parameter, and ε is the coefficient.

[0062] In combination with the third aspect, in certain implementations of the third aspect, the target neural network model includes a first node and a second node, and the data output by the first node is input to the second node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0063] In combination with the third aspect, in certain implementations of the third aspect, the target neural network model includes a first construction unit and a second construction unit, the structural parameters include a first structural parameter corresponding to the first construction unit and a second structural parameter corresponding to the second construction unit, and the first structural parameter is different from the second structural parameter.

[0064] In combination with the third aspect, in certain implementations of the third aspect, a structural type of the first building unit is the same as a structural type of the second building unit.

[0065] In a fourth aspect, a data processing method is provided, comprising:

[0066] Acquire a multimedia file; use a target neural network model to process the multimedia data to obtain a processing result for the multimedia data, the target neural network model is obtained by stacking a plurality of construction units, the parameters of the target neural network model include weight parameters and structure parameters, the weight parameters are determined by a fifth gradient value, a sixth gradient value and a seventh gradient value, the fifth gradient value is a gradient value obtained by calculating the first-order gradient of the structure parameter using a third loss function, the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the structure parameter using a fourth loss function, the seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the third loss function, the third loss function is used to update the weight parameters, and the fourth loss function is used to update the structure parameters.

[0067] In an embodiment of the present application, a machine can construct a neural network model architecture by stacking construction units; and, in the process of multiple iterations, comprehensive consideration of the influence of weight parameters and structural parameters on the iteration results is conducive to selecting appropriate neural network model parameters, thereby obtaining a neural network model that can accurately identify multimedia data such as pictures, audio, video, and text.

[0068] In combination with the fourth aspect, in certain implementations of the fourth aspect, the structural parameter is determined by an eighth gradient value, and the eighth gradient value is a gradient value obtained by calculating a first-order gradient of the fourth loss function on the structural parameter.

[0069] In combination with the fourth aspect, in some implementations of the fourth aspect, the sixth gradient value is expressed as:

[0070]

[0071] in, It is used to express the gradient of the weight function, L 3 (α, ω) is the third loss function, L 4 (α,ω) is the fourth loss function, α 1is the updated structural parameter, ω 0 is the weight parameter currently used, and δ is the coefficient.

[0072] In combination with the fourth aspect, in certain implementations of the fourth aspect, the target neural network model includes a third node and a fourth node, and the data output by the third node is input to the fourth node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0073] In combination with the fourth aspect, in certain implementations of the fourth aspect, the target neural network model includes a third construction unit and a fourth construction unit, the structural parameters include a third structural parameter corresponding to the third construction unit and a fourth structural parameter corresponding to the fourth construction unit, and the third structural parameter is different from the fourth structural parameter.

[0074] In combination with the fourth aspect, in some implementations of the fourth aspect, a structural type of the third building unit is the same as a structural type of the fourth building unit.

[0075] In a fifth aspect, a device for training a neural network model is provided, comprising: an acquisition module for acquiring a plurality of building units, a first data to be trained, and a second data to be trained; a processing module for stacking the plurality of building units to obtain an initial neural network model, wherein the parameters of the initial neural network model include a structural parameter and a weight parameter; the processing module is further configured to input the first data to be trained into the initial neural network model to obtain a first output result, wherein the first data to be trained is used to update the weight parameter; the processing module is further configured to input the second data to be trained into the initial neural network model to obtain a second output result, wherein the second data to be trained is used to update the structural parameter; the processing module is further configured to, according to the first The first gradient value, the second gradient value and the third gradient value are used to update the structural parameters to obtain a target neural network model that meets the preset requirements and is used to identify multimedia data, the first gradient value is the gradient value obtained by calculating the first-order gradient of the weight parameter by the second loss function, the second gradient value is the gradient value obtained by calculating the second-order gradient of the weight parameter by the first loss function, the third gradient value is the gradient value obtained by calculating the first-order gradient of the structural parameter by the second loss function, the first loss function is used to determine the similarity between the first label corresponding to the first data to be trained and the first output result, and the second loss function is used to determine the similarity between the second label corresponding to the second data to be trained and the second output result.

[0076] In combination with the fifth aspect, in certain implementations of the fifth aspect, the processing module is also used to update the weight parameter according to a fourth gradient value, where the fourth gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter by the first loss function.

[0077] In combination with the fifth aspect, in some implementations of the fifth aspect, the second gradient value is expressed as:

[0078]

[0079] in, It is used to express the gradient of the weight parameter, L 1 (α,ω) is the first loss function, L 2 (α,ω) is the second loss function, α 0 is the structural parameter currently used, ω 1 is the updated weight parameter, and ε is the coefficient.

[0080] In combination with the fifth aspect, in certain implementations of the fifth aspect, the target neural network model includes a third node and a fourth node, and the data output by the third node is input to the fourth node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0081] In combination with the fifth aspect, in certain implementations of the fifth aspect, the multiple building units include a first building unit and a second building unit, the structural parameters include a first structural parameter corresponding to the first building unit and a second structural parameter corresponding to the second building unit, and the first structural parameter is different from the second structural parameter.

[0082] In combination with the fifth aspect, in certain implementations of the fifth aspect, any two building blocks among the multiple building blocks have the same structural type.

[0083] In a sixth aspect, a device for training a neural network model is provided, comprising: an acquisition module, for acquiring a plurality of building units, a third data to be trained, and a fourth data to be trained; a processing module, for stacking the plurality of building units to obtain an initial neural network model, wherein the parameters of the initial neural network model include a structural parameter and a weight parameter; the processing module is further used to input the third data to be trained into the initial neural network model to obtain a third output result, wherein the third data to be trained is used to update the weight parameter; the processing module is further used to input the fourth data to be trained into the initial neural network model to obtain a fourth output result, wherein the fourth data to be trained is used to update the structural parameter; the processing module is further used to, according to the fifth ladder The fifth gradient value, the sixth gradient value and the seventh gradient value are used to update the weight parameters to obtain a neural network model that meets the preset requirements and is used to identify multimedia data, the fifth gradient value is the gradient value obtained by calculating the first-order gradient of the structural parameter by the fourth loss function, the sixth gradient value is the gradient value obtained by calculating the second-order gradient of the structural parameter by the third loss function, the seventh gradient value is the gradient value obtained by calculating the first-order gradient of the weight parameter by the third loss function, the third loss function is used to determine the similarity between the third label corresponding to the third data to be trained and the third output result, and the fourth loss function is used to determine the similarity between the fourth label corresponding to the fourth data to be trained and the fourth output result.

[0084] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is also used to update the structural parameters according to an eighth gradient value, and the eighth gradient value is the gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameters.

[0085] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the sixth gradient value is expressed as:

[0086]

[0087] in, It is used to express the gradient of the structure function, L 3 (α, ω) is the third loss function, L 4 (α,ω) is the fourth loss function, α 1 is the updated structural parameter, ω 0 is the weight parameter currently used, and δ is the coefficient.

[0088] In combination with the sixth aspect, in certain implementations of the sixth aspect, the structural parameter is used to indicate a skip connection operation or a convolution operation.

[0089] In combination with the sixth aspect, in certain implementations of the sixth aspect, the multiple building units include a third building unit and a fourth building unit, the structural parameters include a third structural parameter corresponding to the third building unit and a fourth structural parameter corresponding to the fourth building unit, and the third structural parameter is different from the fourth structural parameter.

[0090] In combination with the sixth aspect, in certain implementations of the sixth aspect, any two building blocks among the multiple building blocks have the same structural type.

[0091] In the seventh aspect, a data processing device is provided, comprising: an acquisition module for acquiring multimedia files; a processing module for processing the multimedia data using a target neural network model to obtain a processing result for the multimedia data, the target neural network model is obtained by stacking a plurality of construction units, the parameters of the target neural network model include weight parameters and structure parameters, the structure parameters are determined by a first gradient value, a second gradient value and a third gradient value, the first gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using a second loss function, the second gradient value is a gradient value obtained by calculating the second-order gradient of the weight parameter using the first loss function, the third gradient value is a gradient value obtained by calculating the first-order gradient of the structure parameter using the second loss function, the first loss function is used to update the weight parameters, and the second loss function is used to update the structure parameters.

[0092] In combination with the seventh aspect, in certain implementations of the seventh aspect, the weight parameter is determined by a fourth gradient value, and the fourth gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter by the first loss function.

[0093] In conjunction with the seventh aspect, in some implementations of the seventh aspect, the second gradient value is expressed as:

[0094]

[0095] in, It is used to express the gradient of the weight parameter, L 1 (α,ω) is the first loss function, L 2 (α,ω) is the second loss function, α 0 is the structural parameter currently used, ω 1 is the updated weight parameter, and ε is the coefficient.

[0096] In combination with the seventh aspect, in certain implementations of the seventh aspect, the target neural network model includes a first node and a second node, and the data output by the first node is input to the second node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0097] In combination with the seventh aspect, in certain implementations of the seventh aspect, the target neural network model includes a first construction unit and a second construction unit, the structural parameters include a first structural parameter corresponding to the first construction unit and a second structural parameter corresponding to the second construction unit, and the first structural parameter is different from the second structural parameter.

[0098] In combination with the seventh aspect, in certain implementations of the seventh aspect, a structural type of the first building unit is the same as a structural type of the second building unit.

[0099] In an eighth aspect, a data processing device is provided, comprising: an acquisition module for acquiring multimedia files; a processing module for processing the multimedia data using a target neural network model to obtain a processing result for the multimedia data, wherein the target neural network model is obtained by stacking a plurality of construction units, and the parameters of the target neural network model include weight parameters and structure parameters, the weight parameters are determined by a fifth gradient value, a sixth gradient value, and a seventh gradient value, the fifth gradient value is a gradient value obtained by calculating the first-order gradient of the structure parameter using a third loss function, the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the structure parameter using a fourth loss function, the seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the third loss function, the third loss function is used to update the weight parameters, and the fourth loss function is used to update the structure parameters.

[0100] In combination with the eighth aspect, in certain implementations of the eighth aspect, the structural parameter is determined by an eighth gradient value, and the eighth gradient value is the gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameter.

[0101] In conjunction with the eighth aspect, in some implementations of the eighth aspect, the sixth gradient value is expressed as:

[0102]

[0103] in, It is used to express the gradient of the weight function, L 3 (α, ω) is the third loss function, L 4 (α,ω) is the fourth loss function, α 1 is the updated structural parameter, ω 0 is the weight parameter currently used, and δ is the coefficient.

[0104] In combination with the eighth aspect, in certain implementations of the eighth aspect, the target neural network model includes a third node and a fourth node, and the data output by the third node is input to the fourth node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0105] In combination with the eighth aspect, in certain implementations of the eighth aspect, the target neural network model includes a third construction unit and a fourth construction unit, the structural parameters include a third structural parameter corresponding to the third construction unit and a fourth structural parameter corresponding to the fourth construction unit, and the third structural parameter is different from the fourth structural parameter.

[0106] In combination with the eighth aspect, in certain implementations of the eighth aspect, a structural type of the third building unit is the same as a structural type of the fourth building unit.

[0107] In the ninth aspect, a device for training a neural network model is provided, the device comprising: a memory for storing programs; a processor for executing the programs stored in the memory, when the program stored in the memory is executed, the processor is used to execute the method in any one of the implementation modes of the first aspect to the second aspect.

[0108] Optionally, the device may be a cloud server or a terminal device.

[0109] In the tenth aspect, a data processing device is provided, which includes: a memory for storing programs; a processor for executing the programs stored in the memory, and when the program stored in the memory is executed, the processor is used to execute the method in any one of the implementation modes of the third to fourth aspects.

[0110] Optionally, the device may be a cloud server or a terminal device.

[0111] In an eleventh aspect, a computer-readable medium is provided, which stores a program code for execution by a device, wherein the program code includes a method for executing any one of the implementations of the first to fourth aspects.

[0112] In a twelfth aspect, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer executes a method in any one of the implementations of the first to fourth aspects above.

[0113] In the thirteenth aspect, a chip is provided, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute a method in any one of the implementation modes of the first to fourth aspects above.

[0114] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in any one of the implementation methods of the first aspect to the fourth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0115] Figure 1 It is a schematic diagram of a flow chart of performing calculations on a given layer in a neural network provided in an embodiment of the present application.

[0116] Figure 2 A schematic diagram of an application environment provided for an embodiment of the present application.

[0117] Figure 3 A schematic diagram of a convolutional neural network model provided in an embodiment of the present application.

[0118] Figure 4 A schematic diagram of a convolutional neural network model provided in an embodiment of the present application.

[0119] Figure 5 A schematic diagram of the structure of a building unit and a neural network model to be trained provided in an embodiment of the present application.

[0120] Figure 6 A schematic diagram of the structure of a neural network processor provided in an embodiment of the present application.

[0121] Figure 7 A schematic diagram of the structure of a cloud system provided in an embodiment of the present application.

[0122] Figure 8 A schematic flowchart of a method for training a neural network model according to an embodiment of the present application.

[0123] Fig. 9 It is a structural schematic diagram of a building unit in an embodiment of the present application.

[0124] Fig.10 It is a structural schematic diagram of an initial neural network model of an embodiment of the present application.

[0125] Fig.11 It is a schematic flow chart of a data processing method according to an embodiment of the present application.

[0126] Fig.12 It is a schematic flowchart of a method for training a neural network model according to an embodiment of the present application.

[0127] Fig.13 It is a schematic flow chart of a data processing method according to an embodiment of the present application.

[0128] Fig.14 It is a schematic block diagram of a neural network model training device according to an embodiment of the present application.

[0129] Fig.15 It is a schematic block diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0130] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0131] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and related concepts such as neural networks involved in the embodiments of the present application are first introduced below.

[0132] (1) Neural Network

[0133] A neural network can be composed of neural units. A neural unit can be a s The output of the operation unit with the intercept 1 as input can be:

[0134]

[0135] Where, s = 1, 2, ... n, n is a natural number greater than 1, W s For x s The weight of the neural unit, b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.

[0136] (2) Deep Neural Networks

[0137] A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with many hidden layers. There is no special metric for "many" here. From the position of different layers of DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, the work of each layer is actually not complicated. Simply put, it is the following expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since DNN has many layers, the coefficient W and the offset vector The definition of these parameters in DNN is as follows: Take coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscripts correspond to the output third layer index 2 and the input second layer index 4. In summary, the coefficients from the kth neuron in the L-1th layer to the jth neuron in the Lth layer are defined as It should be noted that the input layer does not have a W parameter. In a deep neural network, more hidden layers allow the network to better describe complex situations in the real world. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity", which means it can complete more complex learning tasks. Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by many layers of vector W).

[0138] (3) Convolutional Neural Network

[0139] Convolutional Neural Network (CNN) is a deep neural network with a convolutional structure. Convolutional neural network contains a feature extractor consisting of a convolution layer and a subsampling layer. The feature extractor can be regarded as a filter, and the convolution process can be regarded as using a trainable filter to convolve with an input image or convolution feature plane (feature map). Convolution layer refers to the neuron layer in the convolutional neural network that performs convolution processing on the input signal. In the convolution layer of the convolutional neural network, a neuron can only be connected to some neurons in the adjacent layer. A convolution layer usually contains several feature planes, and each feature plane can be composed of some rectangularly arranged neural units. The neural units in the same feature plane share weights, and the shared weights here are convolution kernels. Shared weights can be understood as the way to extract image information is independent of position. The implicit principle is that the statistical information of a part of the image is the same as that of other parts. This means that the image information learned in a part can also be used in another part. Therefore, the same learned image information can be used for all positions on the image. In the same convolution layer, multiple convolution kernels can be used to extract different image information. Generally speaking, the more convolution kernels there are, the richer the image information reflected by the convolution operation.

[0140] The convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network. In addition, the direct benefit of shared weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.

[0141] Figure 1 is a flow chart of an exemplary process 100 for performing computations on a given layer of a neural network using dedicated hardware circuits. For convenience, the method 100 will be described with respect to a system having one or more circuits for performing the method 100. The method 100 can be performed on various layers of a neural network to compute inferences from received inputs.

[0142] The system receives a group of weight inputs for a given layer (step 102) and a group of activation inputs (step 104). The group of weight inputs and the group of activation inputs can be received from a dynamic memory and a unified buffer of a dedicated hardware circuit, respectively. In some implementations, the group of weight inputs and the group of activation inputs are both received from a unified buffer.

[0143] The system generates a cumulative value from the weight inputs and the activation inputs using a matrix multiplication unit of a dedicated hardware circuit (step 106). In some implementations, the cumulative value is the dot product of the group of weight inputs and the group of activation inputs. That is, for a set of weights, the system can multiply each weight input with each activation input and add the products together to form the cumulative value. The system can then calculate the dot product of other groups of weights with other groups of activation inputs.

[0144] The system can generate the layer output from the accumulated values ​​using a vector computation unit of a dedicated hardware circuit (step 108). In some implementations, the vector computation unit applies an activation function to the accumulated values. The output of the layer can be stored in a unified buffer, used as input to subsequent layers in the neural network, or can be used to determine inferences. When the received input has been processed through the various layers of the neural network to generate inferences for the received input, the system has completed processing the neural network.

[0145] See attached Figure 2 , an embodiment of the present application provides a system architecture 200. The data acquisition device 260 is used to collect the data to be trained and store it in the database 230. In the embodiment of the present application, the data to be trained may include: image data, video data, audio data, text data, etc. The training device 220 generates a target model / rule 201 based on the data to be trained maintained in the database 230. The following will describe in more detail how the training device 220 obtains the target model / rule 201 based on the data to be trained. The target model / rule 201 can be used to implement the data processing method provided by the present application.

[0146] The work of each layer in a deep neural network can be expressed mathematically as To describe: From a physical level, the work of each layer in a deep neural network can be understood as completing the transformation from input space to output space (i.e., from row space to column space of a matrix) through five operations on the input space (a set of input vectors). These five operations include: 1. Dimension reduction; 2. Enlargement / reduction; 3. Rotation; 4. Translation; 5. "Bending". Operations 1, 2, and 3 are represented by Completed, the operation of 4 is done by Completed, operation 5 is implemented by α(). Among them, W is a weight vector, and each value in the vector represents the weight value of a neuron in this layer of the neural network. The vector W determines the spatial transformation from the input space to the output space mentioned above, that is, the weight W of each layer controls how to transform the space. The purpose of training a deep neural network is to eventually obtain the weight matrix of all layers of the trained neural network (the weight matrix formed by many layers of vectors W). Therefore, the training process of the neural network is essentially to learn how to control spatial transformation, and more specifically to learn the weight matrix and bias vector.

[0147] Because we want the output of the deep neural network to be as close as possible to the value we really want to predict, we can compare the current network's predicted value with the target value we really want, and then update the weight vector of each layer of the neural network based on the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the network's predicted value is high, adjust the weight vector to make it predict a lower value, and keep adjusting until the neural network can predict the target value we really want. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.

[0148] The target model / rule 201 obtained by the training device 220 can be applied to different systems or devices, such as Figure 2 The execution device 210 shown in the figure may be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an AR / VR, a vehicle terminal, etc., or a server or a cloud. Figure 2 In the embodiment, the execution device 210 is configured with an input / output interface 212 for data interaction with an external device, and a "user" can input data to the input / output interface 212 through a client device 240. The input data may include: image data, video data, audio data, text data, etc. The input data may be input by a user or derived from a database.

[0149] When the execution device 210 preprocesses the input data received by the input / output interface 212, or when the calculation module 211 of the execution device 210 performs calculations and other related processing, the execution device 210 can call the data, code, etc. in the data storage system 250 for corresponding processing, and can also store the data, instructions, etc. obtained by the corresponding processing in the data storage system 250. Preprocessing the data can, for example, perform image noise reduction, image compression, and other processing.

[0150] The calculation module 211 processes the input data using the target model / rule 201 .

[0151] Finally, the input / output interface 212 returns the processing result to the client device 240 so as to provide it to the user.

[0152] More deeply, the training device 220 can generate corresponding target models / rules 201 based on different data to be trained for different goals or different tasks. The corresponding target models / rules 201 can be used to achieve the above goals or complete the above tasks to provide users with better results.

[0153] In the attached Figure 2 In the case shown in the figure, the user can manually specify the data input into the execution device 210, for example, by operating in the interface provided by the input / output interface 212. In another case, the client device 240 can automatically input data into the input / output interface 212 and obtain the result. If the client device 240 needs to obtain the user's authorization to automatically input data, the user can set the corresponding authority in the client device 240. The user can view the result output by the execution device 210 in the client device 240, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 240 can also be used as a data collection end, collecting the input data of the input / output interface 212 as shown in the figure and the output result of the input / output interface 212 as new sample data, and storing it in the database 230. Of course, it is also possible not to collect through the client device 240, but the input / output interface 212 directly stores the input data of the input / output interface 212 as shown in the figure and the output result of the input / output interface 212 as new sample data into the database 230.

[0154] It is worth noting that Figure 2 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. Figure 2 In the embodiment, the data storage system 250 is an external memory relative to the execution device 210. In other cases, the data storage system 250 can also be placed in the execution device 210.

[0155] As mentioned in the previous basic concept introduction, convolutional neural network is a deep neural network with convolution structure, which is a deep learning architecture. Deep learning architecture refers to multiple levels of learning at different abstract levels through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network, in which each neuron can respond to the image input into it.

[0156] like Figure 3 As shown, the convolutional neural network (CNN) 300 may include an input layer 310 , a convolutional layer / pooling layer 320 , wherein the pooling layer is optional, and a neural network layer 330 .

[0157] Convolutional layer / pooling layer 320:

[0158] Convolutional Layer:

[0159] like Figure 3 The convolution layer / pooling layer 320 shown may include layers 321-326 as shown in the examples. In one implementation, layer 321 is a convolution layer, layer 322 is a pooling layer, layer 323 is a convolution layer, layer 324 is a pooling layer, layer 325 is a convolution layer, and layer 326 is a pooling layer. In another implementation, layers 321 and 322 are convolution layers, layer 323 is a pooling layer, layers 324 and 325 are convolution layers, and layer 326 is a pooling layer. That is, the output of a convolution layer can be used as the input of a subsequent pooling layer, or as the input of another convolution layer to continue the convolution operation.

[0160] Taking the convolution layer 321 as an example, the convolution layer 321 may include a plurality of convolution operators, which are also called kernels. The convolution operator is equivalent to a filter that extracts specific information from the input image matrix in image processing. The convolution operator can essentially be a weight matrix, which is usually predefined. In the process of performing convolution operations on the image, the weight matrix is ​​usually processed one pixel after another (or multiple pixels after multiple pixels, depending on the value of the step length stride) in the horizontal direction on the input image, thereby completing the work of extracting specific features from the image. The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is ​​the same as the depth dimension of the input image. In the process of performing convolution operations, the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, a single weight matrix is ​​not used, but multiple weight matrices of the same dimension are applied. The output of each weight matrix is ​​stacked to form the depth dimension of the convolved image. Different weight matrices can be used to extract different features in the image. For example, one weight matrix is ​​used to extract image edge information, another weight matrix is ​​used to extract specific colors of the image, and another weight matrix is ​​used to blur unnecessary noise in the image... The multiple weight matrices have the same dimensions, and the feature maps extracted by the multiple weight matrices with the same dimensions are also of the same dimension. The extracted feature maps with the same dimensions are then merged to form the output of the convolution operation.

[0161] The weight values ​​in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values ​​obtained through training can extract information from the input image, thereby helping the convolutional neural network 300 to make correct predictions.

[0162] When the convolutional neural network 300 has multiple convolutional layers, the initial convolutional layer (for example, 321) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 300 increases, the features extracted by the later convolutional layers (for example, 326) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.

[0163] Pooling layer:

[0164] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer, such as Figure 3 The layers 321-326 illustrated in 320 may be a convolution layer followed by a pooling layer, or may be multiple convolution layers followed by one or more pooling layers. In the image processing process, the only purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and / or a maximum pooling operator for sampling the input image to obtain an image of smaller size. The average pooling operator may calculate the pixel values ​​in the image within a specific range to generate an average value. The maximum pooling operator may take the pixel with the largest value within the specific range as the result of the maximum pooling. In addition, just as the depth dimension of the weight matrix used in the convolution layer should be related to the depth dimension of the image, the operator in the pooling layer should also be related to the depth dimension of the image. The size of the image output after processing by the pooling layer may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average value or maximum value of the corresponding sub-region of the image input to the pooling layer.

[0165] Fully connected layer (FC layer) 330:

[0166] After being processed by the convolution layer / pooling layer 320, the convolution neural network 300 is not sufficient to output the required output information. As mentioned above, the convolution layer / pooling layer 320 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network 300 needs to use the fully connected layer 330 to generate one or a group of outputs of the required number of classes. Therefore, the fully connected layer 330 may include multiple hidden layers (such as Figure 3 As shown in 331, 332 to 33n) and the output layer 340, the parameters contained in the multi-layer hidden layers can be pre-trained according to relevant training data of a specific task type. For example, the task type may include image recognition, image classification, image super-resolution reconstruction, etc.

[0167] After the multiple hidden layers in the fully connected layer 330, that is, the last layer of the entire convolutional neural network 300 is the output layer 340, which has a loss function similar to the classification cross entropy, specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network 300 (such as Figure 3 The propagation from 310 to 340 is forward propagation), and the reverse propagation (such as Figure 3 The propagation from 340 to 310 is called back propagation) and then the weight values ​​and biases of the aforementioned layers will begin to be updated to reduce the loss of the convolutional neural network 300 and the error between the result output by the convolutional neural network 300 through the output layer and the ideal result.

[0168] It should be noted that if Figure 3 The convolutional neural network 300 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models, for example, Figure 4 The multiple convolutional layers / pooling layers shown are operated in parallel, and the features extracted respectively are input to the fully connected layer 330 for processing. Figure 3 The convolutional neural network shown contains chain-like building blocks, Figure 4 The convolutional neural network shown contains building blocks of a multi-branch structure, Figure 3 The convolutional neural network shown as a whole can be viewed as a cell-based building block. Figure 4 The convolutional neural network shown in the figure can be viewed as a cell-based building block as a whole.

[0169] Below through Figure 5 Introduce different types of building blocks and the search network formed by stacking building blocks.

[0170] Figure 5 The building block shown in (a) is a building block of a chain structure. Figure 5 The building blocks in (a) include an input layer, an output layer, and L 0 -L n Neural network layer. A neural network layer can also be called a node. i The data of the neural network layer comes from L i-1 Layer neural network layer, L i The output data of the neural network layer can be input into L i+1 Neural network layer, where 0 <i<n。L 0 -L n Any neural network layer in the neural network layer can be a convolutional layer or a pooling layer. 0 -L nAny of the neural network layers may include neural network parameters, such as convolution size, convolution step size, etc.

[0171] Figure 5 The building block shown in (b) is a building block of a multi-branch structure. Figure 5 The building blocks in (b) include an input layer, an output layer, and M 0 -M 9 Neural network layer. A neural network layer can also be called a node. The component unit includes at least one first neural network layer, and the data output by the first neural network layer can be input to multiple neural network layers; and / or, the component unit includes at least one second neural network layer, and the data input to the second neural network layer can come from multiple neural network layers. For example, M 0 The output data of the neural network layer can be input into M 2 Neural network layers and M 8 Neural network layer; M 3 The output data of the neural network layer can be input into M 4 Neural network layers and M 5 Neural network layer; the data input to the M4 neural network layer can come from M 3 Neural network layers and M 2 Neural network layer; M 4 The output data of the neural network layer can be input into M 6 Neural network layers and M 7 Neural network layer; input M 7 The data of the neural network layer can come from M 4 Neural network layers and M 5 Neural network layer; input M 8 The data of the neural network layer can come from M 0 Neural network layers and M 6 Neural network layer. M 0 -M 9 Any neural network layer in the neural network layer can be a convolutional layer or a pooling layer. 0 -M 9 Any of the neural network layers may include neural network parameters, such as convolution size, convolution step size, etc.

[0172] Figure 5 (c) and (d) show examples of cell-based building blocks. Figure 5 The building blocks shown in (c) as a whole can be considered as cell-based building blocks. Figure 5 In the building unit shown in (c), data can be input into N 0 Neural network layers and N 1Neural network layer, and N 0 Neural network layers and N 1 The data output by the neural network layer is aggregated and output. The neural network layer can also be called a node. Figure 5 The building blocks shown in (d) as a whole can be considered as cell-based building blocks. Figure 5 In the building unit shown in (d), data can be input into N 2 Neural network layer, N 3 Neural network layer, N 4 Neural network layer, and N 2 Neural network layer, N 3 Neural network layer, N 4 The data output by the neural network layer is aggregated and output. The neural network layer can also be called a node.

[0173] Put two Figure 5 The building block shown in (c) is Figure 5 The building blocks shown in (d) can be stacked to form Figure 5 The search network shown in (e) of FIG. 1 is a search network. Since the search network contains weight parameters and structural parameters to be trained, the search network can also be called an initial neural network model (i.e., not the final neural network model) or a supernet. The process of determining the weight parameters and structural parameters in the search network can also be called searching for a neural network structure or training a neural network model. 0 Neural network layer, P 1 The neural network layer as a whole can be viewed as Figure 5 The building block shown in (c), P 3 Neural network layer, P 4 Neural network layer, P 5 The neural network layer as a whole can be viewed as Figure 5 The building block shown in (d) is P 7 Neural network layer, P 8 The neural network layer as a whole can be viewed as Figure 5 The search network can retain the flow of data in the original building unit. For example, in Figure 5 In the building unit shown in (c), the data passes through N 0 Neural network layers and N 1 The outputs can be aggregated after the neural network layer, and Figure 5 In the stacked search network shown in (e), the data passes through P 0 Neural network layer, P 1 The neural network layers can then summarize the outputs.

[0174] Two adjacent neural network layers refer to the target data output by the previous neural network layer being directly input to the next neural network layer, that is, the target data does not pass through other neural network layers before being input to the next neural network layer. 0 Neural network layers and P 2 The neural network layers are two adjacent neural network layers.

[0175] In the search network, the type of data flow operation between two adjacent neural network layers can be determined by the structural parameters, and the specific parameters of a specific operation can be determined by the weight parameters. The specific form of the structural parameters can be vectors, matrices, etc., and the specific form of the weight parameters can be vectors, matrices, etc. The data flow operation can be, for example, a convolution operation or a skip-connect operation. For example, P 0 The data output by the neural network layer can be input to P after convolution operation. 2 Neural network layer. When the search network contains multiple data flow operations, the structural parameters can be used to determine the data flow operations between two adjacent neural network layers. For example, the convolution operation corresponds to 0 and the skip connection operation corresponds to 1. When the value of the structural parameter is more inclined to 0, the data flow operation can be a convolution operation. For another example, when the value of the structural parameter corresponding to the convolution operation is 0.1 and the value of the structural parameter corresponding to the skip connection operation is 0.9, the convolution operation and the skip connection operation can be performed on the data stream, and the results of the two operations are merged, where the weight of the convolution operation is 0.1 and the weight of the skip connection operation is 0.9. The weight parameters of the search network are used to represent the parameters of an operation itself. For example, the convolution operation can include a linear coefficient between neuron 1 and neuron 2. Since the neural network model finally obtained can at least recognize specific scenarios to solve the corresponding problems, multiple iterations are required to train to the optimal or approximately optimal weight parameters and structural parameters.

[0176] Figure 2 The training device 220 shown can train Figure 5 The parameters of the building blocks shown in (a)-(d) can also be used to train the parameters of the search network obtained by stacking the building blocks (such as Figure 5 , to obtain the target model / rule 201.

[0177] Figure 6 A chip hardware structure provided in an embodiment of the present application includes a neural network processor 60. Figure 3-5 The algorithms of each layer in the neural network shown can be Figure 6 is implemented in the chip shown.

[0178] The neural network processor NPU 60 can be mounted on the host CPU as a coprocessor, and the host CPU assigns tasks. The core part of the NPU is the operation circuit 603, and the controller 604 controls the operation circuit 603 to extract data from the memory (weight memory or input memory) and perform operations.

[0179] In some implementations, the operation circuit 603 includes multiple processing units (Process Engine, PE) inside. In some implementations, the operation circuit 603 is a two-dimensional systolic array. The operation circuit 603 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the operation circuit 603 is a general-purpose matrix processor.

[0180] For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit takes the corresponding data of matrix B from the weight memory 602 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory 601 and performs matrix operation with matrix B, and the partial result or final result of the matrix is ​​stored in the accumulator 608.

[0181] The vector calculation unit 607 can further process the output of the operation circuit 603, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. For example, the vector calculation unit 607 can be used for network calculations of non-convolutional / non-FC layers in a neural network, such as pooling, batch normalization, local response normalization, etc.

[0182] In some implementations, the vector calculation unit 607 can store the processed output vector to the unified buffer 606. For example, the vector calculation unit 607 can apply a nonlinear function to the output of the operation circuit 603, such as a vector of accumulated values, to generate an activation value. In some implementations, the vector calculation unit 607 generates a normalized value, a merged value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 603, such as for use in a subsequent layer in a neural network.

[0183] Part or all of the steps of the method provided in this application may be executed by the operation circuit 603 or the vector calculation unit 607 .

[0184] The unified memory 606 is used to store input data and output data.

[0185] The weight data is directly transferred from the external memory to the input memory 601 and / or the unified memory 606 through the memory unit access controller 605 (Direct Memory Access Controller, DMAC), the weight data in the external memory is stored in the weight memory 602, and the data in the unified memory 606 is stored in the external memory.

[0186] The bus interface unit (BIU) 610 is used to implement the interaction between the main CPU, DMAC and instruction fetch memory 609 through the bus.

[0187] An instruction fetch buffer 609 connected to the controller 604 is used to store instructions used by the controller 604 .

[0188] The controller 604 is used to call the instructions cached in the instruction fetch memory 609 to control the working process of the computing accelerator.

[0189] Generally, the unified memory 606, the input memory 601, the weight memory 602 and the instruction fetch memory 609 are all on-chip memories, and the external memory is a private memory outside the NPU. The external memory can be a double data rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated as DDR SDRAM), a high bandwidth memory (High Bandwidth Memory, HBM) or other readable and writable memory.

[0190] in, Figure 3-5 The operations of each layer in the neural network shown can be performed by the operation circuit 603 or the vector calculation unit 607.

[0191] like Figure 7 As shown, the embodiment of the present application provides a system architecture 700. The system architecture includes a local device 701, a local device 702, an execution device 710 and a data storage system 750, wherein the local device 701 and the local device 702 are connected to the execution device 710 via a communication network.

[0192] The execution device 710 can be implemented by one or more servers. Optionally, the execution device 710 can be used in conjunction with other computing devices, such as data storage devices, routers, load balancers, and other devices. The execution device 710 can be arranged at one physical site, or distributed at multiple physical sites. The execution device 710 can use the data in the data storage system 750, or call the program code in the data storage system 750 to implement the method for training the neural network model of the embodiment of the present application.

[0193] Specifically, the execution device 710 can be constructed into an image recognition neural network, which can be used for image recognition or image processing, etc.

[0194] Users can operate their respective user devices (e.g., local device 701 and local device 702) to interact with execution device 710. Each local device can represent any computing device, such as a personal computer, a computer workstation, a smart phone, a tablet computer, a smart camera, a smart car or other type of cellular phone, a media consumption device, a wearable device, a set-top box, a game console, etc.

[0195] Each user's local device can interact with the execution device 710 through a communication network of any communication mechanism / communication standard. The communication network can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.

[0196] In another implementation, one aspect or multiple aspects of the execution device 710 may be implemented by each local device. For example, the local device 701 may provide local data or feedback calculation results to the execution device 710 .

[0197] It should be noted that all functions of the execution device 710 can also be implemented by a local device. For example, the local device 701 implements the functions of the execution device 710 and provides services to its own users, or provides services to the users of the local device 702. The above-mentioned execution device 710 can also be called a cloud device, in which case the execution device 710 is generally deployed in the cloud.

[0198] After stacking multiple building blocks together to form a search network, the parameters of the search network need to be updated to obtain the final neural network. Among them, the parameters of the search network include weight parameters and structure parameters. The weight parameter is a parameter within the building block, and the structure parameter is used to indicate whether the building blocks are associated with each other and the associated weight. For example, if there is no association between building block 1 and building block 2, then the structure parameter of 0 can be used to indicate that there is no association between building block 1 and building block 2; if there is an association between building block 1 and building block 2, then the structure parameter of a (a is not equal to 0) can be used to indicate that there is an association between building block 1 and building block 2, and the larger the value of a, the closer the association between building block 1 and building block 2.

[0199] When the value of the loss function is smaller, the value of the weight parameter and the value of the structure parameter are better. The present application uses the gradient descent method to determine the optimal weight parameters and structure parameters. Therefore, it is beneficial to find the minimum value of the loss function along the direction of the gradient descent of the loss function to the weight parameter, so as to determine the optimal weight parameter. Similarly, it is beneficial to find the minimum value of the loss function along the direction of the gradient descent of the loss function to the structure parameter, so as to determine the optimal weight parameter. Since it is necessary to determine the optimal weight parameter and the optimal structure parameter, the two often cannot be determined by the same loss function. Therefore, it is necessary to first search for a better weight parameter through loss function 1, and then search for a better structure parameter through loss function 2 on the basis of the better weight parameter. After multiple iterations, the optimal weight parameter and the optimal structure parameter can be obtained. The present application provides a method for efficiently and accurately calculating the optimal structure parameters and weight parameters, so as to obtain a neural network model with good stability and adaptability to real scenes.

[0200] Figure 8 FIG. 8 is a schematic flow chart of a method for training a neural network model provided by the present application. The method 800 may be performed as follows: Figure 2 The training device 220 is shown to perform.

[0201] 801, obtaining a plurality of construction units, first data to be trained, and second data to be trained.

[0202] The type of building block can be, for example, a chain-like building block (e.g. Figure 5 (a)), building blocks of multi-branch structures (such as Figure 5 (b)), cell-based building blocks (such as Figure 5 (c) Figure 5 (d)). The present application does not limit the type of building blocks. Figure 5 The building blocks have been defined in detail in (a)-(d) and will not be repeated here.

[0203] The data to be trained may be multimedia data, such as pictures, audio files (such as voice), video files, etc.

[0204] The data to be trained may be obtained, for example, from a database or storage medium, or by receiving data sent by other devices or equipment through a communication network, or by photographing with a camera, recording with a microphone, or the like.

[0205] Optionally, any two building blocks among the multiple building blocks have the same structural type.

[0206] Fig. 9 FIG. 9 is a schematic diagram of a building unit. The building unit 900 includes an input 1 node, an input 2 node, a Q 1 Node, Q 2 Node, Q 3 Node, Q 4 Node and output node, where Q 1 The data output by the node can be input to Q 2 Node and the output node of this building block, Q 2 The data output by the node can be input to Q 3 Node and the output node of this building block, Q 3 The data output by the node can be input to Q 4 Node and the output node of this building block, Q 4 The data outputted by the node can be inputted to the output node of the construction unit. Data can be inputted to the construction unit 900 through the input 1 node and the input 2 node in the construction unit 900 .

[0207] 802. Stack the multiple building blocks to obtain an initial neural network model, where parameters of the initial neural network model include structure parameters and weight parameters.

[0208] The present application does not limit the type of the initial neural network model. The type of the initial neural network model can be a convolutional neural network model, a deep neural network model, etc.

[0209] The above Figure 5 (e) describes in detail how to obtain the initial neural network model by stacking multiple building units, as well as the weight parameters and structural parameters of the initial neural network model, which will not be repeated here.

[0210] Z Fig. 9The construction units 900 shown are stacked together to form an initial neural network model. The structural parameters of the initial neural network model can be used to indicate a skip connection operation or a convolution operation. The convolution operation can be, for example, a convolution operation with a convolution kernel size of 3×3, 5×5, etc. Z construction units can be numbered according to the transmission direction of the data flow, where the data output by the construction unit with a smaller number can be input into the construction unit with a larger number, and Z is an integer greater than 1. In one example, the data input to the input 1 node of the current construction unit can be the data output by the previous construction unit of the current construction unit, and the data input to the input 2 node of the current construction unit can be the data output by the first two construction units of the current construction unit. Fig.10 The figure shows a partial schematic diagram of an initial neural network model. Fig.10 As shown, the initial neural network model at least includes a construction unit 1001 and a construction unit 1002. Among them, the construction unit 1001 is the i-th construction unit, and the construction unit 1002 is the i+1-th construction unit. The construction unit 1001 includes an input 1 node, an input 2 node, a Q 1 i Node, Q 2 i Node, Q 3 i Node, Q 4 i Node, and output node Q i The construction unit 1002 includes an input 3 node, an input 4 node, and a Q 1 i+1 Node, Q 2 i+1 Node, Q 3 i+1 Node, Q 4 i+1 Node, and output node Q i+1 The data output by the building block 1001 (i-th building block) (i.e., Q i The data output by the node) is input from the input 3 node to the construction unit 1002 (the i+1th construction unit), and the data input to the construction unit 1001 (for example, the data output by the i-1th construction unit, i.e., Q i-1 The data output by the node) is input to the construction unit 1002 from the input 2 node.

[0211] 803: Input the first data to be trained into the initial neural network model to obtain a first output result, wherein the first data to be trained is used to update the weight parameters.

[0212] The data to be trained is input into the initial neural network model to obtain a feature vector for representing the data to be trained. After the feature vector passes through multiple layers in the initial neural network model, an output result for the data to be trained can be obtained.

[0213] It should be understood that, unless otherwise specified, the structural parameters and weight parameters of the present application should be regarded as variables. By assigning specific values ​​to the structural parameters and weight parameters, the initial neural network model can recognize the training data. By optimizing the values ​​assigned to the structural parameters and weight parameters, the accuracy of the initial neural network model in recognizing data can be improved, and ultimately a neural network model with better recognition performance can be obtained.

[0214] The initial neural network model may be a neural network model that needs to train the optimal structural parameters and the optimal weight parameters, that is, it is not a neural network model with the optimal structural parameters and the optimal weight parameters. In order to train the optimal weight parameters and structural parameters, it is necessary to assign initial values ​​to the weight parameters of the initial neural network model and to assign initial values ​​to the structural parameters of the initial neural network model, so that the initial neural network model can recognize the first data to be trained and output a result.

[0215] In addition, the update of the weight parameters is based on the initial value of the weight parameters, for example, ω 1 =ω 0 +Δω, where ω 1 can be the updated weight parameter, ω 0 It can be the initial value of the weight parameter, and Δω can be the update amount of the weight parameter. In multiple iterations, the weight parameter can be updated multiple times. Then, the currently updated weight parameter can be regarded as the initial value of the weight parameter after the next update starts.

[0216] In order to improve the convergence of training the optimal structural parameters and the optimal weight parameters, different data can be input into the initial neural network model, so as to train the structural parameters and the weight parameters respectively. The main purpose of inputting the first training data into the initial neural network model is to update the weight parameters.

[0217] 804, input the second data to be trained into the initial neural network model to obtain a second output result, wherein the second data to be trained is used to update the structural parameters.

[0218] The second data to be trained may be the same as the first data to be trained, or may be different from the first data to be trained.

[0219] In order to improve the convergence of training the optimal structural parameters and the optimal weight parameters, different data can be input into the initial neural network model, so as to train the structural parameters and the weight parameters respectively. The main purpose of inputting the second training data into the initial neural network model is to update the structural parameters.

[0220] The specific implementation of step 804 can refer to Figure 8 Step 803 in the illustrated embodiment need not be described in detail here.

[0221] In addition, since the structural parameters can be used to indicate the operations between nodes, the structural parameters between any two building blocks in the multiple building blocks can be different.

[0222] The plurality of building blocks include a first building block and a second building block, the structural parameters include a first structural parameter corresponding to the first building block and a second structural parameter corresponding to the second building block, and the first structural parameter is different from the second structural parameter.

[0223] by Fig.10 Taking the neural network model shown in FIG. 1 as an example, the construction unit 1001 may be the first construction unit, and the construction unit 1002 may be the second construction unit. The first structural parameter corresponding to the construction unit 1001 may be used to indicate the following: Q i-1 Node and Q 1 i Operations between nodes, Q 1 i Node and Q 2 i Operations between nodes, Q 2 i Node and Q 3 i Operations between nodes, and Q 3 i Node and Q 4 i The second structural parameter corresponding to the construction unit 1002 can be used to indicate the following: i Node and Q 1 i+1 Operations between nodes, Q 1 i+1 Node and Q 2 i+1 Operations between nodes, Q 2 i+1 Node and Q 3 i+1 Operations between nodes, and Q 3 i+1 Node and Q 4i+1 If the structure type of the first building block is different from the structure type of the second building block, then the first structure parameter corresponding to the first building block must be different from the second structure parameter corresponding to the second building block. When the structure type of the first building block is the same as the structure type of the second building block, the first structure parameter corresponding to the first building block can be the same as or different from the second structure parameter corresponding to the second building block. For example, the first structure parameter includes {a1, a2, a3, a4}, where a1 is used to indicate Q i-1 Node and Q 1 i Operations between nodes, a2 is used to indicate Q 1 i Node and Q 2 i Operations between nodes, a3 is used to indicate Q 2 i Node and Q 3 i Operations between nodes, a4 is used to indicate Q 3 i Node and Q 4 i Operations between nodes; the first structure parameter includes {b1, b2, b3, b4}, where b1 is used to indicate Q i Node and Q 1 i+1 Operations between nodes, b2 is used to indicate Q 1 i+1 Node and Q 2 i+1 Operations between nodes, b3 is used to indicate Q 2 i+1 Node and Q 3 i+1 Operations between nodes, b4 is used to indicate Q 3 i+1 Node and Q 4 i+1 Operations between nodes. If a1=b1, a2=b2, a3=b3, and a4=b4, then the first structural parameter and the second structural parameter may be the same; if a1≠b1, a2≠b2, a3≠b3, or a4≠b4, then the first structural parameter and the second structural parameter may be different.

[0224] 805. Update the structural parameters according to the first gradient value, the second gradient value and the third gradient value to obtain a target neural network model that meets preset requirements and is used to identify multimedia data, wherein the first gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the second loss function, the second gradient value is a gradient value obtained by calculating the second-order gradient of the weight parameter using the first loss function, and the third gradient value is a gradient value obtained by calculating the first-order gradient of the structural parameter using the second loss function. The first loss function is used to determine the similarity between the first label corresponding to the first data to be trained and the first output result, and the second loss function is used to determine the similarity between the second label corresponding to the second data to be trained and the second output result.

[0225] In the present application, the loss function is used to represent the similarity between the output result of the initial neural network model and the label of the input data. For example, when the similarity between the output result and the label of the input data is small, the function value of the loss function is large; when the similarity between the output result and the label of the input data is large, the function value of the loss function is small. The similarity between the output result and the input data can be represented by the similarity between feature 1 and feature 2, where feature 1 is used to characterize the input data and feature 2 is used to characterize the output result.

[0226] In one example, when the first data to be trained is a picture, the label of the first data to be trained may be the name of the object in the picture, the type of person, the characteristics of the environment, etc. The picture may be a single picture or a frame in a video. For example, the person in the picture is a man, the picture contains books and a table, and the environment of the picture is indoors, then the label of the picture may be "man", "book", "table", "indoor". If the output result obtained after inputting the picture into the initial neural network model is "woman", then the output result corresponding to the picture has a small similarity with the label of the picture; if the output result is not "woman" but "man", then the output result corresponding to the picture has a large similarity with the label of the picture.

[0227] In one example, when the first data to be trained is voice audio, the label of the first data to be trained may be an instruction in the voice audio. For example, the voice in the first data to be trained contains a sentence: "I want to call XXX", then the label of the first data to be trained may be "Dial XXX". If the output result obtained after the voice audio is input into the initial neural network model is "Record in the notepad: dial XXX", then the output result corresponding to the voice audio has a low similarity with the label of the voice audio; if the output result is "Start the call function and dial XXX", then the output result corresponding to the voice audio has a high similarity with the label of the voice audio.

[0228] In one example, when the first data to be trained is text, the label of the first data to be trained may be the semantics of the text. For example, the first data to be trained contains a sentence: "I want to call XXX, no, I want to call YYY", then the label of the first data to be trained may be "I want to call YYY". If the output result obtained after inputting the text into the initial neural network model is "I want to call XXX", then the output result corresponding to the text has a small similarity with the label of the text; if the output result is "I want to call YYY", then the output result corresponding to the text has a large similarity with the label of the text.

[0229] Therefore, when the similarity between the output result and the label of the input data is small, the parameters in the initial neural network model can be adjusted through the loss function so that the neural network model can correctly learn the rules in the input data.

[0230] In order to train the optimal structural parameters and the optimal weight parameters, it is necessary to determine the data to be trained for the structural parameters to train the optimal structural parameters, and the data to be trained for the weight parameters to train the optimal weight parameters. Among them, the first loss function in this application is used to determine the similarity between the first label and the first output result, and the first label and the first output result both correspond to the first data to be trained, and the first data to be trained is used to update the weight parameters, so the first loss function can be regarded as used to update the weight parameters. For example, using the gradient descent method, the optimal weight parameters can be trained according to the gradient of the first loss function to the weight parameters. The second loss function in this application is used to determine the similarity between the second label and the second output result, and the second label and the second output result both correspond to the second data to be trained, and the second data to be trained is used to update the structural parameters, so the second loss function can be regarded as used to update the structural parameters. For example, using the gradient descent method, the optimal structural parameters can be trained according to the gradient of the second loss function to the structural parameters. The first loss function may include weight parameters (variables) and structural parameters (variables). The second loss function may include weight parameters (variables) and structural parameters (variables).

[0231] In the present application, the specific expressions of the first gradient value, the second gradient value, and the third gradient value can all be in the form of vectors, matrices, etc. It should be understood that in the present application, the first gradient value can be an approximation of the gradient value obtained by the second loss function for the weight parameter to obtain the first-order gradient. Similarly, the second gradient value can be an approximation of the gradient value obtained by the first loss function for the weight parameter to obtain the second-order gradient, and the third gradient value can be an approximation of the gradient value obtained by the second loss function for the structural parameter to obtain the first-order gradient.

[0232] Since the first gradient value, the second gradient value, and the third gradient value can all be estimated values, the present application does not limit the specific method of obtaining the gradient. For example, the gradient function of the loss function with respect to a certain variable can be calculated to obtain the corresponding gradient value; the function value of the loss function when a certain variable is within the first range can also be calculated to obtain the value range of the loss function as the second range, and then the gradient of the loss function with respect to the variable can be approximately estimated based on the ratio of the second range to the first range. In addition, the second gradient value can be expressed as the inverse of the second gradient value.

[0233] In addition, when the structural parameters are updated by the second loss function, it is necessary to assign values ​​to the weight parameters (variables) in the second loss function. In an embodiment of the present application, the method for determining the value of the weight parameter is not limited. In one example, the value of the weight parameter (variable) in the second loss function may be the value of the most recently updated weight parameter. In one example, the value of the weight parameter (variable) in the second loss function may be the value obtained by updating the initial weight parameter, and the value of the initial weight parameter is the value of the most recently updated weight parameter.

[0234] It can be seen that although the second loss function is used to update the structural parameters, the weight parameters in the initial neural network model are not the optimal weight parameters, so it is also necessary to consider the impact of the value of the weight parameter on the second loss function. In this application, the impact of the value of the weight parameter on the second loss function can be considered through the first gradient value.

[0235] It can be seen that since the first loss function is used to update the weight parameters, the weight parameters in the initial neural network model are not the optimal weight parameters, it is also necessary to consider the impact of the value of the weight parameters on the first loss function. Therefore, the non-optimal weight parameters will have an impact on the first loss function, thereby indirectly affecting the structural parameters updated based on the second loss function. In this application, the impact of the value of the weight parameter on the first loss function can be considered through the second gradient value.

[0236] It can be seen that since the second loss function is used to update the structural parameters, the structural parameters can be updated by the third gradient value.

[0237] Optionally, the method further includes: updating the weight parameter according to a fourth gradient value, wherein the fourth gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter by the first loss function.

[0238] It can be seen that since the first loss function is used to update the weight parameters, the weight parameters can be updated by the fourth gradient value.

[0239] Two specific forms of updating structural parameters are given below.

[0240] Form 1

[0241] Let the initial weight parameter be ω 0 , the initial structure parameter is α 0 , the fourth gradient value is Then the weight parameter can be updated according to the fourth gradient value to obtain the updated weight parameter where λ 1 Update the learning rate for the weight parameters.

[0242] The first gradient value can be expressed as

[0243] The second gradient value can be expressed as

[0244] The third gradient value can be expressed as

[0245] Then the structural parameters can be updated according to the first gradient value, the second gradient value, and the third gradient value to obtain the updated weight parameters where λ 2 is the learning rate for updating the structural parameters, and η is a hyperparameter.

[0246] Form 2

[0247] Let the initial weight parameter be ω 0 , the initial structure parameter is α 0 , the fourth gradient value is Then the weight parameter can be updated according to the fourth gradient value to obtain the updated weight parameter where λ 1 Update the learning rate for the weight parameters.

[0248] The first gradient value can be expressed as

[0249] The second gradient value can be expressed as:

[0250]

[0251] The third gradient value can be expressed as

[0252] Then the structural parameters can be updated according to the first gradient value, the second gradient value, and the third gradient value to obtain the updated weight parameters

[0253]

[0254] where λ 2is the learning rate for updating the structural parameters, η is a hyperparameter, ε and β are coefficients. The value of ε can be very small, such as 0.0001, 0.00002, etc. The value of β can be very small, such as 0.0001, 0.00002, etc.

[0255] The first gradient value, the second gradient value, and the third gradient value can avoid the inability to correctly learn the rules contained in the training data due to an inappropriate iteration process.

[0256] In one example, one iteration cycle may include one weight parameter update and one structure parameter update.

[0257] In one example, one iteration loop may include N weight parameter updates and M structure parameter updates, where N and M are integers greater than 1.

[0258] A neural network model that meets preset requirements may, for example, be a neural network model obtained by iterating an initial neural network model multiple times, and the total number of iterations is greater than or equal to a preset upper limit of iterations; or may be a neural network model in which the update step of weight parameters and / or structural parameters is less than or equal to a preset threshold.

[0259] Step 804 in the above text has already introduced an example of using a neural network model to identify the training data, which will not be repeated here.

[0260] Fig.11 is a schematic flow chart of a data processing method provided by an embodiment of the present application. The method 1100 may be performed as follows: Figure 2 The method 1100 may be performed by the execution device 210 shown in FIG. Figure 6 The method 1100 may be performed by the neural network processor 60 shown. Figure 7 The execution device 710 is shown to execute.

[0261] 1101, obtain multimedia files.

[0262] Multimedia data may be, for example, pictures, audio files (such as voice), video files, etc.

[0263] The multimedia data may be obtained, for example, from a database or storage medium, or by receiving data sent by other devices or equipment through a communication network, or by photographing with a camera, recording with a microphone, or the like.

[0264] 1102. Use a target neural network model to process the multimedia data to obtain a processing result for the multimedia data. The target neural network model is obtained by stacking a plurality of construction units. The parameters of the target neural network model include weight parameters and structure parameters. The structure parameters are determined by a first gradient value, a second gradient value, and a third gradient value. The first gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter using a second loss function. The second gradient value is a gradient value obtained by calculating a second-order gradient of the weight parameter using a first loss function. The third gradient value is a gradient value obtained by calculating a first-order gradient of the structure parameter using a second loss function. The first loss function is used to update the weight parameters, and the second loss function is used to update the structure parameters.

[0265] This application does not limit the type of the target neural network model. The type of the target neural network model can be a convolutional neural network model, a deep neural network model, etc.

[0266] In one example, when the multimedia data is a picture, the target neural network model is used to identify and process the multimedia data to obtain the processing result of the picture. The processing result of the picture can be, for example, the name of the object in the picture, the type of person, the characteristics of the environment, etc. The picture can be a single picture or a frame in a video. For example, the person in the picture is a man, the picture contains a book and a table, and the environment of the picture is indoors, then the processing result of the picture can be "man", "book", "table", "indoors".

[0267] In one example, when the multimedia data is voice audio, the target neural network model is used to identify and process the multimedia data to obtain instructions in the voice audio. For example, the multimedia data is voice audio, and the voice audio contains a sentence: "I want to call XXX", then the instruction in the voice audio can be "dial XXX's phone number".

[0268] In one example, when the multimedia data is text, the semantics of the text can be obtained by using the target neural network model to recognize and process the multimedia data. For example, if the multimedia data is text, and the text contains a sentence: "I want to call XXX, no, I want to call YYY", then the semantics of the text can be "I want to call YYY".

[0269] Optionally, the weight parameter is determined by a fourth gradient value, and the fourth gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter by the first loss function.

[0270] Optionally, the second gradient value is expressed as:

[0271]

[0272] in, It is used to express the gradient of the weight parameter, L 1 (α,ω) is the first loss function, L 2 (α,ω) is the second loss function, α 0 is the structural parameter currently used, ω 1 is the updated weight parameter, and ε is the coefficient.

[0273] The above Figure 5 (e) describes in detail how to obtain the initial neural network model by stacking multiple building units, as well as the weight parameters and structural parameters of the initial neural network model, which will not be repeated here.

[0274] Optionally, any two building blocks among the multiple building blocks have the same structural type.

[0275] Fig. 9 FIG. 9 is a schematic diagram of a building unit. The building unit 900 includes an input 1 node, an input 2 node, a Q 1 Node, Q 2 Node, Q 3 Node, Q 4 Node and output node, where Q 1 The data output by the node can be input to Q 2 Node and the output node of this building block, Q 2 The data output by the node can be input to Q 3 Node and the output node of this building block, Q 3 The data output by the node can be input to Q 4 Node and the output node of this building block, Q 4 The data outputted by the node can be inputted to the output node of the construction unit. Data can be inputted to the construction unit 900 through the input 1 node and the input 2 node in the construction unit 900 .

[0276] Z Fig. 9 The construction units 900 shown are stacked together to form an initial neural network model, and the target neural network model is determined by the initial neural network model. The structural parameters of the initial neural network model can be used to indicate a skip connection operation or a convolution operation. The convolution operation can be, for example, a convolution operation with a convolution kernel size of 3×3, 5×5, etc. The Z construction units can be numbered according to the transmission direction of the data flow, where the data output by the construction unit with a smaller number can be input into the construction unit with a larger number, and Z is an integer greater than 1. Fig.10As shown, the initial neural network model at least includes a construction unit 1001 and a construction unit 1002. Among them, the construction unit 1001 is the i-th construction unit, and the construction unit 1002 is the i+1-th construction unit. The construction unit 1001 includes an input 1 node, an input 2 node, a Q 1 i Node, Q 2 i Node, Q 3 i Node, Q 4 i Node, and output node Q i The construction unit 1002 includes an input 3 node, an input 4 node, and a Q 1 i+1 Node, Q 2 i+1 Node, Q 3 i+1 Node, Q 4 i+1 Node, and output node Q i+1 The data output by the building block 1001 (i-th building block) (i.e., Q i The data output by the node) is input from the input 3 node to the construction unit 1002 (the i+1th construction unit), and the data input to the construction unit 1001 (for example, the data output by the i-1th construction unit, i.e., Q i-1 The data output by the node) is input to the construction unit 1002 from the input 2 node.

[0277] Optionally, the target neural network model includes a first construction unit and a second construction unit, the structural parameters include a first structural parameter corresponding to the first construction unit and a second structural parameter corresponding to the second construction unit, and the first structural parameter is different from the second structural parameter.

[0278] Optionally, the structural type of the first building unit is the same as the structural type of the second building unit.

[0279] Optionally, the target neural network model includes a first node and a second node, and the data output by the first node is input to the second node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0280] by Fig.10 Take the neural network model shown as an example, Q 1 i Node and Q 2 i The operations between nodes can be skip connections or convolution operations.

[0281] In order to obtain the target neural network model, it is necessary to determine the structural parameters and weight parameters of the target neural network model, so it is necessary to determine the loss function for the structural parameters and the loss function for the weight parameters. Among them, the first loss function in the present application corresponds to the weight parameters, and the second loss function corresponds to the structural parameters. For example, the first data to be trained corresponds to the weight parameters, and the first loss function is used to determine the similarity between the first label corresponding to the first data to be trained and the first output result corresponding to the first data to be trained, so the first loss function corresponds to the weight parameters; for example, the second data to be trained corresponds to the structural parameters, and the second loss function is used to determine the similarity between the second label corresponding to the second data to be trained and the second output result corresponding to the second data to be trained, so the second loss function corresponds to the structural parameters. In other words, the first loss function is used to update the weight parameters, and the second loss function is used to update the structural parameters. For example, using the gradient descent method, the weight parameters of the target neural network model can be determined according to the gradient of the first loss function to the weight parameters, and the structural parameters of the target neural network model can be determined according to the gradient of the second loss function to the structural parameters.

[0282] The first gradient value, the second gradient value, and the third gradient value may all be estimated values, and the present application does not limit the specific method of obtaining the gradient. In the embodiments of the present application, the method of determining the value of the weight parameter is not limited.

[0283] It can be seen that although the second loss function is used to update the structural parameters, the weight parameters in the initial neural network model are not the optimal weight parameters, so it is also necessary to consider the impact of the value of the weight parameter on the second loss function. In this application, the impact of the value of the weight parameter on the second loss function can be considered through the first gradient value.

[0284] It can be seen that since the first loss function is used to update the weight parameters, but the structural parameters in the initial neural network model are not the optimal structural parameters, it is also necessary to consider the impact of the values ​​of the structural parameters on the first loss function. Therefore, the non-optimal structural parameters will affect the first loss function, thereby indirectly affecting the weight parameters updated based on the first loss function. Therefore, part of the reason why the values ​​of the weight parameters affect the second loss function comes from the non-optimal values ​​of the structural parameters. In this application, the impact of the values ​​of the structural parameters on the first loss function can be considered through the second gradient value.

[0285] It can be seen that since the second loss function is used to update the structural parameters, the structural parameters can be updated by the third gradient value.

[0286] Optionally, the weight parameter is determined by a fourth gradient value, and the fourth gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter by the first loss function.

[0287] It can be seen that since the first loss function is used to update the weight parameters, the weight parameters can be updated by the fourth gradient value.

[0288] The specific implementation method of determining the structural parameters of the target neural network model can refer to Figure 8 Step 807 in the illustrated embodiment need not be described in detail here.

[0289] Fig.12 FIG. 12 is a schematic flow chart of a method for training a neural network model provided by the present application. The method 1200 may be performed as follows: Figure 2 The training device 220 is shown to perform.

[0290] 1201, obtain multiple construction units, third data to be trained, and fourth data to be trained.

[0291] 1202. Stack the multiple building blocks to obtain an initial neural network model, where parameters of the initial neural network model include structure parameters and weight parameters.

[0292] Optionally, the multiple building units include a third building unit and a fourth building unit, the structural parameters include a third structural parameter corresponding to the third building unit and a fourth structural parameter corresponding to the fourth building unit, and the third structural parameter is different from the fourth structural parameter.

[0293] 1203, input the third data to be trained into the initial neural network model to obtain a third output result, and the third data to be trained is used to update the weight parameters.

[0294] 1204, input the fourth data to be trained into the initial neural network model to obtain a fourth output result, and the fourth data to be trained is used to update the structural parameters.

[0295] The update of structural parameters is based on the initial value of the structural parameters, such as α 1 =α 0 +Δα, where α 1 can be the updated structural parameters, α 0 It can be the initial value of the structural parameter, and Δα can be the update amount of the structural parameter. In the process of multiple iterations, the structural parameter can be updated multiple times, then the currently updated structural parameter can be regarded as the initial value of the structural parameter after the next update starts.

[0296] The specific implementation of steps 1201-1204 can refer to Figure 8 Steps 801-804 in the illustrated embodiment need not be described in detail here.

[0297] 1205. The weight parameters are updated according to the fifth gradient value, the sixth gradient value and the seventh gradient value to obtain a neural network model that meets preset requirements and is used to identify multimedia data, wherein the fifth gradient value is a gradient value obtained by calculating the first-order gradient of the structural parameter using the fourth loss function, the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the structural parameter using the third loss function, and the seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the third loss function. The third loss function is used to determine the similarity between the third label corresponding to the third data to be trained and the third output result, and the fourth loss function is used to determine the similarity between the fourth label corresponding to the fourth data to be trained and the fourth output result.

[0298] In order to train the optimal structural parameters and the optimal weight parameters, it is necessary to determine the data to be trained for the structural parameters to train the optimal structural parameters, and the data to be trained for the weight parameters to train the optimal weight parameters. Among them, the third loss function in this application is used to determine the similarity between the third label and the third output result, and the third label and the third output result both correspond to the third data to be trained, and the third data to be trained is used to update the weight parameters, so the third loss function can be regarded as used to update the weight parameters. For example, using the gradient descent method, the optimal weight parameters can be trained according to the gradient of the third loss function to the weight parameters. The fourth loss function in this application is used to determine the similarity between the fourth label and the fourth output result, and the fourth label and the fourth output result both correspond to the fourth data to be trained, and the fourth data to be trained is used to update the structural parameters, so the fourth loss function can be regarded as used to update the structural parameters. For example, using the gradient descent method, the optimal structural parameters can be trained according to the gradient of the fourth loss function to the structural parameters. The third loss function may include weight parameters (variables) and structural parameters (variables). The fourth loss function may include weight parameters (variables) and structural parameters (variables).

[0299] In the present application, the specific expressions of the fifth gradient value, the sixth gradient value, and the seventh gradient value can all be in the form of vectors, matrices, etc. It should be understood that in the present application, the fifth gradient value can be an approximation of the gradient value obtained by the third loss function to calculate the first-order gradient of the structural parameter. Similarly, the sixth gradient value can be an approximation of the gradient value obtained by the fourth loss function to calculate the second-order gradient of the structural parameter, and the seventh gradient value can be an approximation of the gradient value obtained by the third loss function to calculate the first-order gradient of the weight parameter. In addition, the sixth gradient value can be expressed by the inverse of the sixth gradient value.

[0300] Since the fifth gradient value, the sixth gradient value, and the seventh gradient value can all be estimated values, the present application does not limit the specific method of obtaining the gradient. For example, the gradient function of the loss function with respect to a certain variable can be calculated to obtain the corresponding gradient value; the function value of the loss function when a certain variable is within the third range can also be calculated to obtain the value range of the loss function as the fourth range, and then the gradient of the loss function with respect to the variable can be approximately estimated based on the ratio of the fourth range to the third range.

[0301] In addition, when the weight parameters are updated by the third loss function, it is necessary to assign values ​​to the structural parameters (variables) in the third loss function. In an embodiment of the present application, the method for determining the value of the structural parameter is not limited. In one example, the value of the structural parameter (variable) in the third loss function may be the value of the most recently updated structural parameter. In one example, the value of the structural parameter (variable) in the fourth loss function may be the value obtained by updating the initial structural parameter, and the value of the initial weight parameter is the value of the most recently updated structural parameter.

[0302] It can be seen that although the third loss function is used to update the weight parameters, the structural parameters in the initial neural network model are not the optimal structural parameters, so it is also necessary to consider the impact of the value of the structural parameters on the third loss function. In this application, the impact of the value of the weight parameter on the third loss function can be considered through the fifth gradient value.

[0303] It can be seen that since the fourth loss function is used to update the structural parameters, the structural parameters in the initial neural network model are not the optimal structural parameters, it is also necessary to consider the impact of the values ​​of the structural parameters on the fourth loss function. Therefore, the non-optimal structural parameters will have an impact on the fourth loss function, thereby indirectly affecting the weight parameters updated based on the third loss function. In this application, the impact of the values ​​of the structural parameters on the first loss function can be considered through the sixth gradient value.

[0304] It can be seen that since the third loss function is used to update the weight parameters, the structural parameters can be updated by the seventh gradient value.

[0305] Optionally, the method further includes: updating the structural parameters according to an eighth gradient value, where the eighth gradient value is a gradient value obtained by calculating the first-order gradient of the structural parameters by the fourth loss function.

[0306] It can be seen that since the fourth loss function is used to update the structural parameters, the structural parameters can be updated by the eighth gradient value.

[0307] Two specific forms of updating weight parameters are given below.

[0308] Form 1

[0309] Let the initial weight parameter be ω 0 , the initial structure parameter is α 0 , the eighth gradient value is Then the structural parameters can be updated according to the eighth gradient value to obtain the updated structural parameters where λ 3 Update the learning rate for the structure parameters.

[0310] The fifth gradient value can be expressed as

[0311] The sixth gradient value can be expressed as

[0312] The seventh gradient value can be expressed as

[0313] Then the structural parameters can be updated according to the fifth gradient value, the sixth gradient value, and the seventh gradient value to obtain the updated weight parameters where λ 4 is the learning rate for updating the weight parameters, and ξ is a hyperparameter.

[0314] Form 2

[0315] Let the initial weight parameter be ω 0 , the initial structure parameter is α 0 , the eighth gradient value is Then the structural parameters can be updated according to the eighth gradient value to obtain the updated structural parameters where λ 3 Update the learning rate for the structure parameters.

[0316] The fifth gradient value can be expressed as

[0317] The sixth gradient value can be expressed as:

[0318]

[0319] The seventh gradient value can be expressed as

[0320] Then the parameters can be updated according to the fifth gradient value, the sixth gradient value, and the seventh gradient value to obtain the updated weight parameters:

[0321]

[0322] where λ 4 is the learning rate for updating the structural parameters, ξ is a hyperparameter, and τ and γ are coefficients. The value of τ can be very small, such as 0.0001, 0.00002, etc. The value of γ can be very small, such as 0.0001, 0.00002, etc.

[0323] The fifth gradient value, the sixth gradient value, and the seventh gradient value can avoid the inability to correctly learn the rules contained in the training data due to an inappropriate iteration process.

[0324] In one example, one iteration cycle may include one weight parameter update and one structure parameter update.

[0325] In one example, one iteration loop may include N weight parameter updates and M structure parameter updates, where N and M are integers greater than 1.

[0326] A neural network model that meets preset requirements may, for example, be a neural network model obtained by iterating an initial neural network model multiple times, and the total number of iterations is greater than or equal to a preset upper limit of iterations; or may be a neural network model in which the update step of weight parameters and / or structural parameters is less than or equal to a preset threshold.

[0327] Step 804 in the above text has already introduced an example of using a neural network model to identify the training data, which will not be repeated here.

[0328] Fig.13 is a schematic flow chart of a data processing method provided in an embodiment of the present application. The method 1300 may be performed as follows: Figure 2 The method 1300 may be performed by the execution device 210 shown in FIG. Figure 6 The method 1300 may be performed by the neural network processor 60 shown. Figure 7 The execution device 710 is shown to execute.

[0329] 1301, obtain multimedia files.

[0330] The specific implementation of step 1301 can refer to Figure 8 Steps 801-806 in the illustrated embodiment need not be described in detail here.

[0331] 1302. Use a target neural network model to process the multimedia data to obtain a processing result for the multimedia data. The target neural network model is obtained by stacking a plurality of construction units. The parameters of the target neural network model include weight parameters and structure parameters. The weight parameters are determined by a fifth gradient value, a sixth gradient value, and a seventh gradient value. The fifth gradient value is a gradient value obtained by calculating a first-order gradient of the structure parameter using a third loss function. The sixth gradient value is a gradient value obtained by calculating a second-order gradient of the structure parameter using a fourth loss function. The seventh gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter using the third loss function. The third loss function is used to update the weight parameters, and the fourth loss function is used to update the structure parameters.

[0332] In one example, when the multimedia data is a picture, the target neural network model is used to identify and process the multimedia data to obtain the processing result of the picture. The processing result of the picture can be, for example, the name of the object in the picture, the type of person, the characteristics of the environment, etc. The picture can be a single picture or a frame in a video. For example, the person in the picture is a man, the picture contains a book and a table, and the environment of the picture is indoors, then the processing result of the picture can be "man", "book", "table", "indoors".

[0333] In one example, when the multimedia data is voice audio, the target neural network model is used to identify and process the multimedia data to obtain instructions in the voice audio. For example, the multimedia data is voice audio, and the voice audio contains a sentence: "I want to call XXX", then the instruction in the voice audio can be "dial XXX's phone number".

[0334] In one example, when the multimedia data is text, the semantics of the text can be obtained by using the target neural network model to recognize and process the multimedia data. For example, if the multimedia data is text, and the text contains a sentence: "I want to call XXX, no, I want to call YYY", then the semantics of the text can be "I want to call YYY".

[0335] The above Figure 5 (e) describes in detail how to obtain the initial neural network model by stacking multiple building units, as well as the weight parameters and structural parameters of the initial neural network model, which will not be repeated here.

[0336] Optionally, any two building blocks among the multiple building blocks have the same structural type.

[0337] Fig. 9 FIG. 9 is a schematic diagram of a building unit. The building unit 900 includes an input 1 node, an input 2 node, a Q 1 Node, Q 2 Node, Q 3 Node, Q 4 Node and output node, where Q 1 The data output by the node can be input to Q 2 Node and the output node of this building block, Q 2 The data output by the node can be input to Q 3 Node and the output node of this building block, Q 3 The data output by the node can be input to Q 4 Node and the output node of this building block, Q 4The data outputted by the node can be inputted to the output node of the construction unit. Data can be inputted to the construction unit 900 through the input 1 node and the input 2 node in the construction unit 900 .

[0338] Z Fig. 9 The construction units 900 shown are stacked together to form an initial neural network model, and the target neural network model is determined by the initial neural network model. The structural parameters of the initial neural network model can be used to indicate a skip connection operation or a convolution operation. The convolution operation can be, for example, a convolution operation with a convolution kernel size of 3×3, 5×5, etc. The Z construction units can be numbered according to the transmission direction of the data flow, where the data output by the construction unit with a smaller number can be input into the construction unit with a larger number, and Z is an integer greater than 1. Fig.10 As shown, the initial neural network model at least includes a construction unit 1001 and a construction unit 1002. Among them, the construction unit 1001 is the i-th construction unit, and the construction unit 1002 is the i+1-th construction unit. The construction unit 1001 includes an input 1 node, an input 2 node, a Q 1 i Node, Q 2 i Node, Q 3 i Node, Q 4 i Node, and output node Q i The construction unit 1002 includes an input 3 node, an input 4 node, and a Q 1 i+1 Node, Q 2 i+1 Node, Q 3 i+1 Node, Q 4 i+1 Node, and output node Q i+1 The data output by the building block 1001 (i-th building block) (i.e., Q i The data output by the node) is input from the input 3 node to the construction unit 1002 (the i+1th construction unit), and the data input to the construction unit 1001 (for example, the data output by the i-1th construction unit, i.e., Q i-1 The data output by the node) is input to the construction unit 1002 from the input 2 node.

[0339] Optionally, the target neural network model includes a third construction unit and a fourth construction unit, the structural parameters include a third structural parameter corresponding to the third construction unit and a fourth structural parameter corresponding to the fourth construction unit, and the third structural parameter is different from the fourth structural parameter.

[0340] Optionally, the structural type of the third building unit is the same as the structural type of the fourth building unit.

[0341] Optionally, the target neural network model includes a third node and a fourth node, and the data output by the third node is input to the fourth node after a target operation, and the target operation includes a skip connection operation or a convolution operation.

[0342] by Fig.10 Take the neural network model shown as an example, Q 1 i Node and Q 2 i The operations between nodes can be skip connections or convolution operations.

[0343] In order to obtain the target neural network model, it is necessary to determine the structural parameters and weight parameters of the target neural network model, so it is necessary to determine the loss function for the structural parameters and the loss function for the weight parameters. Among them, the third loss function in this application corresponds to the weight parameters, and the fourth loss function corresponds to the structural parameters. For example, the third data to be trained corresponds to the weight parameters, and the third loss function is used to determine the similarity between the third label corresponding to the third data to be trained and the third output result corresponding to the third data to be trained, so the third loss function corresponds to the weight parameters; for example, the fourth data to be trained corresponds to the structural parameters, and the fourth loss function is used to determine the similarity between the fourth label corresponding to the fourth data to be trained and the fourth output result corresponding to the fourth data to be trained, so the fourth loss function corresponds to the structural parameters. In other words, the third loss function is used to update the weight parameters, and the fourth loss function is used to update the structural parameters. For example, using the gradient descent method, the weight parameters of the target neural network model can be determined according to the gradient of the third loss function to the weight parameters, and the structural parameters of the target neural network model can be determined according to the gradient of the fourth loss function to the structural parameters.

[0344] The fifth gradient value, the sixth gradient value, and the seventh gradient value may all be estimated values, and the present application does not limit the specific method of obtaining the gradient. In the embodiments of the present application, the method of determining the value of the structural parameter is not limited.

[0345] It can be seen that although the third loss function is used to update the weight parameters, the structural parameters in the initial neural network model are not the optimal structural parameters, so it is also necessary to consider the impact of the value of the structural parameters on the third loss function. In this application, the impact of the value of the weight parameter on the third loss function can be considered through the fifth gradient value.

[0346] It can be seen that since the fourth loss function is used to update the structural parameters, the structural parameters in the initial neural network model are not the optimal structural parameters, it is also necessary to consider the impact of the values ​​of the structural parameters on the fourth loss function. Therefore, the non-optimal structural parameters will have an impact on the fourth loss function, thereby indirectly affecting the weight parameters updated based on the third loss function. In this application, the impact of the values ​​of the structural parameters on the first loss function can be considered through the sixth gradient value.

[0347] It can be seen that since the third loss function is used to update the weight parameters, the structural parameters can be updated by the seventh gradient value.

[0348] Optionally, the passing parameter is determined by an eighth gradient value, and the eighth gradient value is a gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameter.

[0349] It can be seen that since the fourth loss function is used to update the structural parameters, the structural parameters can be updated by the eighth gradient value.

[0350] Optionally, the sixth gradient value is expressed as:

[0351]

[0352] in, It is used to express the gradient of the weight function, L 3 (α, ω) is the third loss function, L 4 (α,ω) is the fourth loss function, α 1 is the updated structural parameter, ω 0 is the weight parameter currently used, and δ is the coefficient.

[0353] The specific implementation method of determining the structural parameters of the target neural network model can refer to Fig.12 Step 1207 in the illustrated embodiment need not be described in detail here.

[0354] Fig.14 It is a schematic diagram of the hardware structure of the device for training a neural network model provided in an embodiment of the present application. Fig.14 The apparatus 1400 for training a neural network model shown (the apparatus 1400 may be a computer device) includes a memory 1401, a processor 1402, a communication interface 1403, and a bus 1404. The memory 1401, the processor 1402, and the communication interface 1403 are connected to each other through the bus 1404.

[0355] The memory 1401 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1401 may store programs. When the programs stored in the memory 1401 are executed by the processor 1402, the processor 1402 is used to execute the embodiments of the present application. Figure 8 or Fig.12 The various steps of the method for training a neural network model are shown.

[0356] The processor 1402 may be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits for executing related programs to implement the embodiments of the present application. Figure 8 or Fig.12 The method for training a neural network model is shown.

[0357] The processor 1402 may also be an integrated circuit chip having the ability to process signals. Figure 8 or Fig.12 Each step of the method for training a neural network model shown can be accomplished by an integrated logic circuit of hardware in the processor 1402 or instructions in software form.

[0358] The processor 1402 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1401, and the processor 1402 reads the information in the memory 1401, and combines its hardware to complete the functions required to be performed by the units included in the device for training a neural network model in the embodiments of the present application, or executes the functions in the embodiments of the present application. Figure 8 or Fig.12 The method for training a neural network model is shown.

[0359] The communication interface 1403 uses a transceiver such as, but not limited to, a transceiver to implement communication between the device 1400 and other devices or communication networks. For example, the communication interface 1403 can be used to obtain the construction unit and the training data (such as Figure 8 or Fig.12 Multiple building blocks, first data to be trained, and second data to be trained in the illustrated embodiment).

[0360] The bus 1404 may include a path for transmitting information between various components of the device 1400 (eg, the memory 1401 , the processor 1402 , and the communication interface 1403 ).

[0361] It should be understood that the acquisition module in the device for training a neural network model can be equivalent to the communication interface 1403 in the device 1400 for training a neural network model; and the processing module in the device for training a neural network model can be equivalent to the processor 1402.

[0362] Fig.15 It is a schematic diagram of the hardware structure of the data processing device provided in the embodiment of the present application. Fig.15The data processing device 1500 shown (the device 1500 may be a computer device) includes a memory 1501, a processor 1502, a communication interface 1503 and a bus 1504. The memory 1501, the processor 1502 and the communication interface 1503 are connected to each other through the bus 1504.

[0363] The memory 1501 may be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 1501 may store programs. When the programs stored in the memory 1501 are executed by the processor 1502, the processor 1502 is used to execute the embodiments of the present application. Fig.11 or Fig.13 The individual steps of the method of data processing are shown.

[0364] The processor 1502 may be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits for executing related programs to implement the embodiments of the present application. Fig.11 or Fig.13 The data processing method shown.

[0365] The processor 1502 may also be an integrated circuit chip having the ability to process signals. Fig.11 or Fig.13 Each step of the data processing method shown may be implemented by an integrated logic circuit of hardware in the processor 1502 or by instructions in software form.

[0366] The processor 1502 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1501, and the processor 1502 reads the information in the memory 1501, and combines its hardware to complete the functions required to be performed by the units included in the data processing device in the embodiments of the present application, or executes the functions in the embodiments of the present application. Fig.11 or Fig.13 The data processing method shown.

[0367] The communication interface 1503 uses a transceiver such as, but not limited to, a transceiver to implement communication between the device 1500 and other devices or communication networks. For example, the communication interface 1503 can be used to obtain data required in the data processing process (such as Fig.11 or Fig.13 multimedia data in the illustrated embodiment).

[0368] The bus 1504 may include a path for transmitting information between various components of the device 1500 (eg, the memory 1501 , the processor 1502 , and the communication interface 1503 ).

[0369] It should be understood that the acquisition module in the data processing device may be equivalent to the communication interface 1503 in the data processing device 1500 ; and the processing module in the data processing device may be equivalent to the processor 1502 .

[0370] It should be noted that although the above-mentioned apparatus 1400 and apparatus 1500 only show a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that apparatus 1400 and apparatus 1500 may also include other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that apparatus 1400 and apparatus 1500 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that apparatus 1400 and apparatus 1500 may also only include the devices necessary for implementing the embodiments of the present application, and do not necessarily include Fig.14 , Fig.15 All devices shown in .

[0371] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0372] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0373] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0374] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0375] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0376] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0377] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for training a neural network model, characterized in that: include: Acquire a plurality of building units, first data to be trained, and second data to be trained; Stacking the multiple building blocks to obtain an initial neural network model, wherein the parameters of the initial neural network model include structure parameters and weight parameters; Inputting the first data to be trained into the initial neural network model to obtain a first output result, wherein the first data to be trained is used to update the weight parameter; wherein a first loss function is used to determine the similarity between a first label corresponding to the first data to be trained and the first output result; Inputting the second data to be trained into the initial neural network model to obtain a second output result, wherein the second data to be trained is used to update the structural parameters; wherein a second loss function is used to determine the similarity between a second label corresponding to the second data to be trained and the second output result; The structural parameters are updated according to the first gradient value, the second gradient value and the third gradient value to obtain a target neural network model that meets preset requirements and is used to identify multimedia data, the first gradient value is the gradient value obtained by calculating the first-order gradient of the weight parameter by the second loss function, the second gradient value is the gradient value obtained by calculating the second-order gradient of the weight parameter by the first loss function, and the third gradient value is the gradient value obtained by calculating the first-order gradient of the structural parameter by the second loss function.

2. The method according to claim 1, characterized in that The method further comprises: The weight parameter is updated according to a fourth gradient value, where the fourth gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter using the first loss function.

3. The method according to claim 1 or 2, characterized in that: The second gradient value is expressed as: in, It is used to represent the gradient of the weight parameter, L1(α, ω) is the first loss function, L2(α, ​​ω) is the second loss function, α0 is the currently used structural parameter, ω1 is the updated weight parameter, and ε is the coefficient.

4. The method according to claim 1 or 2, characterized in that: The structure parameter is used to indicate a skip connection operation or a convolution operation.

5. The method according to claim 1 or 2, characterized in that: The plurality of building blocks include a first building block and a second building block, the structural parameters include a first structural parameter corresponding to the first building block and a second structural parameter corresponding to the second building block, and the first structural parameter is different from the second structural parameter.

6. The method according to claim 1 or 2, characterized in that: Any two building blocks in the plurality of building blocks have the same structural type.

7. A method for training a neural network model, characterized in that: include: Acquire multiple building units, third data to be trained, and fourth data to be trained; Stacking the multiple building blocks to obtain an initial neural network model, wherein the parameters of the initial neural network model include structure parameters and weight parameters; Inputting the third data to be trained into the initial neural network model to obtain a third output result, wherein the third data to be trained is used to update the weight parameter; wherein a third loss function is used to determine the similarity between a third label corresponding to the third data to be trained and the third output result; Inputting the fourth data to be trained into the initial neural network model to obtain a fourth output result, wherein the fourth data to be trained is used to update the structural parameters; wherein a fourth loss function is used to determine the similarity between a fourth label corresponding to the fourth data to be trained and the fourth output result; The weight parameter is updated according to the fifth gradient value, the sixth gradient value and the seventh gradient value to obtain a neural network model for identifying multimedia data that meets preset requirements, wherein: The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameter, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the third loss function on the structural parameter; or The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the third loss function on the structural parameter, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the fourth loss function on the structural parameter; The seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the third loss function.

8. A method of data processing, characterized in that: include: Acquiring multimedia data; The multimedia data is processed using a target neural network model to obtain a processing result for the multimedia data, the target neural network model is obtained by stacking a plurality of construction units, the parameters of the target neural network model include weight parameters and structure parameters, the structure parameters are determined by a first gradient value, a second gradient value and a third gradient value, the first gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using a second loss function, the second gradient value is a gradient value obtained by calculating the second-order gradient of the weight parameter using the first loss function, the third gradient value is a gradient value obtained by calculating the first-order gradient of the structure parameter using the second loss function, the first loss function is used to update the weight parameters, and the second loss function is used to update the structure parameters.

9. The method according to claim 8, characterized in that The weight parameter is determined by a fourth gradient value, and the fourth gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the first loss function.

10. The method according to claim 8 or 9, characterized in that: The second gradient value is expressed as: in, It is used to represent the gradient of the weight parameter, L1(α, ω) is the first loss function, L2(α, ​​ω) is the second loss function, α0 is the currently used structural parameter, ω1 is the updated weight parameter, and ε is the coefficient.

11. The method according to claim 8 or 9, characterized in that: The target neural network model includes a first node and a second node. The data output by the first node is input to the second node after a target operation. The target operation includes a skip connection operation or a convolution operation.

12. The method according to claim 8 or 9, characterized in that: The target neural network model includes a first construction unit and a second construction unit, and the structural parameters include a first structural parameter corresponding to the first construction unit and a second structural parameter corresponding to the second construction unit, and the first structural parameter is different from the second structural parameter.

13. The method according to claim 12, characterized in that The structural type of the first building block is the same as the structural type of the second building block.

14. A method of data processing, characterized in that: include: Acquiring multimedia data; The multimedia data is processed using a target neural network model to obtain a processing result for the multimedia data, wherein the target neural network model is obtained by stacking a plurality of building units, and the parameters of the target neural network model include a weight parameter and a structure parameter, and the weight parameter is determined by a fifth gradient value, a sixth gradient value, and a seventh gradient value, wherein: The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the structural parameter using the third loss function, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the structural parameter using the fourth loss function; or The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameter, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the third loss function on the structural parameter; The seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter by the third loss function; The third loss function is used to update the weight parameters, and the fourth loss function is used to update the structural parameters.

15. A device for training a neural network model, characterized in that: include: An acquisition module, used for acquiring a plurality of construction units, first data to be trained and second data to be trained; A processing module, used for stacking the multiple building blocks to obtain an initial neural network model, wherein the parameters of the initial neural network model include structure parameters and weight parameters; The processing module is further used to input the first data to be trained into the initial neural network model to obtain a first output result, and the first data to be trained is used to update the weight parameter; wherein the first loss function is used to determine the similarity between the first label corresponding to the first data to be trained and the first output result; The processing module is also used to input the second data to be trained into the initial neural network model to obtain a second output result, and the second data to be trained is used to update the structural parameters; wherein the second loss function is used to determine the similarity between the second label corresponding to the second data to be trained and the second output result; The processing module is also used to update the structural parameters according to the first gradient value, the second gradient value and the third gradient value to obtain a target neural network model that meets preset requirements and is used to identify multimedia data, the first gradient value is the gradient value obtained by calculating the first-order gradient of the weight parameter by the second loss function, the second gradient value is the gradient value obtained by calculating the second-order gradient of the weight parameter by the first loss function, the third gradient value is the gradient value obtained by calculating the first-order gradient of the structural parameter by the second loss function, the first loss function is used to determine the similarity between the first label corresponding to the first data to be trained and the first output result, and the second loss function is used to determine the similarity between the second label corresponding to the second data to be trained and the second output result.

16. The device according to claim 15, characterized in that The processing module is further configured to update the weight parameter according to a fourth gradient value, where the fourth gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter using the first loss function.

17. The device according to claim 15 or 16, characterized in that The second gradient value is expressed as: in, It is used to represent the gradient of the weight parameter, L1(α, ω) is the first loss function, L2(α, ​​ω) is the second loss function, α0 is the currently used structural parameter, ω1 is the updated weight parameter, and ε is the coefficient.

18. The device according to claim 15 or 16, characterized in that The target neural network model includes a third node and a fourth node. The data output by the third node is input to the fourth node after a target operation. The target operation includes a skip connection operation or a convolution operation.

19. The device according to claim 15 or 16, characterized in that The plurality of building blocks include a first building block and a second building block, the structural parameters include a first structural parameter corresponding to the first building block and a second structural parameter corresponding to the second building block, and the first structural parameter is different from the second structural parameter.

20. The device according to claim 19, characterized in that Any two building blocks in the plurality of building blocks have the same structural type.

21. A device for training a neural network model, characterized in that: include: An acquisition module, used for acquiring a plurality of construction units, third data to be trained, and fourth data to be trained; A processing module, stacking the multiple building blocks to obtain an initial neural network model, wherein the parameters of the initial neural network model include structure parameters and weight parameters; The processing module is further used to input the third data to be trained into the initial neural network model to obtain a third output result, and the third data to be trained is used to update the weight parameter; wherein the third loss function is used to determine the similarity between the third label corresponding to the third data to be trained and the third output result; The processing module is further used to input the fourth data to be trained into the initial neural network model to obtain a fourth output result, and the fourth data to be trained is used to update the structural parameters; wherein a fourth loss function is used to determine the similarity between a fourth label corresponding to the fourth data to be trained and the fourth output result; The processing module is further used to update the weight parameter according to the fifth gradient value, the sixth gradient value and the seventh gradient value to obtain a neural network model for identifying multimedia data that meets preset requirements, wherein: The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameter, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the third loss function on the structural parameter; or The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the third loss function on the structural parameter, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the fourth loss function on the structural parameter; The seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the third loss function.

22. A data processing device, characterized in that: include: An acquisition module, used for acquiring multimedia data; A processing module is used to process the multimedia data using a target neural network model to obtain a processing result for the multimedia data, wherein the target neural network model is obtained by stacking a plurality of construction units, and the parameters of the target neural network model include weight parameters and structure parameters, and the structure parameters are determined by a first gradient value, a second gradient value, and a third gradient value, wherein the first gradient value is a gradient value obtained by calculating a first-order gradient of the weight parameter using a second loss function, the second gradient value is a gradient value obtained by calculating a second-order gradient of the weight parameter using a first loss function, and the third gradient value is a gradient value obtained by calculating a first-order gradient of the structure parameter using a second loss function, the first loss function is used to update the weight parameters, and the second loss function is used to update the structure parameters.

23. The device according to claim 22, characterized in that The weight parameter is determined by a fourth gradient value, and the fourth gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter using the first loss function.

24. The device according to claim 22 or 23, characterized in that The second gradient value is expressed as: in, It is used to represent the gradient of the weight parameter, L1(α, ω) is the first loss function, L2(α, ​​ω) is the second loss function, α0 is the currently used structural parameter, ω1 is the updated weight parameter, and ε is the coefficient.

25. The device according to claim 22 or 23, characterized in that The target neural network model includes a first node and a second node. The data output by the first node is input to the second node after a target operation. The target operation includes a skip connection operation or a convolution operation.

26. The device according to claim 22 or 23, characterized in that The target neural network model includes a first construction unit and a second construction unit, and the structural parameters include a first structural parameter corresponding to the first construction unit and a second structural parameter corresponding to the second construction unit, and the first structural parameter is different from the second structural parameter.

27. The device according to claim 26, characterized in that The structural type of the first building block is the same as the structural type of the second building block.

28. A data processing device, characterized in that: include: An acquisition module, used for acquiring multimedia data; A processing module, configured to process the multimedia data using a target neural network model to obtain a processing result for the multimedia data, wherein the target neural network model is obtained by stacking a plurality of building units, and the parameters of the target neural network model include weight parameters and structure parameters, and the weight parameters are determined by a fifth gradient value, a sixth gradient value, and a seventh gradient value, wherein: The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the structural parameter using the third loss function, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the structural parameter using the fourth loss function; or The fifth gradient value is a gradient value obtained by calculating the first-order gradient of the fourth loss function on the structural parameter, and the sixth gradient value is a gradient value obtained by calculating the second-order gradient of the third loss function on the structural parameter; The seventh gradient value is a gradient value obtained by calculating the first-order gradient of the weight parameter by the third loss function; The third loss function is used to update the weight parameters, and the fourth loss function is used to update the structural parameters.

29. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used for a program code executed by a device, and the program code includes a program code for executing the method according to any one of claims 1 to 14.

30. A chip, characterized in that: The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the method according to any one of claims 1-14.