A data processing method, a neural network training method and related equipment

By configuring R groups of pre-trained parameter values ​​for the neural network and determining the data domain according to the target indication information, the problem that the neural network cannot be personalized and adapted on the user side is solved, the prediction accuracy is improved and computing resources are saved.

CN115131593BActive Publication Date: 2025-09-16HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110321346.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-25
Publication Date
2025-09-16
Estimated Expiration
2041-03-25

AI Technical Summary

Technical Problem

The trained neural network cannot be effectively personalized and adapted to the user's data on the user side, resulting in excessive use of computing resources.

Method used

Configure R groups of pre-trained first parameter values, each group of parameter values ​​corresponds to a data domain, determine the data domain to which the sample to be processed belongs through the target indication information, and use the corresponding neural network to process it, avoiding re-training on the user side.

Benefits of technology

It improves the adaptability of neural networks to user-side data and the accuracy of prediction results, and reduces the computing resource usage on the user side.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115131593B_ABST
    Figure CN115131593B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a data processing method, a neural network training method, and related equipment. The method can be used in the field of artificial intelligence data, and the method includes: obtaining target indication information corresponding to a sample to be processed, the target indication information is used to indicate at least one data domain to which the sample to be processed belongs in R different data domains; obtaining at least one group of first parameter values ​​corresponding to at least one belonging data domain from R groups of first parameter values; determining at least one first neural network based on at least one group of first parameter values, each first neural network using a group of first parameter values ​​in the R groups; generating a first prediction result corresponding to the sample to be processed through at least one first neural network. R groups of first parameter values ​​corresponding to the R data domains are configured to improve the accuracy of the prediction result output by the neural network; because the R groups of first parameter values ​​are pre-trained, the occupation of computing resources on the user end is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a data processing method, a neural network training method, and related equipment. Background Art

[0002] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that seeks to understand the essence of intelligence and develop new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0003] Using neural networks for data processing is a common application of artificial intelligence. However, due to the diversity of user-side data, trained neural networks cannot personalize and adapt to user-side data well.

[0004] In order to solve the above problems, currently, after the trained neural network is configured on the user side, the user side data can be collected and the neural network can be trained again using the user side data. However, since the training operation needs to be performed on the user side, this solution needs to occupy a large amount of computing resources on the user side. Summary of the Invention

[0005] An embodiment of the present application provides a data processing method, a neural network training method, and related equipment, which are used to configure R groups of first parameter values ​​corresponding one-to-one to R data domains, so that the R groups of first parameter values ​​can respectively adapt to the data characteristics of R different data domains to improve the accuracy of the prediction results output by the neural network; in addition, since the R groups of first parameter values ​​are pre-trained, that is, there is no need to re-train on the user side, thereby avoiding the occupation of computing resources on the user side.

[0006] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a data processing method that can be used in the field of artificial intelligence, wherein R groups of first parameter values ​​are configured in an execution device, and the R groups of first parameter values ​​correspond to R data domains one-to-one, that is, the R groups of first parameter values ​​are obtained by training with data from R different data domains, and the data distribution characteristics corresponding to the data in different data domains in the R data domains are different, which can also be referred to as the data distribution laws corresponding to the data in different data domains in the R data domains are different, and R is an integer greater than 1. As an example, for example, the first neural network is used for image classification, that is, the training samples are specifically represented by images, then the images of different data domains may be from different image acquisition devices, or the image acquisition moments corresponding to the images of different data domains are different moments, or the images of different data domains are from different image acquisition locations, or the object types of the photographed objects in the images of different data domains are different. The method includes: an execution device obtains target indication information corresponding to a sample to be processed, the target indication information being used to indicate at least one data domain to which the sample to be processed belongs among R different data domains; the target indication information may include R values ​​corresponding one-to-one to the R different data domains, the R values ​​respectively being used to indicate the probability that the target training sample belongs to the R different data domains. The execution device obtains at least one set of first parameter values ​​corresponding to at least one belonging data domain from R groups of first parameter values; in one case, the target indication information is used to indicate one data domain to which the target training sample belongs among the R different data domains; in another case, the target indication information is used to indicate multiple data domains to which the target training sample belongs among the R different data domains. The execution device determines at least one first neural network based on the at least one set of first parameter values, each first neural network employing a set of first parameter values ​​from the R groups, and the different first neural networks having the same functions; and the sample to be processed is processed by the at least one first neural network to generate a first prediction result corresponding to the sample to be processed.

[0008] In this implementation, R groups of first parameter values ​​are configured on the execution device, and the R groups of first parameter values ​​correspond one-to-one to R data domains. After obtaining the sample to be processed, at least one data domain to which the sample to be processed belongs in the R different data domains will be determined first, and then at least one group of first parameter values ​​will be selected from the R groups of first parameter values, and at least one first neural network will be determined based on the at least one group of first parameter values, and then the prediction result corresponding to the sample to be processed will be determined using the aforementioned at least one first neural network; that is, the R groups of different first parameter values ​​are obtained by training based on training samples of R different data domains, so that the R groups of first parameter values ​​can respectively adapt to the data characteristics of the R different data domains, and can flexibly obtain the corresponding neural network according to the data domain where the sample to be processed is located, so as to improve the adaptability of the obtained neural network to the sample to be processed on the user end, so as to improve the accuracy of the prediction result output by the neural network; in addition, since the R groups of first parameter values ​​are pre-trained, that is, no re-training is required on the user end, thereby avoiding the occupation of computing resources on the user end.

[0009] In a possible implementation of the first aspect, the execution device is further configured with a second parameter value, the first parameter value is a parameter value used by a first neural network layer in the first neural network, and the second parameter value is a parameter value used by a second neural network layer in the first neural network. The first neural network layer is a neural network layer in the first neural network for performing a normalization operation, or the first neural network layer can also be referred to as a neural network layer in the first neural network for performing a standardization operation. As an example, the first neural network layer can be specifically expressed as a batch normalization layer (BN), a neural network layer for performing layer normalization (LN), a neural network layer for performing instance normalization (IN), or other neural network layers capable of performing a normalization operation, etc., which are not exhaustive here. The second neural network layer is a neural network layer in the first neural network other than the first neural network layer, and different first neural networks in at least one first neural network use the same second parameter value. The execution device determines at least one first neural network based on at least one set of first parameter values, which may include: a training device substitutes the first parameter values ​​of a target group and the set of second parameter values ​​from the at least one set into a third neural network to obtain a first neural network; wherein the first parameter values ​​of the target group are any set of first parameter values ​​from the at least one set of first parameter values, and the network architecture of the third neural network is identical to that of the first neural network. The difference between the third neural network and the first neural network is that the parameters in the third neural network do not have parameter values, while the parameters in the first neural network do have parameter values. The training device performs the aforementioned operation for each set of first parameter values ​​in the at least one set, thereby obtaining at least one first neural network corresponding one-to-one to the at least one set of first parameter values.

[0010] In this implementation, since technicians have found in research that the neural network layer used to perform normalization operations in the neural network has the greatest impact from data in different data domains, only R groups of first parameter values ​​corresponding to the R data domains are configured. That is, the difference in the R first neural networks is that the parameter values ​​of the neural network layer used to perform normalization operations are different, which reduces the amount of parameters that need to be sent to the user end, which is beneficial to improving the utilization of network resources. The trained R groups of first parameter values ​​are respectively adapted to the R data domains, so that the R groups of first parameter values ​​can be used to have a good adaptation to the samples to be processed in R different data domains, so as to improve the accuracy of the prediction results output by the first neural network.

[0011] In one possible implementation of the first aspect, an execution device obtains target indication information corresponding to a sample to be processed, including: the execution device inputs the sample to be processed into a second neural network, and obtains target indication information output by the second neural network. The functions of the first neural network are different from those of the second neural network, the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, and the first feature extraction network and the second feature extraction network use the same second parameter value. It should be noted that the second parameter value is a general concept, and the second parameter value generally refers to the parameter value used by the second neural network layer in the first neural network and the parameter value used by the second neural network layer in the second feature extraction network. The set of second parameter values ​​configured by the execution device includes not only the parameter value of the second neural network layer in the first feature extraction network, but also the parameter value of the second neural network layer in the first classification network, so that the set of second parameter values ​​configured in the execution device includes the second parameter value required by the second feature extraction network.

[0012] In this implementation, since the process of updating the second parameter value needs to obey the training goal of narrowing the similarity between the first prediction result and the first expected result, that is, in the training stage, not only the second neural network as a whole needs to obey the training goal of narrowing the similarity between the target indication information and the second expected result, but also the second feature extraction network in the second neural network needs to obey the training goal of narrowing the similarity between the first prediction result and the first expected result, so as to further improve the accuracy of the first prediction result finally obtained.

[0013] In a possible implementation of the first aspect, the execution device processes the sample to be processed through at least one first neural network to generate a first prediction result corresponding to the sample to be processed, including: the execution device processes the sample to be processed through different first neural networks in the at least one first neural network to generate at least one second prediction result corresponding to the sample to be processed; and determines the first prediction result based on the at least one second prediction result.

[0014] In this implementation, each acquired first neural network is used to generate a second prediction result corresponding to the sample to be processed, and then at least one second prediction result is combined to determine the first prediction result, providing an implementation method for generating the first prediction result.

[0015] In a possible implementation of the first aspect, in one case, the execution device obtains a set of first parameter values, and then the execution device performs a classification operation on the target training sample through the first neural network to generate a first predicted category corresponding to the target training sample. In another case, the execution device obtains R sets of first parameter values, and then the execution device performs a classification operation on the target training sample through R first neural networks to generate R second predicted categories corresponding to the target training sample; based on target indication information, the R second prediction results are weighted and summed to obtain a first prediction result, and the target indication information is further used to indicate the probability value of each second prediction result corresponding to each first neural network. In another case, the execution device obtains at least one set of first parameter values ​​(k sets of first parameter values ​​or p sets of first parameter values), and then the execution device performs a classification operation on the target training sample through at least one first neural network to generate at least one second predicted category corresponding to the target training sample. The k probability values ​​or the p probability values ​​in the target indication information are preprocessed so that the sum of the k probability values ​​or the p probability values ​​after the preprocessing is 1. The execution device performs weighted summation on the k second prediction results according to the k probability values ​​that have been preprocessed or the p probability values ​​that have been preprocessed to obtain the first prediction result.

[0016] In a possible implementation of the first aspect, the samples to be processed include N groups of support samples and query samples, where N is an integer greater than or equal to 1, and the N groups of support samples and query samples correspond to meta-tasks.

[0017] In this implementation, during the training phase, a group of target training samples includes N types of support samples and query samples, which means that the first neural network is trained using meta-learning. Correspondingly, after obtaining R groups of mature first parameter values, meta-learning is also used for data inference. Since the user end will use R groups of different first parameters to process the to-be-processed data from R different data domains, the to-be-processed data belonging to the same data domain may be relatively small. The meta-learning method is more conducive to mining the features of a small amount of data and is conducive to improving the accuracy of the final output prediction results.

[0018] In one possible implementation of the first aspect, the first neural network is configured to perform a classification operation or a regression operation. Furthermore, when the first neural network is configured to perform a classification operation, the data to be processed may be an image or speech; and when the first neural network is configured to perform a regression operation, the data to be processed may be discrete data.

[0019] In this implementation, the first neural network is not only a neural network that can perform classification tasks, but also a neural network that can perform regression tasks, which expands the application scenarios of this solution and improves the implementation flexibility of this solution.

[0020] In a second aspect, an embodiment of the present application provides a neural network training method that can be used in the data domain of artificial intelligence, the method comprising: a training device obtains a target training sample and obtains target indication information corresponding to the target training sample, the target indication information being used to indicate to which data domain the target training sample belongs in R different data domains; the training device obtains at least one group of first parameter values ​​from the R groups of first parameter values ​​based on the target indication information; the training device determines at least one first neural network based on the at least one group of first parameter values, each first neural network in the at least one first neural network adopts a group of first parameter values ​​in the R group, and different first neural networks have the same functions; the training device processes the target training sample through the at least one first neural network to generate a first prediction result corresponding to the target training sample; the training device generates a function value of a first loss function based on the first expected result and the first prediction result corresponding to the target training sample, and trains the at least one first neural network based on the function value of the first loss function to update the at least one group of first parameter values ​​until a preset condition is met, wherein the first loss function indicates the similarity between the expected result and the first prediction result.

[0021] In this implementation, the R groups of mature first parameter values ​​obtained through training correspond one-to-one to the R data domains. Since the R groups of different first parameter values ​​are obtained through training based on training samples of R different data domains, the R groups of first parameter values ​​can respectively adapt to the data characteristics of the R different data domains. After the R groups of mature first parameter values ​​are configured in the execution device, the execution device can flexibly obtain at least one corresponding group of first parameter values ​​according to the data domain where the samples to be processed are located, so as to improve the adaptability of the obtained neural network to the samples to be processed on the user side, so as to improve the accuracy of the prediction results output by the neural network; in addition, since the R groups of first parameter values ​​are pre-trained, that is, they do not need to be re-trained on the user side, thereby avoiding the occupation of computing resources on the user side.

[0022] In a possible implementation of the second aspect, a training device obtains target indication information corresponding to a target training sample, including: the training device inputs the target training sample into a second neural network to output the target indication information through the second neural network, wherein the function of the first neural network is different from the function of the second neural network. The method further includes: the training device generates a function value of a second loss function based on a second expected result corresponding to the target training sample and the target indication information, wherein the second expected result indicates that the target training sample correctly belongs to a data domain in R different data domains, and the second loss function indicates the similarity between the second expected result and the target indication information; the training device trains at least one first neural network based on the function value of the first loss function, including: the training device trains the second neural network and the at least one first neural network based on the function value of the first loss function and the function value of the second loss function.

[0023] In this implementation, target indication information is generated by a second neural network. Compared with obtaining the target indication information by means other than a neural network, since the parameter values ​​of the second neural network can be learned during the training phase, and the training device comprehensively trains the second neural network based on the function values ​​of the first loss function and the function values ​​of the second loss function, it is beneficial to improve the accuracy of the final first prediction result.

[0024] In a possible implementation of the second aspect, a training device trains at least one first neural network according to a function value of a first loss function to update at least one set of first parameter values, including: the training device trains at least one first neural network according to the function value of the first loss function to update at least one set of first parameter values ​​and second parameter values; wherein the first parameter value is a parameter value adopted by a first neural network layer in the first neural network, the second parameter value is a parameter value adopted by a second neural network layer in the first neural network, the first neural network layer is a neural network layer in the first neural network for performing a normalization operation, the second neural network layer is a neural network layer in the first neural network other than the first neural network layer, and different first neural networks in at least one first neural network adopt the same second parameter value.

[0025] In a possible implementation of the second aspect, the method further includes: a training device generating a function value of a second loss function based on a second expected result and target indication information corresponding to a target training sample, wherein the second expected result indicates that the target training sample correctly belongs to a data domain in R different data domains, and the second loss function indicates the similarity between the second expected result and the target indication information. The training device trains at least one first neural network based on the function value of the first loss function to update at least one set of first parameter values ​​and second parameter values, including: the training device trains the second neural network and at least one first neural network based on the function value of the first loss function and the function value of the second loss function to update at least one set of first parameter values, second parameter values, and third parameter values; wherein the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, the first feature extraction network and the second feature extraction network use the same second parameter value, and the neural network layer used for normalization processing in the second neural network uses the third parameter value.

[0026] In a possible implementation of the second aspect, the training device processes the sample to be processed through at least one first neural network to generate a first prediction result corresponding to the sample to be processed, including: the training device processes the sample to be processed through different first neural networks in the at least one first neural network to generate at least one second prediction result corresponding to the sample to be processed; and determines the first prediction result based on the at least one second prediction result.

[0027] In a possible implementation of the second aspect, the target training samples include N groups of support samples and query samples, where N is an integer greater than or equal to 1, and the N groups of support samples and query samples correspond to meta-tasks.

[0028] For the specific implementation steps of the second aspect of the embodiment of the present application and the various possible implementation methods of the second aspect, as well as the beneficial effects brought about by each possible implementation method, please refer to the description of the various possible implementation methods in the second aspect, and will not be repeated here one by one.

[0029] In a third aspect, an embodiment of the present application provides a data processing device that can be used in the field of artificial intelligence data. The data processing device is configured with R groups of first parameter values, and the R groups of first parameter values ​​correspond one-to-one to R data domains. The data distribution characteristics corresponding to data in different data domains in the R data domains are different, and R is an integer greater than 1. The device includes: an acquisition module for acquiring target indication information corresponding to a sample to be processed, and the target indication information is used to indicate at least one belonging data domain of the sample to be processed in R different data domains; the acquisition module is also used to acquire at least one group of first parameter values ​​corresponding to at least one belonging data domain from the R groups of first parameter values; a determination module is used to determine at least one first neural network based on at least one group of first parameter values, each first neural network adopts a group of first parameter values ​​in the R group, and different first neural networks have the same functions; a processing module is used to process the sample to be processed through at least one first neural network to generate a first prediction result corresponding to the sample to be processed.

[0030] The data processing device provided in the third aspect of the embodiment of the present application can also execute the steps performed by the execution device in each possible implementation method of the first aspect. For the specific implementation steps of the third aspect of the embodiment of the present application and the various possible implementation methods of the third aspect, as well as the beneficial effects brought about by each possible implementation method, you can refer to the description of the various possible implementation methods in the first aspect, and will not repeat them one by one here.

[0031] In a fourth aspect, an embodiment of the present application provides a neural network training device that can be used in the field of artificial intelligence data, the device including: an acquisition module for acquiring a target training sample and acquiring target indication information corresponding to the target training sample, the target indication information being used to indicate to which data domain the target training sample belongs in R different data domains; an acquisition module for acquiring at least one group of first parameter values ​​from R groups of first parameter values ​​according to the target indication information; a determination module for determining at least one first neural network based on at least one group of first parameter values, each first neural network in at least one first neural network adopts a group of first parameter values ​​in R groups, and different first neural networks have the same functions; a processing module for processing the target training sample through at least one first neural network to generate a first prediction result corresponding to the target training sample; a training module for generating a function value of a first loss function based on a first expected result and a first prediction result corresponding to the target training sample, and training at least one first neural network based on the function value of the first loss function to update at least one group of first parameter values ​​until a preset condition is met, wherein the first loss function indicates the similarity between the expected result and the first prediction result.

[0032] The data processing device provided in the fourth aspect of the embodiment of the present application can also execute the steps performed by the training device in each possible implementation method of the second aspect. For the specific implementation steps of the fourth aspect of the embodiment of the present application and the various possible implementation methods of the fourth aspect, as well as the beneficial effects brought about by each possible implementation method, you can refer to the description of the various possible implementation methods in the second aspect, and will not go into details here.

[0033] In a fifth aspect, an embodiment of the present application provides an execution device, which may include a processor, the processor and a memory are coupled, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the data processing method described in the first aspect above is implemented.

[0034] In a sixth aspect, an embodiment of the present application provides a training device, which may include a processor, the processor and a memory are coupled, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the neural network training method described in the second aspect above is implemented.

[0035] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the program is run on a computer, the computer executes the data processing method described in the first aspect above, or the neural network training method described in the second aspect above.

[0036] In an eighth aspect, an embodiment of the present application provides a circuit system, which includes a processing circuit, and the processing circuit is configured to execute the data processing method, or the processing circuit is configured to execute the neural network training method described in the second aspect above.

[0037] In a ninth aspect, an embodiment of the present application provides a computer program which, when executed on a computer, enables the computer to execute the data processing method described in the first aspect above, or enables the computer to execute the neural network training method described in the second aspect above.

[0038] In a tenth aspect, an embodiment of the present application provides a chip system, which includes a processor for implementing the functions involved in the above-mentioned various aspects, for example, sending or processing the data and / or information involved in the above-mentioned method. In one possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the server or communication device. The chip system can be composed of a chip, or it can include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of the structure of the artificial intelligence main framework provided in the embodiment of the present application;

[0040] Figure 2 A system architecture diagram of a data processing system provided in an embodiment of the present application;

[0041] Figure 3 A flowchart of a neural network training method provided in an embodiment of the present application;

[0042] Figure 4a A schematic diagram of data distribution characteristics in the data processing method provided in an embodiment of the present application;

[0043] Figure 4b Another schematic diagram of data distribution characteristics in the data processing method provided in the embodiment of the present application;

[0044] Figure 5 A schematic diagram of a target training sample in the neural network training method provided in an embodiment of the present application;

[0045] Figure 6 Another flowchart of a neural network training method provided in an embodiment of the present application;

[0046] Figure 7 A schematic diagram of another flow chart of the neural network training method provided in an embodiment of the present application;

[0047] Figure 8 A flowchart of a data processing method provided in an embodiment of the present application;

[0048] Figure 9 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0049] Figure 10 A schematic diagram of the structure of a neural network training device provided in an embodiment of the present application;

[0050] Figure 11 Another structural diagram of a neural network training device provided in an embodiment of the present application;

[0051] Figure 12 A schematic diagram of the structure of an execution device provided in an embodiment of the present application;

[0052] Figure 13 A schematic diagram of the structure of the training device provided in an embodiment of the present application;

[0053] Figure 14 A schematic diagram of the structure of the chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0055] The embodiments of the present application are described below in conjunction with the accompanying drawings. Persons skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0056] First, the overall workflow of the artificial intelligence system is described. Figure 1 , Figure 1 The following diagram illustrates a structural diagram of the AI ​​framework. This framework is explained below from two perspectives: the "intelligent information chain" (horizontal axis) and the "IT value chain" (vertical axis). The "intelligent information chain" reflects the entire process from data acquisition to processing. For example, it encompasses the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. Throughout this process, data undergoes a condensed progression from "data-information-knowledge-wisdom." The "IT value chain," encompassing the entire process from the underlying infrastructure of human intelligence, information (provided and processed by technology), to the system's industrial ecosystem, reflects the value that AI brings to the information technology industry.

[0057] (1) Infrastructure

[0058] The infrastructure provides computing power support for artificial intelligence systems, enabling communication with the outside world and providing support through the basic platform. Communication with the outside world is achieved through sensors; computing power is provided by intelligent chips, which can specifically adopt hardware acceleration chips such as central processing units (CPUs), embedded neural network processing units (NPUs), graphics processing units (GPUs), application specific integrated circuits (ASICs), or field programmable gate arrays (FPGAs); the basic platform includes related platform guarantees and support such as distributed computing frameworks and networks, and can include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to obtain data, and this data is provided to the intelligent chips in the distributed computing system provided by the basic platform for calculation.

[0059] (2) Data

[0060] Data above the infrastructure layer represents the data source for the AI ​​data domain. This data includes graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0061] (3) Data processing

[0062] Data processing generally includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.

[0063] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.

[0064] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.

[0065] Decision-making refers to the process of making decisions after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.

[0066] (4) General ability

[0067] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0068] (5) Smart products and industry applications

[0069] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various data domains. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical application. Its application areas mainly include: smart terminals, smart manufacturing, smart transportation, smart homes, smart medical care, smart security, autonomous driving, safe cities, etc.

[0070] The data processing method provided by the embodiment of the present application can be applied to process problems in the above-mentioned various fields. Preferably, the data processing method provided by the embodiment of the present application can perform classification tasks or regression tasks through a trained neural network. As an example, in the field of smart terminals, a trained neural network can be used to manage the power of the terminal device. Specifically, the trained neural network can be used to perform classification operations based on the temperature of each component in the terminal device over a period of time, the power consumption of each component in the terminal device over a period of time, and the current time, so as to select a battery management strategy that is adapted to the current state of the terminal device from a plurality of battery management strategies. The management strategy can be used to indicate whether the terminal device operates in a low power consumption mode or a high power consumption mode. The management strategy can also be used to indicate whether the terminal device is charged. Since different terminal devices may have different device models and different terminal device users have different usage habits, the same trained neural network cannot adapt to the samples to be processed on each terminal device.

[0071] As another example, in the field of intelligent driving, images corresponding to the vehicle's surroundings can be collected by the vehicle's camera, and objects in the vehicle's surroundings can be identified using a trained neural network. However, since the same vehicle may go to different cities, the data distribution characteristics reflected by the images corresponding to the vehicle's surroundings in different cities are different; and during the use of the vehicle, the user may replace the camera on the vehicle, which will cause the model of the camera used to shoot objects in the vehicle's surroundings to change. The data distribution characteristics reflected by the images collected by cameras of different models are also different, and the same trained neural network cannot adapt well to various data distribution characteristics.

[0072] As another example, in the field of smart homes, a smart home can capture a user's facial expressions through a camera and score the captured facial expressions using a trained neural network. In this example, the trained neural network performs a regression task. However, because different types of smart homes may have different models and different cameras installed in different homes, the distribution characteristics of the data that the neural networks installed in different smart homes need to process may be different. In addition, the distribution characteristics of the data corresponding to the facial expressions of users in different regions are also different, resulting in the same trained neural network not being able to adapt well to different smart homes.

[0073] As another example, in the scenario of personalized management of battery charging time, the charging time can be regressed based on the discrete data of the user's mobile phone model, battery model, charging location, charging time or other data. However, due to the different models of mobile phones, different battery models, and different charging habits of users in different regions, the data distribution characteristics of the samples to be processed in different user terminals are different, and the same trained neural network cannot adapt well to the situations in each user terminal.

[0074] As another example, in the field of smart manufacturing, trained neural networks can also be used to detect mura defects on mobile phone displays. Mura defects refer to subtle brightness changes in local areas of the display. Such changes usually have no boundaries and no obvious transition zones, which can easily cause visual discomfort to the human eye. However, due to the variety of mobile phone models, the models of mobile phone screens are also diverse, and the models of display screens corresponding to different batches of mobile phones of the same model may also be different, resulting in the same trained neural network being unable to adapt to the detection of various models of display screens.

[0075] In addition, the embodiments of the present application can also be applied to voice wake-up personalized management scenarios, under-screen fingerprint personalized management scenarios, etc. It should be understood that the examples here are only for the convenience of understanding the application scenarios of the embodiments of the present application, and are not intended to be exhaustive.

[0076] Before introducing the data processing method provided in the embodiment of the present application in detail, Figure 2 The data processing system provided in the embodiment of this application is introduced. Figure 2 , Figure 2 A system architecture diagram of a data processing system provided in an embodiment of the present application, Figure 2 In the embodiment, the data processing system 200 includes an execution device 210 , a training device 220 , a database 230 and a data storage system 240 , and the execution device 210 includes a computing module 211 .

[0077] Among them, the database 230 stores a training data set, the training device 220 generates a target model / rule 201, and uses the training data set in the database 230 to iteratively train the target model / rule 201 to obtain R groups of first parameter values ​​corresponding to the target model / rule 201. The R groups of first parameter values ​​correspond one-to-one to R different data domains. Substituting the R groups of first parameter values ​​into the target model / rule 201 can obtain R different first neural networks, and the R different first neural networks are respectively adapted to the R different data domains. Furthermore, the target model / rule 201 can be implemented specifically using a neural network or a non-neural network type model. In each embodiment of the present application, the target model / rule 201 is described as a neural network.

[0078] The R set of first parameter values ​​obtained by the training device 220 can be applied to various systems or devices, such as mobile phones, tablets, laptops, VR devices, monitoring systems, radar data processing systems, and the like. The execution device 210 can access data, code, and the like from the data storage system 240, or store data, instructions, and the like in the data storage system 240. The data storage system 240 can be located within the execution device 210, or it can be an external memory device relative to the execution device 210.

[0079] The calculation module 211 can use the R groups of first parameter values ​​to generate a prediction result corresponding to the sample to be processed. Specifically, the calculation module 211 can obtain target indication information corresponding to the sample to be processed, the target indication information being used to indicate at least one data domain to which the sample to be processed belongs among the R different data domains, obtain at least one group of first parameter values ​​corresponding to the at least one belonging data domain from the R groups of first parameter values; determine at least one first neural network based on the at least one group of first parameter values, each first neural network using a group of first parameter values ​​from the R groups, and different first neural networks having the same function; and process the sample to be processed through the at least one first neural network to generate a first prediction result corresponding to the sample to be processed. Since the first parameter values ​​of the R group are obtained based on training samples of R different data domains, the first parameter values ​​of the R group can adapt to the data characteristics of R different data domains respectively, and can flexibly obtain the corresponding neural network according to the data domain where the samples to be processed are located, so as to improve the adaptability of the obtained neural network to the samples to be processed on the user side, so as to improve the accuracy of the prediction results output by the neural network; in addition, since the first parameter values ​​of the R group are pre-trained, that is, there is no need to re-train on the user side, which avoids the occupation of computing resources on the user side.

[0080] In some embodiments of this application, please refer to Figure 2The "user" can directly interact with the execution device 210, that is, the execution device 210 can directly display the output first prediction result to the "user". It is worth noting that Figure 2 This is merely a schematic diagram of the architecture of a data processing system provided by an embodiment of the present invention, and the positional relationships between the devices, components, modules, etc. shown in the diagram do not constitute any limitation. For example, in other embodiments of the present application, the execution device 210 and the client device may also be separate devices, and the execution device 210 may be configured with an input / output (I / O) interface, through which the execution device 210 exchanges data with the client device.

[0081] In combination with the above description, it can be seen that the specific implementation process of the training phase and the reasoning phase of the data processing method provided in the embodiment of the present application will be described below.

[0082] 1. Training Phase

[0083] In the embodiment of the present application, the training phase describes the process of how the training device 220 uses the training data set in the database 230 to obtain R groups of mature first parameter values. Since the neural network trained through the embodiment of the present application can be used for classification, regression, detection or other functions, and when the trained neural network performs different functions, the training steps are different. The following introduces the training process of the trained neural network performing the two functions of classification and regression respectively.

[0084] (1) The trained neural network is used for classification

[0085] In the embodiments of the present application, the neural network trained for classification refers to the prediction result output by the neural network based on the output of the classification network. For example, speech recognition and speech translation are all implemented through the classification network and are also considered to be trained for classification. Figure 3 , Figure 3 A flowchart of a neural network training method provided in an embodiment of the present application is provided. The neural network training method provided in an embodiment of the present application may include:

[0086] 301. The training device obtains a target training sample.

[0087] In an embodiment of the present application, the training device is configured with a target training data set for performing training operations on the first neural network. The target training data set includes multiple training samples and a first expected result corresponding to each training sample. The first expected result can also be understood as the correct result corresponding to the target training sample. The specific expression of the training sample and the first expected result needs to be determined in combination with the specific function of the first neural network.

[0088] As an example, if the first neural network is used to identify objects in an image, each training sample can be specifically represented by an image, and the first expected result can be specifically represented by the expected category of the object in the image, which can be a rabbit, a car, a cat, a tiger, a dolphin, etc. As another example, if the first neural network is used to regress charging time, a training sample can include the model of the mobile phone, the battery model, the charging location, the charging time, or other discrete data, and the first expected result can be a charging time of 6 hours, a charging time of 3 hours, a charging time of 9 hours, etc. The examples here are only for the convenience of understanding this solution and are not used to limit this solution.

[0089] The process of preprocessing the training data in the target training data set. In one implementation, when the training device uses a second neural network (described in subsequent step 302) to predict the target attribution domain corresponding to the target training sample, or when the training device uses a meta-learning training method to train the first neural network, the training device needs to divide the entire target training data set into R different data domains, and the data distribution characteristics corresponding to the data in different data domains in the R data domains are different, which can also be called the data distribution laws corresponding to the data in different data domains in the R data domains are different.

[0090] As an example, if the first neural network is used for image classification, that is, the training samples are specifically represented by images, then the images in different data domains may originate from different image acquisition devices, or the images in different data domains may correspond to different image acquisition times, or the images in different data domains may originate from different image acquisition locations, or the images in different data domains may capture different types of objects. Furthermore, the aforementioned image acquisition devices include, but are not limited to, cameras, radars, or other types of image acquisition devices; the aforementioned time periods may refer to different time periods within a day; the aforementioned image acquisition locations may be divided at a granularity of province, city, or county, etc.; the aforementioned object types may be divided at a granularity of kingdom, phylum, class, order, family, genus, or species, etc., all of which are not limited herein. Furthermore, as an example, if the overall brightness of the images captured in the monitoring system between 7 PM and 6 AM is relatively low, then the data distribution characteristic of the image subset consisting of the images captured between 7 PM and 6 AM may be relatively low brightness; as another example, if a camera has a low resolution, then the data distribution characteristic of the images captured by that camera may be relatively low resolution, etc., all of which are not limited herein.

[0091] For a more intuitive understanding of this solution, please refer to Figure 4a and Figure 4b , Figure 4a and Figure 4bThese are two schematic diagrams of data distribution characteristics in the data processing method provided in the embodiments of the present application. Figure 4a , mini-ImageNet dataset, dog dataset, CUB dataset and cat dataset are four existing datasets, Figure 4a These four different data sets are mapped to the same two-dimensional plane by Figure 4a It can be seen that the data distribution patterns of the four different data sets are different. Figure 4b , Figure 4b In the figure, two schematic diagrams of data distribution characteristics are shown by taking the two-dimensional coordinate system as an example. Figure 4b The horizontal and vertical axes of the two-dimensional coordinate system correspond to the two dimensions that describe the data distribution of the image. It should be understood that the data distribution characteristics can also be displayed through three-dimensional coordinate graphs or other graphics, which are not exhaustive here.

[0092] Specifically, the training device may perform a clustering operation on the target training data set to divide the entire target training data set into R training data subsets, and obtain the correct attribution data domain corresponding to each of the R training data subsets, where R is an integer greater than 1. As an example, if the first neural network is used to manage the battery of a terminal device, the training device may perform a clustering operation based on the model of the terminal device, the nationality of the user corresponding to the terminal device, or other information; as another example, if the first neural network is used to classify objects in training samples in the form of images, the training device may perform the clustering operation based on factors such as the location where the training samples were collected, the time when the training samples were collected, and the device used to collect the training samples.

[0093] In another implementation, if the training device directly adopts a non-neural network method to generate a target attribution domain corresponding to the target training sample, and the training device does not adopt meta-learning to train the first neural network, then the training device does not need to preprocess the training data in the target training data set.

[0094] In one implementation, the training device trains the first neural network using a meta-learning approach. The target training data set used to perform training operations on the first neural network is split into R training data subsets. Each of the R training data subsets can be further divided into a support sample set (support set) and a query sample set (query set). The support sample set includes M groups of support samples, and the query sample set includes M groups of query samples. The samples included in the M groups of support samples and the M groups of query samples do not overlap with each other, to ensure that support samples and query samples do not overlap in a meta-task.

[0095] Among them, a group of target training samples may include N types of support samples and n query samples, each type of support sample in the N types of support samples includes at least one support sample, and the correct category of any query sample is included in the aforementioned N types of categories; N is an integer greater than or equal to 1 and less than or equal to M, and n is an integer greater than or equal to 1. It should be noted that when the first neural network is used to perform a classification operation, N types of support samples are equivalent to N groups of support samples, and one type of support sample is a group of support samples. In an embodiment of the present application, in the training phase, a group of target training samples includes N types of support samples and query samples, which means that the first neural network is trained using a meta-learning method. Correspondingly, after obtaining R groups of mature first parameter values, a meta-learning method is also used for data inference. Since the user end will use R groups of different first parameters to process the to-be-processed data from R different data domains, the to-be-processed data belonging to the same data domain may be relatively small. The meta-learning method is more conducive to mining the features of a small amount of data and is conducive to improving the accuracy of the final output prediction results.

[0096] Specifically, the training device randomly selects N types of support samples from the M groups of support samples included in any one of the R training data subsets (hereinafter referred to as the "target training data subset" for the convenience of description), and selects n query samples from the M groups of query samples included in the target training data subset, and any query sample among the n query samples belongs to one of the aforementioned N categories; that is, all training samples in a group of target training samples come from the same training data subset (that is, from the same data domain), and the category of any query sample is included in the support sample.

[0097] The training device also obtains the correct category corresponding to each supporting sample (i.e., the labeling result corresponding to each supporting sample) and the correct category corresponding to each query sample (i.e., the labeling result corresponding to each query sample, also referred to as the first expected result in the embodiment of the present application). In a meta-task, the supporting samples are used to guide the first neural network to learn the characteristics of each of the N types of supporting samples, and the query samples are used to test the classification ability of the first neural network.

[0098] Furthermore, in one application scenario, the first neural network is used to classify objects in the training samples, and the value of N is greater than or equal to 2. As an example, for example, the value of N is 5, the supporting samples and the query samples are specifically images, and the categories of the N types of support images are cats, dogs, lions, strawberries, and apples, respectively. Then, the category of any query image is one of cats, dogs, lions, strawberries, or apples. As another example, for example, the value of N is 3, the supporting samples and the query samples are specifically voices, and the categories of the N types of support voices are the voice of the owner himself, the voice of User A (non-owner), and the voice of User B (non-owner). It should be understood that the examples given here are only for the convenience of understanding this solution and are not used to limit this solution. It should be understood that the examples given here are only for the convenience of understanding this solution.

[0099] For a more intuitive understanding of the concept of target training samples, please refer to Figure 5 , Figure 5 A schematic diagram of target training samples in the neural network training method provided in an embodiment of the present application. Figure 5 In this example, both the support samples and the query samples are images. Figure 5 As shown, a group of target training samples comes from the same data domain in R data domains. A group of target training samples used to perform a meta-task includes 5 categories of first support images and multiple first query images; the 5 categories are dog, wolf, table and sofa, each category of first support images includes at least one first support image, and the multiple first query images include images of the correct categories of dog and sofa. The category dog ​​and the category sofa are both in the aforementioned 5 categories. It should be understood that Figure 5 The examples in the text are only for facilitating the understanding of the concept of target training samples and are not intended to limit this solution.

[0100] In another application scenario, the first neural network is used to manage the battery power of the terminal device. As an example, the value of N can be 4, and the N categories are low-power operation without charging, low-power operation and charging, high-power operation without charging, and high-power operation and charging, etc., which are not enumerated here.

[0101] In another implementation, if the training device does not use meta-learning to perform training operations on the first neural network, the training device may randomly select a training sample from the entire target training data set, regard the selected training sample as the target training sample, and obtain a first expected result corresponding to the target training sample.

[0102] 302. The training device obtains target indication information corresponding to the target training sample, where the target indication information is used to indicate at least one data domain to which the target training sample belongs among R different data domains.

[0103] In this embodiment of the present application, after obtaining a target training sample, the training device needs to obtain target indication information corresponding to the target training sample. The target indication information indicates at least one of the R different data domains to which the target training sample belongs. For an understanding of the data domains, please refer to the description of step 301 above and will not be repeated here.

[0104] Furthermore, the target indication information may include R values ​​corresponding one-to-one to R different data domains, and the R values ​​are respectively used to indicate the probability that the target training sample belongs to the R different data domains. In one case, the target indication information is used to indicate one of the R different data domains to which the target training sample belongs. That is, if one of the R probability values ​​is 1 and the remaining values ​​are 0, the target indication information is used to indicate that the target training sample belongs to the data domain corresponding to the probability value of 1 among the R different data domains. In another case, the target indication information is used to indicate the target training sample's multiple belonging data domains in R different data domains. As an example, if the value of R is 4, the target indication information is specifically expressed as (0.1, 0.4, 0.2, 0.3), which means that the probability of the target training sample belonging to the four data domains is 0.1, 0.4, 0.2 and 0.3 respectively. It should be understood that the examples here are only for the convenience of understanding this scheme and are not used to limit this scheme.

[0105] Specifically, in one implementation, the training device inputs the target training sample into the second neural network, so that the second neural network outputs target indication information. Furthermore, if the training device employs meta-learning to perform training operations on the first neural network, the training device inputs a set of target training samples into the second neural network. Since the set of target training samples are all selected from the same data domain, the target indication information is used to indicate the data domain to which each training sample in the set of target training samples belongs. If the training device does not employ meta-learning to perform training operations on the first neural network, the training device inputs a single target training sample into the second neural network.

[0106] Among them, the second neural network can also be specifically manifested as a neural network for performing classification operations. It should be noted that the second neural network can also be specifically manifested as other types of neural networks. The examples here are only to prove the feasibility of this solution and are not used to limit this solution. However, it should be noted that even if the first neural network is also used to perform classification tasks, the functions of the second neural network and the first neural network are different. The purpose of the second neural network performing the classification operation is to determine the data domain to which the target training sample belongs. The purpose of the first neural network performing the classification operation can be determined in combination with the functional requirements of the first neural network in the actual product. As an example, the second classification network can be a shallow neural network including a fully connected layer, a rectified linear unit (ReLU) layer, and a normalized index (Softmax) layer.

[0107] Furthermore, the second neural network includes a second feature extraction network and a second classification network, and the first neural network includes a first feature extraction network and a first classification network. In one embodiment, the second feature extraction network and the first feature extraction network are completely different feature extraction networks, that is, the network architecture of the second neural network is completely different from the network architecture of the first neural network. Furthermore, the second neural network can be trained synchronously with the first neural network or separately, which is not limited here. In another embodiment, the network architecture of the first feature extraction network and the second feature extraction network is the same. In this case, the second neural network and the first neural network need to be trained simultaneously.

[0108] In another implementation, the training device may be pre-configured with clustering rules, and based on the clustering rules, the training device directly performs a clustering operation on the target training samples to generate target indication information corresponding to the target training samples. If the training device uses a meta-learning approach to train the first neural network, the training device performs a clustering operation on the set of target training samples obtained in step 301 to generate the target indication information. If the training device does not use a meta-learning approach to train the first neural network, the training device directly performs a clustering operation on a target training sample to generate the target indication information.

[0109] 303. The training device obtains at least one group of first parameter values ​​corresponding to at least one attribution data domain from the R groups of first parameter values.

[0110] In an embodiment of the present application, before performing a training operation on the first neural network, the training device also initializes R groups of first parameter values ​​and a third neural network without parameter values. The initialized R groups of first parameter values ​​can be the same or different. During a training operation on the first neural network, the training device updates at least one group of first parameter values ​​in the R groups of first parameter values. After performing multiple training operations on the first neural network, the training device can iteratively update the R groups of first parameter values ​​to obtain mature R groups of first parameter values. The third neural network has the same functions and network architecture as the first neural network, differing only in that the parameters in the third neural network do not carry parameter values. Substituting the parameters into the third neural network yields the first neural network.

[0111] Furthermore, the R groups of first parameter values ​​correspond one-to-one to the R data domains. The first parameter value may be a parameter value adopted by the first neural network layer in the first neural network, where the first neural network layer refers to a neural network layer in the first neural network for performing a normalization operation, or the first neural network layer may also be referred to as a neural network layer in the first neural network for performing a standardization operation, etc. As an example, the first neural network layer may be specifically expressed as a batch normalization layer (BN), a neural network layer for performing layer normalization (LN), a neural network layer for performing instance normalization (IN), or other neural network layers capable of performing normalization operations, etc., which are not exhaustive here.

[0112] Furthermore, a first neural network may include multiple first neural network layers. If the first neural network layer is specifically a BN layer, the parameters corresponding to a BN layer may include a running mean, a running standard deviation, a weight, and a bias. To more intuitively understand the two types of parameters, the formulas for the running mean and the running standard deviation are disclosed below:

[0113]

[0114] Among them, r = 1, ..., R, represents the rth data domain in R different data domains, there are J BN layers in a first neural network, j = 1, 2, ..., J, represents J different BN layers in the same first neural network, Represents μ r,j The i-th scalar in μ r,jAt least one parameter of the moving average type included in the j-th BN layer in the r-th group of first parameter values, Represents σ r,j The i-th scalar in σ r,j including at least one parameter of the type of moving standard deviation included in the j-th BN layer in the r-th group of first parameter values, Represents z r,j The i-th scalar in z r,j is the input feature map of the jth BN layer in the first neural network corresponding to the first parameter value of the rth group, |U i |Representing U i The number of all indicators included in U i Representatives and For all indicators in the same channel, ∈ represents the regularization factor used to calculate the standard deviation. It should be noted that the formulas (1) and (2) are only examples and are not used to limit this solution.

[0115] Optionally, if the second feature extraction network in the second neural network and the first feature extraction network in the first neural network adopt the same neural network architecture, the training device needs to initialize a set of third parameter values ​​in addition to initializing R groups of first parameter values. The R groups of first parameter values ​​correspond one-to-one to R data domains, that is, the training device also needs to initialize a set of third parameter values ​​for the second feature extraction network in the second neural network. Similar to the first parameter values, the third parameter layer is the parameter of the neural network layer in the second feature extraction network used to perform normalization operations. For the specific form of the neural network layer used to perform normalization operations, please refer to the above description and will not be repeated here.

[0116] Before performing a training operation on the first neural network, the training device may also initialize a set of second parameter values, where the second parameter values ​​are parameter values ​​used by a second neural network layer in the first neural network, where the second neural network layer is a neural network layer other than the first neural network layer in the first neural network. Furthermore, the positions of the first neural network layer and the second neural network layer in the first neural network may alternate. As an example, if the first neural network is specifically a convolutional neural network, and the first neural network is used to classify objects in an image, then the first neural network layer and the second neural network layer may coexist in the neural network portion of the first neural network used for feature extraction, and the first neural network layer and the second neural network layer may coexist in the neural network portion of the first neural network used for feature processing.

[0117] After the training device obtains the target indication information in step 302, it performs a process for obtaining at least one set of first parameter values. In one implementation, if the target indication information is used to indicate a data domain (hereinafter referred to as the "first data domain") to which the target training sample belongs among R different data domains, the training device obtains a set of first parameter values ​​corresponding to the first data domain from the R sets of first parameter values.

[0118] In another implementation, if the target indication information includes R probability values, each probability value is between 0-1, that is, the target indication information is used to indicate multiple belonging data domains of the target training sample in R different data domains, then in one case, the training device directly obtains all the first parameter values ​​in the R group of first parameter values.

[0119] In another case, the training device can obtain the k probability values ​​with the highest probability values ​​from the R probability values ​​included in the target indication information, and obtain k attribution data domains (hereinafter referred to as "second attribution data domains" for the convenience of description) corresponding one-to-one to the k probability values ​​from the R data domains, and then obtain k groups of first parameter values ​​corresponding one-to-one to the k second attribution data domains, where the value of k is an integer greater than or equal to 1.

[0120] In another case, if the value of k is an integer greater than or equal to 2, the training device can obtain the k probability values ​​with the highest probability values ​​from the R probability values ​​included in the target indication information, and then use the dropout technology to discard at least one probability value from the k probability values ​​to obtain the remaining p probability values, obtain p belonging data domains corresponding one-to-one to the p probability values ​​(for the convenience of description, hereinafter referred to as "third belonging data domain"), and then obtain p groups of first parameter values ​​corresponding one-to-one to the p belonging data domains, and the value of p is an integer greater than or equal to 1. Among them, the dropout technology refers to randomly discarding at least one probability value from the k probability values ​​with the highest probability values, that is, the p groups of first parameter values ​​finally obtained include at least one group of first parameter values ​​that is not the most suitable for the target training sample, thereby increasing the execution difficulty of the p first neural networks corresponding to the p groups of first parameter values ​​in subsequent steps, that is, in the process of generating R groups of mature first parameter values ​​using multiple training samples, there will be a situation where the first neural network that is not so highly compatible with the target training sample processes the target training sample, which is conducive to increasing the difficulty of the entire training process, thereby improving the stability of the trained R groups of first parameter values ​​(that is, R groups of mature first parameter values).

[0121] Since the same second parameter value is used in the R first neural networks (that is, the same set of second parameter values ​​is used), that is, the same second parameter value is used in different first neural networks, the training device also needs to obtain a set of second parameter values. In the embodiment of the present application, since technicians have found in their research that the neural network layer used to perform normalization operations in the neural network has the greatest impact from data in different data domains, only R groups of first parameter values ​​corresponding to the R data domains are configured, that is, the difference in the R first neural networks is that the parameter values ​​of the neural network layer used to perform normalization operations are different. In the training stage, since the values ​​of the second parameter values ​​are the same, the training device trains to obtain R groups of different first parameter values, which reduces the amount of parameters that need to be trained, is conducive to shortening the duration of the entire training stage, and improves the efficiency of the training stage; in addition, after the training device completes the training operation, the amount of parameters that need to be sent to the user end is also reduced, which is conducive to improving the utilization rate of network resources, and the trained R groups of first parameter values ​​are respectively adapted to the R data domains, so that the R groups of first parameter values ​​can be used to have a good adaptation to the samples to be processed in R different data domains, so as to improve the accuracy of the prediction results output by the first neural network.

[0122] Optionally, if the second feature extraction network in the second neural network and the first feature extraction network in the first neural network use the same network architecture, the training device also needs to obtain a set of third parameter values, and the neural network layers other than the neural network layer used to perform the normalization operation in the second feature extraction network can be obtained from the set of second parameters. In addition, the parameters of the neural network layers other than the neural network layer used to perform the normalization operation in the second feature extraction network are obtained from the second parameter values, that is, the second feature extraction network and the first feature extraction network share the same set of second parameter values.

[0123] 304. The training device determines at least one first neural network based on at least one set of first parameter values, where each first neural network in the at least one first neural network adopts a set of first parameter values ​​in group R.

[0124] In the embodiment of the present application, after the training device obtains at least one group of first parameter values ​​and a group of second parameter values ​​through step 303, for any group of first parameter values ​​in the at least one group of first parameter values ​​(hereinafter referred to as "first parameter values ​​of the target group" for convenience of description), the training device substitutes the first parameter values ​​of the target group in the at least one group and the group of second parameter values ​​into the third neural network (for understanding of the third neural network, please refer to the description in the above step 303) to obtain a first neural network. The training device performs the above operation on each group of first parameter values ​​in the at least one group of first parameter values ​​to obtain at least one first neural network, and each first neural network in the at least one first neural network adopts a group of first parameter values ​​in group R; specifically, if several groups of first parameter values ​​are obtained in step 303, several first neural networks will be generated in step 304.

[0125] 305. The training device performs a classification operation on the target training sample through at least one first neural network to generate a first predicted category corresponding to the target training sample.

[0126] In an embodiment of the present application, in one case, the training device only obtains a set of first parameter values ​​in step 303, then the training device performs a classification operation on the target training sample through the first neural network to generate a first predicted category corresponding to the target training sample.

[0127] In another embodiment, after the training device obtains R sets of first parameter values ​​in step 303, the training device performs classification operations on the target training samples using the R first neural networks to generate R second prediction categories corresponding to the target training samples. The first prediction result is then determined based on the R second prediction results. Specifically, the training device may perform a weighted summation of the R second prediction results based on target indication information to obtain the first prediction result, where the target indication information is further used to indicate a probability value for each second prediction result corresponding to each first neural network.

[0128] In another case, the training device obtains at least one set of first parameter values ​​(k sets of first parameter values ​​or p sets of first parameter values) in step 303, and then the training device performs classification operations on the target training samples through at least one first neural network to generate at least one second prediction category corresponding to the target training samples. Then, the first prediction result is determined based on the at least one second prediction result; specifically, the training device can perform preprocessing based on the k probability values ​​or p probability values ​​in the target indication information so that the sum of the k probability values ​​or p probability values ​​after the preprocessing is 1. The training device performs weighted summation on the k second prediction results based on the k probability values ​​after the preprocessing to obtain the first prediction result, and the k probability values ​​after the preprocessing are used to indicate the weights of the k second prediction results. Alternatively, the training device performs weighted summation on the p second prediction results based on the p probability values ​​after the preprocessing to obtain the first prediction result, and the p probability values ​​after the preprocessing are used to indicate the weights of the k second prediction results.

[0129] In an embodiment of the present application, each acquired first neural network is used to generate a second prediction result corresponding to the sample to be processed, and then at least one second prediction result is combined to determine the first prediction result, providing an implementation method for generating the first prediction result.

[0130] 306. The training device generates a function value of a first loss function according to the first expected category and the first predicted category corresponding to the target training sample.

[0131] In an embodiment of the present application, during a training process, after obtaining the first predicted category, the training device generates a function value of the first loss function according to the first expected category and the first predicted category corresponding to the target training sample.

[0132] The first loss function indicates the similarity between the first predicted category and the first expected category, and the training goal is to improve the similarity between the first predicted category and the first expected category. The first loss function can specifically be a cross entropy loss function, a relative entropy loss function, or other types of loss functions, which are not exhaustive here.

[0133] 307. The training device generates a function value of a second loss function according to a second expected result corresponding to the target training sample and the target indication information, where the second expected result indicates that the target training sample correctly belongs to the data domain among the R different data domains.

[0134] In some embodiments of the present application, if in step 302, the training device generates target indication information through a second neural network, the training device will also generate a function value of a second loss function based on the second expected result and target indication information corresponding to the target training sample.

[0135] The second loss function indicates the similarity between the second expected result and the target indication information, and the training goal is to increase the similarity between the second expected result and the target indication information. The second expected result is used to indicate the correct data domain to which the target training sample belongs among the R different data domains. The second expected result is obtained by performing a clustering operation on the training samples in the target training data set in step 301.

[0136] To understand this solution more intuitively, an example of the first loss function and the second loss function is disclosed below:

[0137]

[0138] In formula (3), (Φ, E) represents the total loss function, Φ represents the second neural network, E represents the first neural network, R represents R data domains, and v r represents the weight of the first parameter of the rth group, (X r,s , Y r,s ), represents the supporting data, X r,s represents N groups of support samples, Y r,s Represents the labeled classification category corresponding to N groups of support samples, (X r,q , Y r,q ) represents query data, X r,q represents the query sample, Y r,q represents the first expected result corresponding to the query sample, Represents the first loss function, represents represents the first prediction result obtained by at least one first neural network, y r,q Represents the first expected result, represents the second loss function, represents the target indication information output by the second neural network, ω r Represents the second expected result. In formula (3), the cross entropy loss function is used as an example for both the first loss function and the second loss function. It should be noted that the example in formula (3) is only for the convenience of understanding this solution and is not used to limit this solution.

[0139] It should be noted that the embodiment of the present application does not limit the execution order of steps 306 and 307. Step 306 may be executed first, and then step 307; step 307 may be executed first, and then step 306; or step 306 and step 307 may be executed simultaneously.

[0140] If, in step 302 , the training device directly generates the target indication information by clustering, step 307 does not need to be performed.

[0141] 308. The training device trains at least one first neural network according to the function value of the first loss function to update at least one set of first parameter values.

[0142] In an embodiment of the present application, if step 307 is executed, the training device generates a function value of the total loss function based on the function value of the first loss function and the function value of the second loss function, and uses the function value of the total loss function to update the parameters of at least one first neural network and the parameters of the second neural network, that is, completes the update of at least one set of first parameter values, a set of second parameter values, and a set of third parameter values ​​to complete one training of the first neural network and the second neural network. It should be noted that since the first parameter value and the second parameter value both include parameters of the type of moving average, moving standard deviation, weight, and bias, the training device, after using the function value of the total loss function to perform a derivative and backpropagating the parameters of at least one first neural network and the parameters of the second neural network, also needs to perform a forward propagation operation to update the type of first parameter value.

[0143] In an embodiment of the present application, target indication information is generated by a second neural network. Compared with obtaining the target indication information by means other than a neural network, since the parameter values ​​of the second neural network can be learned during the training phase, and the training device comprehensively trains the second neural network based on the function value of the first loss function and the function value of the second loss function, it is beneficial to improve the accuracy of the first prediction result finally obtained.

[0144] In an embodiment of the present application, since in the process of updating the second parameter value, it is necessary to obey the training goal of narrowing the similarity between the first prediction result and the first expected result, that is, in the training stage, not only the second neural network as a whole needs to obey the training goal of narrowing the similarity between the target indication information and the second expected result, that is, the second feature extraction network in the second neural network also needs to obey the training goal of narrowing the similarity between the first prediction result and the first expected result, so as to further improve the accuracy of the first prediction result finally obtained.

[0145] It should be noted that in each training operation, a set of second parameter values ​​and a set of third parameter values ​​are updated, but the update process for the R set of first parameter values ​​is different. Specifically, in a training operation, in one case, the training device only obtains a set of first parameter values ​​in step 303. In this training operation, only the set of first parameter values ​​obtained in step 303 is updated. To facilitate understanding of this solution, an example of the update formula for the first parameter value is also disclosed below:

[0146]

[0147] in, represents the updated weight, represents the weight before update, The meaning of can refer to the above introduction to formula (1), α can be a pre-configured value, represents the updated deviation, represents the deviation before updating, The meaning of can refer to the above introduction to formula (2), which will not be repeated here. It should be understood that the examples in formula (4) and formula (5) are only for easier understanding of this solution and are not used to limit this solution.

[0148] In another case, the training device obtains the first parameter values ​​of the R group in step 303, and the training device uses the target indication information to update the first parameter values ​​of the R group respectively. More specifically, for any group of first parameter values ​​in the R group (hereinafter referred to as "first parameter values ​​of the target group" for the convenience of description), the training device obtains the function value of the total loss function and then performs gradient derivation, obtains the target probability value corresponding to the first parameter value of the target group from the target indication information, multiplies the result of the gradient derivation with the target probability value corresponding to the first parameter value of the target group, and then uses the product to update the first parameter value of the target group, that is, the higher the first parameter value's adaptability to the target training sample, the larger the step size of the update in one training process.

[0149] In another case, the training device obtains at least one group of first parameter values ​​(k groups of first parameter values ​​or p groups of first parameter values) in step 303, and the training device can perform preprocessing according to the k probability values ​​or p probability values ​​in the target indication information, so that the sum of the k probability values ​​or p probability values ​​after the preprocessing is 1. The training device updates the k groups of first parameter values ​​according to the k probability values ​​after the preprocessing. Alternatively, the training device updates the p groups of first parameter values ​​according to the p probability values ​​after the preprocessing. The specific implementation method is similar to the case of "obtaining R groups of first parameter values ​​in step 303" and will not be repeated here.

[0150] For a more intuitive understanding of this solution, please refer to Figure 6 , Figure 6A flow chart of a neural network training method provided in an embodiment of the present application. A1, the training device initializes a first neural network that is not configured with parameter values ​​and a second neural network that is not configured with parameter values; A2, the training device initializes R groups of first parameter values, a group of second parameter values, and a group of third parameter values; A3, the training device divides the target training data set into R training data subsets, and the R training data subsets correspond one-to-one to the R data domains; A4, the training device obtains a group of target training samples from a training data subset, and the group of target training samples includes N types of support samples and query samples; A5, the training device performs a training operation on the first neural network and the second neural network in a meta-learning manner based on the obtained group of target training samples to achieve an update of at least one group of first parameter values, a group of second parameter values, and a group of third parameter values. It should be understood that Figure 6 The examples are only for facilitating understanding of this solution and are not intended to limit this solution.

[0151] It should be noted that the training device repeatedly executes steps 301 to 308 until a preset condition is satisfied, so as to iteratively update the R groups of first parameter values, the R groups of second parameter values, and the R groups of mature first parameter values, the R groups of mature second parameter values, and the R groups of mature third parameter values. The preset condition may be that the number of iterations reaches a preset number, or that both the first loss function and the second loss function satisfy a convergence condition.

[0152] (2) The neural network trained for regression

[0153] In the embodiments of this application, please refer to Figure 7 , Figure 7 A flowchart of a neural network training method provided in an embodiment of the present application is provided. The neural network training method provided in an embodiment of the present application may include:

[0154] 701. The training device obtains a target training sample.

[0155] In the embodiment of the present application, the specific implementation of step 701 can be found in Figure 3 The description of step 301 in the corresponding embodiment will not be repeated here. Figure 3 The difference between the corresponding embodiments is that Figure 3 In the corresponding embodiment, the target training sample can be an image, text or speech, and the first expected result corresponding to the target training sample is the correct category of the sample. Figure 9 In the corresponding embodiment, the target training sample is specifically represented by discrete data to be regressed.

[0156] As an example, consider a neural network used to personalize battery charging management. The target training samples might include a user's phone model, battery model, charging location, and charging time. Accordingly, the first desired outcome corresponding to the target training samples is the correct charging duration. Since phones can control charging speed, for the same amount of power, a longer predetermined charging time can slow down the charging speed; a shorter predetermined charging time can speed up the charging speed to protect the battery and improve its lifespan. Furthermore, for example, if the charging location is home and the charging time is 11 PM, the phone's connection time with the charger will generally be longer. For example, if the charging location is office and the charging time is 10 AM, the connection time will be shorter. Different users' personal habits, phone models, battery models, and other factors can also influence the output of the first neural network. It should be understood that this example is merely for facilitating understanding of this application scenario. The trained first neural network can also be applied to other regression scenarios, and this is not intended to be limiting.

[0157] In the above example, the difference between different data fields may be the model of the terminal device, the nationality of the user or other information, etc., which is not limited here.

[0158] 702. The training device obtains target indication information corresponding to the target training sample, where the target indication information is used to indicate at least one data domain to which the target training sample belongs among R different data domains.

[0159] 703. The training device obtains at least one group of first parameter values ​​corresponding to at least one attribution data domain from the R groups of first parameter values.

[0160] 704. The training device determines at least one first neural network based on at least one set of first parameter values, where each first neural network in the at least one first neural network adopts a set of first parameter values ​​in group R.

[0161] 705. The training device performs a regression operation on the target training sample through at least one first neural network to generate a first prediction result corresponding to the target training sample.

[0162] 706. The training device generates a function value of a first loss function according to the first expected result and the first predicted result corresponding to the target training sample.

[0163] 707. The training device generates a function value of a second loss function according to a second expected result corresponding to the target training sample and the target indication information, where the second expected result indicates the correct data domain to which the target training sample belongs among the R different data domains.

[0164] 708. The training device trains at least one first neural network according to the function value of the first loss function to update at least one set of first parameter values.

[0165] In the embodiment of the present application, the specific implementation of steps 702 to 708 can be found in Figure 3 The description of steps 302 to 308 in the corresponding embodiment is omitted here. The difference is that the first neural network in this embodiment is a neural network that performs regression processing on the target training sample; specifically, the first neural network can be a fully connected neural network. The first prediction result is specifically a predicted regression result.

[0166] In the embodiment of the present application, the first neural network is not only a neural network that can perform classification tasks, but also a neural network that can perform regression tasks, which expands the application scenarios of the present solution and improves the implementation flexibility of the present solution.

[0167] In an embodiment of the present application, the R groups of mature first parameter values ​​obtained through training correspond one-to-one to the R data domains. Since the R groups of different first parameter values ​​are obtained through training based on training samples of R different data domains, the R groups of first parameter values ​​can respectively adapt to the data characteristics of the R different data domains. After the R groups of mature first parameter values ​​are configured in the execution device, the execution device can flexibly obtain at least one corresponding group of first parameter values ​​according to the data domain in which the samples to be processed are located, so as to improve the adaptability of the obtained neural network to the samples to be processed on the user side, so as to improve the accuracy of the prediction results output by the neural network. In addition, since the R groups of first parameter values ​​are pre-trained, that is, no re-training is required on the user side, thereby avoiding the occupation of computing resources on the user side.

[0168] 2. Reasoning Stage

[0169] In the embodiment of the present application, the inference stage describes how the execution device 210 uses the target model / rule 201 to perform image processing to generate a predicted image. For details, please refer to Figure 8 , Figure 8 This is a flow chart of a data processing method provided in an embodiment of the present application. The data processing method provided in an embodiment of the present application may include:

[0170] 801. The execution device obtains target indication information corresponding to the sample to be processed.

[0171] In the embodiment of the present application, the specific implementation of step 801 can be found in Figure 3 Corresponding to step 302 and Figure 7The description of step 702 in the corresponding embodiment will not be repeated here. That is, in one case, the execution device may be pre-configured with clustering rules. After obtaining the sample to be processed, the target indication information corresponding to the sample to be processed may be obtained according to the pre-configured clustering rules. In another case, the execution device generates the target indication information corresponding to the sample to be processed through a second neural network, and the second neural network is trained based on the second loss function. For the understanding of the meaning of various terms in step 801, please refer to Figures 3 to 7 The corresponding embodiments are not described in detail here.

[0172] 802. The execution device obtains at least one group of first parameter values ​​corresponding to at least one attribution data domain from R groups of mature first parameter values, where the R groups of mature first parameter values ​​are obtained through training based on a first loss function.

[0173] 803. The execution device determines at least one first neural network based on at least one set of mature first parameter values, where each first neural network adopts a set of mature first parameter values ​​in the R group.

[0174] 804. The execution device processes the sample to be processed through at least one first neural network to generate a first prediction result corresponding to the sample to be processed.

[0175] In the embodiment of the present application, the specific implementation of steps 802 to 804 can be found in Figure 3 Corresponding to steps 303 to 305 and Figure 7 The descriptions of steps 703 to 705 in the corresponding embodiment are not repeated here.

[0176] In an embodiment of the present application, R groups of first parameter values ​​are configured on the terminal device, and the R groups of first parameter values ​​correspond one-to-one to R data domains. After obtaining the sample to be processed, at least one data domain to which the sample to be processed belongs in the R different data domains will be determined first, and then at least one group of first parameter values ​​will be selected from the R groups of first parameter values, and at least one first neural network will be determined based on the at least one group of first parameter values, and then the prediction result corresponding to the sample to be processed will be determined using the aforementioned at least one first neural network; that is, the R groups of different first parameter values ​​are obtained by training based on training samples of R different data domains, so that the R groups of first parameter values ​​can adapt to the data characteristics of R different data domains respectively, and can flexibly obtain the corresponding neural network according to the data domain where the sample to be processed is located, so as to improve the adaptability of the obtained neural network to the sample to be processed on the user end, so as to improve the accuracy of the prediction result output by the neural network; in addition, since the R groups of first parameter values ​​are pre-trained, that is, there is no need to re-train on the user end, thereby avoiding the occupation of computing resources on the user end.

[0177] To provide a more intuitive understanding of the beneficial effects of the embodiments of the present application, the following further explains the beneficial effects of the embodiments of the present application in conjunction with experimental data. Please refer to Table 1 below. Table 1 uses the same data domain for the training and testing phases, and uses Res18 as an example for the neural network used for feature extraction in the first neural network.

[0178] Table 1

[0179]

[0180] Among them, Table 1 takes the training method of meta-learning as an example, 1 shot refers to 1 supporting sample in a group of supporting samples, 5 shots refers to 5 supporting samples in a group of supporting samples, Cars, Dogs and CUB are three different data sets, MultiModels and ComModels are two different neural network models, and the values ​​in Table 1 represent the accuracy of the obtained prediction results. It can be seen from Table 1 that the prediction results obtained by the data processing method provided in the embodiment of the present application have the highest accuracy.

[0181] Combined with Table 2, Table 2 takes different data domains used in the training phase and the test phase as an example.

[0182] Table 2

[0183]

[0184] The CUB row refers to the use of the miniImageNet dataset, the Cars dataset, and the Dogs dataset for training, and the CUB dataset for testing. The Cars row refers to the use of the miniImageNet dataset, the CUB dataset, and the Dogs dataset for training, and the Cars dataset for testing. The Dogs row refers to the use of the miniImageNet dataset, the CUB dataset, and the Cars dataset for training, and the Dogs dataset for testing. LFT represents a neural network model. The values ​​in Table 2 represent the accuracy of the obtained prediction results. It can be seen from Table 2 that the prediction results obtained by the data processing method provided in the embodiment of the present application have the highest accuracy.

[0185] exist Figures 1 to 8 On the basis of the corresponding embodiment, in order to better implement the above solution of the embodiment of the present application, the following also provides related equipment for implementing the above solution. Figure 9 , Figure 9A structural schematic diagram of a data processing device provided in an embodiment of the present application, wherein the data processing device 900 is configured with R groups of first parameter values, the R groups of first parameter values ​​corresponding to R data domains one-to-one, the data distribution characteristics corresponding to data in different data domains in the R data domains are different, and R is an integer greater than 1. The device includes: an acquisition module 901, used to obtain target indication information corresponding to a sample to be processed, the target indication information is used to indicate at least one belonging data domain of the sample to be processed in R different data domains; the acquisition module 901 is also used to obtain at least one group of first parameter values ​​corresponding to at least one belonging data domain from the R groups of first parameter values; a determination module 902 is used to determine at least one first neural network based on the at least one group of first parameter values, each first neural network adopts a group of first parameter values ​​in the R group, and different first neural networks have the same functions; a processing module 903 is used to process the sample to be processed through the at least one first neural network to generate a first prediction result corresponding to the sample to be processed.

[0186] In one possible design, the data processing device 900 is further configured with a second parameter value, the first parameter value is the parameter value adopted by the first neural network layer in the first neural network, the second parameter value is the parameter value adopted by the second neural network layer in the first neural network, the first neural network layer is the neural network layer in the first neural network for performing normalization operations, the second neural network layer is the neural network layer in the first neural network other than the first neural network layer, and different first neural networks in at least one first neural network adopt the same second parameter value.

[0187] In one possible design, acquisition module 901 is specifically configured to input a sample to be processed into a second neural network and obtain target indication information output by the second neural network. The first neural network and the second neural network have different functions. The second neural network includes a first feature extraction network, and the first neural network includes a second feature extraction network. The first feature extraction network and the second feature extraction network have the same network architecture, and the first feature extraction network and the second feature extraction network use the same second parameter value.

[0188] In one possible design, the processing module 903 is specifically used to process the samples to be processed respectively through different first neural networks in at least one first neural network to generate at least one second prediction result corresponding to the sample to be processed, and determine the first prediction result based on the at least one second prediction result.

[0189] In a possible design, the samples to be processed include N groups of support samples and query samples, where N is an integer greater than or equal to 13, and the N groups of support samples and query samples correspond to meta-tasks.

[0190] In one possible design, the first neural network is used to perform a classification operation or a regression operation.

[0191] It should be noted that the information interaction, execution process, etc. between the modules / units in the data processing device 900 are the same as those in the present application. Figure 8 The corresponding method embodiments are based on the same concept. For specific contents, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0192] The present application also provides a neural network training device, see Figure 10 , Figure 10 A schematic structural diagram of a neural network training device provided in an embodiment of the present application, wherein the neural network training device 1000 includes: an acquisition module 1001 for acquiring a target training sample and acquiring target indication information corresponding to the target training sample, the target indication information being used to indicate to which data domain the target training sample belongs in R different data domains; the acquisition module 1001 for acquiring at least one set of first parameter values ​​from R groups of first parameter values ​​based on the target indication information; a determination module 1002 for determining at least one first neural network based on the at least one set of first parameter values, wherein each first neural network in the at least one first neural network adopts a set of first parameter values ​​in the R groups, and different first neural networks have the same function; a processing module 1003 for processing the target training sample through the at least one first neural network to generate a first prediction result corresponding to the target training sample; and a training module 1004 for generating a function value of a first loss function based on a first expected result and a first prediction result corresponding to the target training sample, and training the at least one first neural network based on the function value of the first loss function to update the at least one set of first parameter values ​​until a preset condition is satisfied, wherein the first loss function indicates the similarity between the expected result and the first prediction result.

[0193] In one possible design, see Figure 11 , Figure 11A structural diagram of a neural network training device 1000 provided in an embodiment of the present application, wherein an acquisition module 1001 is specifically used to input a target training sample into a second neural network to output target indication information through the second neural network, and the function of the first neural network is different from that of the second neural network. The neural network training device 1000 also includes: a generation module 1005, which is used to generate a function value of a second loss function based on a second expected result and target indication information corresponding to the target training sample, wherein the second expected result indicates that the target training sample correctly belongs to a data domain in R different data domains, and the second loss function indicates the similarity between the second expected result and the target indication information; a training module 1004, which is specifically used to train the second neural network and at least one first neural network based on the function value of the first loss function and the function value of the second loss function.

[0194] In one possible design, the training module 1004 is specifically used to train at least one first neural network based on the function value of the first loss function to update at least one set of first parameter values ​​and second parameter values; wherein the first parameter value is the parameter value adopted by the first neural network layer in the first neural network, the second parameter value is the parameter value adopted by the second neural network layer in the first neural network, the first neural network layer is the neural network layer in the first neural network used to perform normalization operations, the second neural network layer is the neural network layer in the first neural network other than the first neural network layer, and different first neural networks in at least one first neural network adopt the same second parameter value.

[0195] In one possible design, see Figure 11 The neural network training device 1000 also includes: a generation module 1005, which is used to generate a function value of a second loss function based on a second expected result and target indication information corresponding to the target training sample, wherein the second expected result indicates that the target training sample correctly belongs to the data domain in R different data domains, and the second loss function indicates the similarity between the second expected result and the target indication information. The training module 1004 is specifically used to train the second neural network and at least one first neural network based on the function value of the first loss function and the function value of the second loss function to update at least one set of first parameter values, second parameter values, and third parameter values; wherein the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, the first feature extraction network and the second feature extraction network use the same second parameter value, and the neural network layer used for normalization processing in the second neural network uses the third parameter value.

[0196] In one possible design, the processing module 1003 is specifically used to process the samples to be processed respectively through different first neural networks in at least one first neural network to generate at least one second prediction result corresponding to the sample to be processed, and determine the first prediction result based on the at least one second prediction result.

[0197] In one possible design, the target training samples include N groups of support samples and query samples, where N is an integer greater than or equal to 1, and the N groups of support samples and query samples correspond to the meta-tasks.

[0198] It should be noted that the information interaction, execution process, etc. between the modules / units in the neural network training device 1000 are the same as those in the present application. Figures 3 to 7 The corresponding method embodiments are based on the same concept. For specific contents, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0199] Next, we will introduce an execution device provided by the embodiment of the present application. Figure 12 , Figure 12 This is a structural diagram of an execution device provided in an embodiment of the present application. The execution device 1200 can be specifically manifested as a virtual reality VR device, a mobile phone, a tablet, a laptop, a smart wearable device, a monitoring data processing device or a radar data processing device, etc., which is not limited here. Among them, the execution device 1200 can be deployed with Figure 9 The data processing device 900 described in the corresponding embodiment is used to implement Figure 8 The functions of the execution device in the corresponding embodiment. Specifically, the execution device 1200 includes: a receiver 1201, a transmitter 1202, a processor 1203 and a memory 1204 (wherein the number of the processor 1203 in the execution device 1200 can be one or more, Figure 12 (taking one processor as an example), the processor 1203 may include an application processor 12031 and a communication processor 12032. In some embodiments of the present application, the receiver 1201, the transmitter 1202, the processor 1203 and the memory 1204 may be connected via a bus or other means.

[0200] The memory 1204 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1203. A portion of the memory 1204 may also include non-volatile random access memory (NVRAM). The memory 1204 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.

[0201] Processor 1203 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all bus systems are referred to as a bus system in the figure.

[0202] The methods disclosed in the above embodiments of the present application can be applied to or implemented by the processor 1203. The processor 1203 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the processor 1203. The above processor 1203 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and can further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1203 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly implemented as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium with mature data capabilities, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The storage medium is located in memory 1204, and processor 1203 reads information from memory 1204 and, in conjunction with its hardware, completes the steps of the above method.

[0203] Receiver 1201 can be used to receive input digital or character information and generate signal input related to executing device-related settings and function control. Transmitter 1202 can be used to output digital or character information through the first interface. Transmitter 1202 can also be used to send instructions to the disk pack through the first interface to modify data in the disk pack. Transmitter 1202 can also include a display device such as a display screen.

[0204] In the embodiment of the present application, the processor 1203 is used to execute Figure 8 The processing method of the data executed by the execution device in the corresponding embodiment. It should be noted that the specific manner in which the application processor 12031 in the processor 1203 executes the above steps is the same as that in the present application. Figure 8 The corresponding method embodiments are based on the same concept, and the technical effects they bring are the same as those in this application. Figure 8 The corresponding method embodiments are the same. For specific contents, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0205] The present application also provides a training device. Figure 13 , Figure 13 This is a structural diagram of a training device provided in an embodiment of the present application. The training device 1300 may be deployed with Figure 10 The training device 1000 of the neural network described in the corresponding embodiment is used to implement Figures 3 to 7 Regarding the functions of the training device in the corresponding embodiment, specifically, the training device 1300 is implemented by one or more servers. The training device 1300 may vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1322 (e.g., one or more processors) and memory 1332, and one or more storage media 1330 (e.g., one or more mass storage devices) storing application programs 1342 or data 1344. The memory 1332 and storage medium 1330 may be either transient or persistent storage. The program stored in the storage medium 1330 may include one or more modules (not shown), each module including a series of instruction operations on the training device. Furthermore, the CPU 1322 may be configured to communicate with the storage medium 1330 to execute the series of instruction operations in the storage medium 1330 on the training device 1300.

[0206] The training device 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input and output interfaces 1358, and / or one or more operating systems 1341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0207] In the embodiment of the present application, the central processing unit 1322 is used to execute Figures 3 to 7 The data processing method executed by the training device in the corresponding embodiment. It should be noted that the specific manner in which the central processing unit 1322 executes the above steps is the same as that in the present application. Figures 3 to 7 The corresponding method embodiments are based on the same concept, and the technical effects they bring are the same as those in this application. Figures 3 to 7 The corresponding method embodiments are the same. For specific contents, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0208] The present application also provides a computer program product which, when executed on a computer, enables the computer to execute the aforementioned Figure 8 The steps executed by the execution device in the method described in the embodiment shown, or the computer is caused to execute the steps as described above Figures 3 to 7 The illustrated embodiment describes the steps performed by the training device in the method.

[0209] The present application also provides a computer-readable storage medium in which a program for signal processing is stored. When the program is run on a computer, the computer executes the above-mentioned Figure 8 The steps executed by the execution device in the method described in the embodiment shown, or the computer is caused to execute the steps as described above Figures 3 to 7 The illustrated embodiment describes the steps performed by the training device in the method.

[0210] The data processing device, neural network training device, execution device and training device provided in the embodiments of the present application can be specifically a chip, which includes: a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin or a circuit. The processing unit can execute the computer execution instructions stored in the storage unit to enable the chip to execute the above Figure 9 The data processing method described in the embodiment shown, or to enable the chip to perform the above Figures 3 to 7 The neural network training method described in the illustrated embodiment. Optionally, the storage unit is a storage unit within the chip, such as a register, a cache, etc. The storage unit may also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM), etc.

[0211] For details, please refer to Figure 14 , Figure 14 A schematic diagram of the structure of a chip provided in an embodiment of the present application, which can be represented as a neural network processor NPU 140. NPU 140 is mounted on the host CPU as a coprocessor and is assigned tasks by the host CPU. The core of the NPU is arithmetic circuit 1403, which is controlled by controller 1404 to extract matrix data from memory and perform multiplication operations.

[0212] In some implementations, the arithmetic circuit 1403 includes multiple processing units (PEs). In some implementations, the arithmetic circuit 1403 is a two-dimensional systolic array. The arithmetic circuit 1403 can also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1403 is a general-purpose matrix processor.

[0213] For example, assume there are input matrix A, weight matrix B, and output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from weight memory 1402 and caches it on each PE in the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from input memory 1401 and performs a matrix operation on matrix B. The partial or final matrix result is stored in accumulator 1408.

[0214] Unified memory 1406 is used to store input and output data. Weight data is directly transferred to weight memory 1402 through the Direct Memory Access Controller (DMAC) 1405. Input data is also transferred to unified memory 1406 through the DMAC.

[0215] BIU stands for Bus Interface Unit, i.e., bus interface unit 1410 , which is used for interaction between the AXI bus, DMAC, and instruction fetch buffer (IFB) 1409 .

[0216] The bus interface unit 1410 (BIU) is used for the instruction fetch memory 1409 to obtain instructions from the external memory, and is also used for the storage unit access controller 1405 to obtain the original data of the input matrix A or the weight matrix B from the external memory.

[0217] DMAC is mainly used to move input data in the external memory DDR to the unified memory 1406 or move weight data to the weight memory 1402 or move input data to the input memory 1401.

[0218] The vector calculation unit 1407 includes multiple operation processing units. When necessary, it further processes the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / fully connected layer network calculations in neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.

[0219] In some implementations, the vector calculation unit 1407 can store the processed output vector to the unified memory 1406. For example, the vector calculation unit 1407 can apply a linear function and / or a nonlinear function to the output of the operation circuit 1403, such as linear interpolation of the feature plane extracted by the convolution layer, or accumulate a vector of values ​​to generate an activation value. In some implementations, the vector calculation unit 1407 generates a normalized value, a pixel-level summed value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 1403, for example, for use in a subsequent layer in a neural network.

[0220] An instruction fetch buffer 1409 connected to the controller 1404 is used to store instructions used by the controller 1404;

[0221] Unified memory 1406, input memory 1401, weight memory 1402, and instruction fetch memory 1409 are all on-chip memories. External memories are private to the NPU hardware architecture.

[0222] in, Figures 3 to 8 The operations of each layer in the first neural network and the second neural network shown can be performed by the operation circuit 1403 or the vector calculation unit 1407.

[0223] The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the above-mentioned first aspect method.

[0224] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.

[0225] Through the description of the above implementation methods, technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general-purpose hardware, and of course can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0226] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0227] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

Claims

1. A data processing method, characterized in that: The method is applied to an execution device, wherein the execution device is configured with R groups of first parameter values, wherein the R groups of first parameter values ​​correspond one-to-one to R data fields, wherein data in different data fields in the R data fields correspond to different data distribution characteristics, and R is an integer greater than 1, and the method includes: Acquire target indication information corresponding to a sample to be processed, where the target indication information is used to indicate at least one data domain to which the sample to be processed belongs among the R different data domains; the sample to be processed is an image or a voice; Obtaining at least one group of first parameter values ​​corresponding to the at least one home data field from the R groups of first parameter values; Determining at least one first neural network based on the at least one set of first parameter values, each first neural network adopts a set of first parameter values ​​in the R group, and different first neural networks have the same function; The sample to be processed is processed by the at least one first neural network to generate a first prediction result corresponding to the sample to be processed.

2. The method according to claim 1, characterized in that The execution device is also configured with a second parameter value, the first parameter value is the parameter value adopted by the first neural network layer in the first neural network, the second parameter value is the parameter value adopted by the second neural network layer in the first neural network, the first neural network layer is the neural network layer in the first neural network used to perform normalization operations, the second neural network layer is the neural network layer in the first neural network other than the first neural network layer, and different first neural networks in the at least one first neural network adopt the same second parameter value.

3. The method according to claim 2, characterized in that The obtaining of target indication information corresponding to the sample to be processed includes: Inputting the sample to be processed into a second neural network to obtain the target indication information output by the second neural network; The function of the first neural network is different from that of the second neural network, the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, and the first feature extraction network and the second feature extraction network use the same second parameter value.

4. The method according to any one of claims 1 to 3, characterized in that The processing of the sample to be processed by the at least one first neural network to generate a first prediction result corresponding to the sample to be processed includes: Processing the sample to be processed respectively by different first neural networks of the at least one first neural network to generate at least one second prediction result corresponding to the sample to be processed; The first prediction result is determined according to the at least one second prediction result.

5. The method according to any one of claims 1 to 3, characterized in that The samples to be processed include N groups of support samples and query samples, where N is an integer greater than or equal to 1, and the N groups of support samples and the query sample correspond to meta-tasks.

6. The method according to claim 1, wherein The first neural network is used to perform a classification operation or a regression operation.

7. A neural network training method, characterized in that: The method comprises: Acquire a target training sample and acquire target indication information corresponding to the target training sample, wherein the target indication information is used to indicate to which data domain the target training sample belongs in R different data domains; the target training sample is an image or speech; Obtaining at least one set of first parameter values ​​from the R sets of first parameter values ​​according to the target indication information; Determining at least one first neural network based on the at least one set of first parameter values, wherein each first neural network in the at least one first neural network adopts a set of first parameter values ​​in the R group, and different first neural networks have the same function; Processing the target training sample by the at least one first neural network to generate a first prediction result corresponding to the target training sample; A function value of a first loss function is generated based on a first expected result and the first predicted result corresponding to the target training sample, and the at least one first neural network is trained based on the function value of the first loss function to update the at least one set of first parameter values ​​until a preset condition is met, wherein the first loss function indicates the similarity between the expected result and the first predicted result.

8. The method according to claim 7, characterized in that The acquiring target indication information corresponding to the target training sample includes: inputting the target training sample into a second neural network to output the target indication information through the second neural network, wherein a function of the first neural network is different from a function of the second neural network; The method further comprises: generating a function value of a second loss function based on a second expected result corresponding to the target training sample and the target indication information, wherein the second expected result indicates whether the target training sample correctly belongs to the data domain in the R different data domains, and the second loss function indicates a similarity between the second expected result and the target indication information; The step of training the at least one first neural network according to the function value of the first loss function includes: The second neural network and the at least one first neural network are trained according to the function value of the first loss function and the function value of the second loss function.

9. The method according to claim 7, characterized in that The step of training the at least one first neural network according to the function value of the first loss function to update the at least one set of first parameter values ​​includes: Training the at least one first neural network according to the function value of the first loss function to update the at least one set of first parameter values ​​and second parameter values; The first parameter value is a parameter value adopted by the first neural network layer in the first neural network, the second parameter value is a parameter value adopted by the second neural network layer in the first neural network, the first neural network layer is a neural network layer in the first neural network used to perform a normalization operation, the second neural network layer is a neural network layer in the first neural network other than the first neural network layer, and different first neural networks in the at least one first neural network adopt the same second parameter value.

10. The method according to claim 9, characterized in that The method further comprises: generating a function value of a second loss function based on a second expected result corresponding to the target training sample and the target indication information, wherein the second expected result indicates whether the target training sample correctly belongs to the data domain in the R different data domains, and the second loss function indicates a similarity between the second expected result and the target indication information; The step of training the at least one first neural network according to the function value of the first loss function to update the at least one set of first parameter values ​​and second parameter values ​​comprises: Training the second neural network and the at least one first neural network according to the function value of the first loss function and the function value of the second loss function to update the at least one set of first parameter values, the second parameter values, and the third parameter values; Among them, the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, the first feature extraction network and the second feature extraction network use the same second parameter value, and the neural network layer used for normalization processing in the second neural network uses the third parameter value.

11. The method according to any one of claims 7 to 10, characterized in that The processing of the target training sample by the at least one first neural network to generate a first prediction result corresponding to the target training sample includes: Processing the target training sample by different first neural networks of the at least one first neural network, respectively, to generate at least one second prediction result corresponding to the target training sample; The first prediction result is determined according to the at least one second prediction result.

12. The method according to any one of claims 7 to 10, characterized in that The target training samples include N groups of support samples and query samples, where N is an integer greater than or equal to 1, and the N groups of support samples and the query samples correspond to meta-tasks.

13. A data processing device, characterized in that: The data processing device is configured with R groups of first parameter values, the R groups of first parameter values ​​correspond to R data domains one by one, the data in different data domains in the R data domains correspond to different data distribution characteristics, R is an integer greater than 1, and the device includes: an acquisition module, configured to acquire target indication information corresponding to a sample to be processed, wherein the target indication information is used to indicate at least one data domain to which the sample to be processed belongs among the R different data domains; the sample to be processed is an image or a voice; The acquisition module is further configured to acquire at least one group of first parameter values ​​corresponding to the at least one home data domain from the R groups of first parameter values; a determination module, configured to determine at least one first neural network based on the at least one set of first parameter values, wherein each first neural network adopts a set of first parameter values ​​in the R group, and different first neural networks have the same function; A processing module is used to process the sample to be processed through the at least one first neural network to generate a first prediction result corresponding to the sample to be processed.

14. The device according to claim 13, characterized in that The data processing device is also configured with a second parameter value, the first parameter value is the parameter value adopted by the first neural network layer in the first neural network, the second parameter value is the parameter value adopted by the second neural network layer in the first neural network, the first neural network layer is the neural network layer in the first neural network used to perform normalization operations, the second neural network layer is the neural network layer in the first neural network other than the first neural network layer, and different first neural networks in the at least one first neural network adopt the same second parameter value.

15. The device according to claim 14, characterized in that The acquisition module is specifically configured to input the sample to be processed into a second neural network to obtain the target indication information output by the second neural network; The function of the first neural network is different from that of the second neural network, the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, and the first feature extraction network and the second feature extraction network use the same second parameter value.

16. The device according to any one of claims 13 to 15, characterized in that The processing module is specifically used to process the samples to be processed respectively through different first neural networks in the at least one first neural network to generate at least one second prediction result corresponding to the samples to be processed, and determine the first prediction result based on the at least one second prediction result.

17. The device according to any one of claims 13 to 15, characterized in that The samples to be processed include N groups of support samples and query samples, where N is an integer greater than or equal to 13, and the N groups of support samples and the query sample correspond to meta-tasks.

18. The device according to claim 13, characterized in that The first neural network is used to perform a classification operation or a regression operation.

19. A neural network training device, characterized in that: The device comprises: an acquisition module, configured to acquire a target training sample and acquire target indication information corresponding to the target training sample, wherein the target indication information is used to indicate to which data domain the target training sample belongs among R different data domains; the target training sample is an image or a voice; The acquisition module is configured to acquire at least one group of first parameter values ​​from the R groups of first parameter values ​​according to the target indication information; a determination module, configured to determine at least one first neural network based on the at least one set of first parameter values, wherein each first neural network in the at least one first neural network adopts a set of first parameter values ​​in the R group, and different first neural networks have the same function; a processing module, configured to process the target training sample through the at least one first neural network to generate a first prediction result corresponding to the target training sample; A training module is configured to generate a function value of a first loss function based on a first expected result corresponding to the target training sample and the first predicted result, and train the at least one first neural network based on the function value of the first loss function to update the at least one set of first parameter values ​​until a preset condition is met, wherein the first loss function indicates a similarity between the expected result and the first predicted result.

20. The device according to claim 19, characterized in that The acquisition module is specifically configured to input the target training sample into a second neural network to output the target indication information through the second neural network, wherein the function of the first neural network is different from that of the second neural network; The apparatus further includes: a generating module configured to generate a function value of a second loss function based on a second expected result corresponding to the target training sample and the target indication information, wherein the second expected result indicates whether the target training sample correctly belongs to a data domain among the R different data domains, and the second loss function indicates a similarity between the second expected result and the target indication information; The training module is specifically configured to train the second neural network and the at least one first neural network according to the function value of the first loss function and the function value of the second loss function.

21. The device according to claim 19, characterized in that The training module is specifically configured to train the at least one first neural network according to the function value of the first loss function, so as to update the at least one set of first parameter values ​​and second parameter values; The first parameter value is a parameter value adopted by the first neural network layer in the first neural network, the second parameter value is a parameter value adopted by the second neural network layer in the first neural network, the first neural network layer is a neural network layer in the first neural network used to perform a normalization operation, the second neural network layer is a neural network layer in the first neural network other than the first neural network layer, and different first neural networks in the at least one first neural network adopt the same second parameter value.

22. The device according to claim 21, characterized in that The device further comprises: a generating module, configured to generate a function value of a second loss function based on a second expected result corresponding to the target training sample and the target indication information, wherein the second expected result indicates that the target training sample correctly belongs to the data domain in the R different data domains, and the second loss function indicates a similarity between the second expected result and the target indication information; The training module is specifically configured to train the second neural network and the at least one first neural network according to the function value of the first loss function and the function value of the second loss function, so as to update the at least one set of first parameter values, the second parameter values, and the third parameter values; Among them, the second neural network includes a first feature extraction network, the first neural network includes a second feature extraction network, the first feature extraction network and the second feature extraction network have the same network architecture, the first feature extraction network and the second feature extraction network use the same second parameter value, and the neural network layer used for normalization processing in the second neural network uses the third parameter value.

23. The device according to any one of claims 19 to 22, characterized in that The processing module is specifically used to process the target training sample respectively through different first neural networks in the at least one first neural network to generate at least one second prediction result corresponding to the target training sample, and determine the first prediction result based on the at least one second prediction result.

24. The device according to any one of claims 19 to 22, characterized in that The target training samples include N groups of support samples and query samples, where N is an integer greater than or equal to 1, and the N groups of support samples and the query samples correspond to meta-tasks.

25. A computer program product, characterized in that The method comprises a computer program, which, when running on a computer, enables the computer to execute the method according to any one of claims 1 to 6, or enables the computer to execute the method according to any one of claims 7 to 12.

26. A computer-readable storage medium, characterized in that The method comprises a program, which, when running on a computer, causes the computer to execute the method according to any one of claims 1 to 6, or causes the computer to execute the method according to any one of claims 7 to 12.

27. An execution device, characterized in that: comprising a processor and a memory, the processor being coupled to the memory, The memory is used to store programs; The processor is configured to execute the program in the memory, so that the execution device executes the method according to any one of claims 1 to 6.

28. A training device, characterized in that comprising a processor and a memory, the processor being coupled to the memory, The memory is used to store programs; The processor is configured to execute the program in the memory so that the training device performs the method according to any one of claims 7 to 12.

Citation Information

Patent Citations

  • Neural network training method and device and electronic device

    CN109784490A

  • Neural network training method and device, image classification method, equipment and medium

    CN111275175A