A neural network training method, data processing method and related equipment
Through the adversarial training method, the adversarial relationship between the generator and the discriminator is used to explore the user's real click habits, solving the problem of low accuracy of prediction results in the existing technology, and achieving higher prediction accuracy.
Patent Information
- Application Number
- CN202110369441.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-06
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-04-06
AI Technical Summary
The prior art is difficult to explore the intrinsic intentions behind user behavior, resulting in a low accuracy of prediction results.
Adversarial training method is used to explore the user's real click habits through the adversarial relationship between the generator and the discriminator, thereby improving the accuracy of the prediction results.
Through adversarial training, the capabilities of generators and discriminators are continuously improved, and the generated target prediction results can more accurately reflect the user's true intentions and improve the accuracy of the prediction results.
Smart Images

Figure CN113159315B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a neural network training method, a data processing method, and related equipment. Background Art
[0002] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0003] Applying artificial intelligence technology to search systems is a common application of artificial intelligence. Specifically, during the training process, the training device generates a prediction result corresponding to a target object through a neural network. The prediction result indicates whether the user will click on the target object. The neural network is then trained based on the actual result corresponding to the target object and the prediction result until the preset conditions are met.
[0004] However, this training method simply treats the neural network as a black box and is unable to uncover the underlying intentions behind user behavior. Summary of the invention
[0005] The embodiments of the present application provide a neural network training method, a data processing method and related equipment for performing adversarial training on a discriminator and a generator. During this adversarial training process, the capabilities of the generator and the discriminator become stronger and stronger. Since the update goal of the generator is to enable the generated target prediction results to be identified as real data, that is, the update goal of the generator is to mine the user's real clicking habits, it is beneficial to train the generator to mine the user's inner true intentions, which is beneficial to improve the accuracy of the prediction results.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] In the first aspect, the embodiment of the present application provides a neural network training method, which can be used in the field of artificial intelligence. The method includes: a training device obtains a target training sample and a target correct result corresponding to the target training sample, the target training sample includes identification information of at least one target object, and the target correct result is used to indicate whether each target object in the at least one target object has been subjected to an interactive operation, and the interactive operation includes but is not limited to a click operation, a download operation, a purchase operation, a play operation, a favorite operation or other types of interactive operations. The training device inputs the target training sample into a generator to output a target prediction result through the generator, and the target prediction result is used to indicate whether each target object will be subjected to an interactive operation; the training device inputs the target training sample, the target prediction result and the target correct result into a discriminator to output a first probability value and a second probability value through the discriminator, the discriminator and the generator belong to the same target generation adversarial neural network, the first probability value is used to indicate the probability that the target correct result is true data, and the second probability value is used to indicate the probability that the target prediction result is true data; the training device performs adversarial training on the discriminator and the generator according to the first probability value and the second probability value until a preset condition is met to obtain a trained generator. Among them, adversarial training refers to the process in which the generator generates a target prediction result to deceive the discriminator, and then the discriminator determines which of the target prediction result and the target correct result is based on real data generated by real user interaction behavior. During the training process of the generator and the discriminator, the capabilities of the generator and the discriminator are made stronger and stronger, and finally reach a steady state. The preset condition can be that the number of training times of the generator and the discriminator reaches a preset number, or the prediction condition can be when the generator and the discriminator reach a steady state.
[0008] In this implementation, after the generator is used to generate the target prediction result corresponding to the target training sample, the target training sample, the target prediction result and the target correct result are also input into the discriminator, so as to output the first probability value and the second probability value through the discriminator. The discriminator and the generator belong to the same target generation adversarial neural network, the first probability value is used to indicate the probability that the target correct result is the real data, and the second probability value is used to indicate the probability that the target prediction result is the real data. Then, according to the first probability value and the second probability value, the discriminator and the generator are adversarially trained, that is, the update goal of the generator is that the generated target prediction result can deceive the discriminator so as to be identified as the real data, and the update goal of the discriminator is to be able to identify the target prediction result generated by the generator; in the process of this adversarial training, the capabilities of the generator and the discriminator become stronger and stronger, because the update goal of the generator is that the generated target prediction result can be identified as the real data, that is, the update goal of the generator is to mine the user's real clicking habits, which is conducive to mining the user's inner true intentions through training the generator, and is conducive to improving the accuracy of the prediction results.
[0009] In a possible implementation of the first aspect, the training device performs adversarial training on the discriminator and the generator according to the first probability value and the second probability value, including: the training device generates a first gradient value corresponding to the discriminator according to the first probability value and the second probability value, and updates the parameters of the discriminator according to the first gradient value, and the update target of the discriminator includes increasing the value of the first probability value and decreasing the value of the second probability value; the training device generates a second gradient value corresponding to the generator according to the second probability value, and updates the parameters of the generator according to the second gradient value, and the update target of the generator includes increasing the value of the second probability value. In this implementation, a specific implementation method for one-time training of a target generative adversarial neural network is provided, which improves the feasibility of this solution.
[0010] In a possible implementation of the first aspect, for the update process of the parameters of the discriminator, no matter the value of N is 1 or the value of N is greater than or equal to 2, the training device can calculate the function value of the first loss function according to the N first probability values and the N second probability values, and directly reversely derive the parameters of the discriminator according to the function value of the first loss function to generate a first gradient value corresponding to the discriminator, and update the parameters of the discriminator according to the first gradient value. Wherein, the update target of the first loss function includes increasing the value of the first probability value and reducing the value of the second probability value.
[0011] In a possible implementation of the first aspect, for the updating process of the parameters of the generator, if the value of N is 1, the training device can directly generate the function value of the second loss function based on a second probability value, and directly reversely derive the parameters of the generator based on the function value of the second loss function to generate a second gradient value corresponding to the discriminator, and update the parameters of the generator based on the second gradient value. The updating goal of the second loss function is to improve the value of the second probability value. If the value of N is greater than or equal to 2, the training device averages the N second probability values to generate an average value, generates a second gradient value corresponding to the generator based on the N predicted labels generated by the generator and the average value, and updates the parameters of the generator based on the second gradient value.
[0012] In a possible implementation of the first aspect, the number of target objects included in the target training sample is N, N is an integer greater than or equal to 2, the target correct result includes N correct labels corresponding to the N target objects, and the target prediction result includes N prediction labels corresponding to the N target objects. The training device outputs the target prediction result through the generator, including: the training device performs multiple reasoning operations through the generator to generate N prediction labels. In this implementation, during the current training process of the generator, the generator predicts whether the user will interact with the tth target object based on the actual interaction between the user and the first t-1 target objects. However, in the reasoning stage, the generator predicts whether the user will interact with the tth target object based on the interaction between the user and the first t-1 target objects predicted by the generator. At present, this single-step prediction method will cause the trained generator to fail to generate the optimal result, and the small errors accumulated in each prediction step will cause the errors of the N prediction labels generated by the generator to become larger and larger. In this scheme, the training phase simulates the reasoning phase. That is, in the training phase, the generator needs to process at least two target objects at a time. The generator also needs to predict whether the user will interact with the tth target object based on the interaction between the user and the first t-1 target objects predicted by the generator, so as to increase the difficulty of the training phase and enable the trained generator to generate more accurate prediction results.
[0013] In a possible implementation of the first aspect, the target object is an application, video, music, news, product link or advertisement. In this implementation, multiple specific manifestations of the target object are provided, which expands the application scenarios of this solution and improves the implementation flexibility of this solution.
[0014] In a possible implementation of the first aspect, both the generator and the discriminator are recurrent neural networks. In this implementation, a specific implementation of the generator and the discriminator is provided, and when the target training sample includes at least two target objects, the generator and the discriminator process sequence data, and the use of a recurrent neural network is conducive to mining the relationship between different target objects, and is conducive to improving the accuracy of the results output by the generator and the discriminator. Since the generator and the discriminator adopt an adversarial training method, after the accuracy of the discriminator output results is improved, it is conducive to further improving the accuracy of the prediction results output by the trained generator.
[0015] In a second aspect, an embodiment of the present application provides a data processing method that can be used in the field of artificial intelligence, the method comprising: an execution device obtains a sample to be processed, the sample to be processed includes identification information of at least one target object; the sample to be processed is input into a trained generator to output a target prediction result through the trained generator, the target prediction result is used to indicate whether each target object will be subjected to an interactive operation; wherein the generator is obtained after training a target generative adversarial neural network, the target generative adversarial neural network comprises a generator and a discriminator, in the training stage, the generator is used to generate a prediction result corresponding to the target training sample according to the target training sample, the discriminator is used to generate a first probability value and a second probability value according to the target training sample, the prediction result corresponding to the target training sample and the correct result corresponding to the target training sample, the first probability value is used to indicate the probability that the correct result corresponding to the target training sample is true data, the second probability value is used to indicate the probability that the prediction result corresponding to the target training sample is true data, and the correct result corresponding to the target training sample comes from the training data set of the target generative adversarial neural network.
[0016] In a possible implementation manner of the first aspect, the target object is an application, a video, music, news, a product link, or an advertisement.
[0017] 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.
[0018] In a third aspect, an embodiment of the present application provides a neural network training device, which can be used in the field of artificial intelligence. The neural network training device includes: an acquisition module, which is used to acquire a target training sample and a target correct result corresponding to the target training sample, the target training sample includes identification information of at least one target object, and the target correct result is used to indicate whether each target object in the at least one target object has been subjected to an interactive operation; a generation module, which is used to input the target training sample into a generator to output a target prediction result through the generator, and the target prediction result is used to indicate whether an interactive operation will be performed on each target object; a discriminant module, which is used to input the target training sample, the target prediction result and the target correct result into a discriminator to output a first probability value and a second probability value through the discriminator, the discriminator and the generator belong to the same target generation adversarial neural network, the first probability value is used to indicate the probability that the target correct result is true data, and the second probability value is used to indicate the probability that the target prediction result is true data; a training module, which is used to perform adversarial training on the discriminator and the generator according to the first probability value and the second probability value until a preset condition is met.
[0019] The neural network training device provided in the third aspect of the embodiment of the present application can also execute the steps executed by the training 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, reference can be made to the description of the various possible implementation methods in the first aspect, and they will not be repeated here one by one.
[0020] In a fourth aspect, an embodiment of the present application provides a data processing device that can be used in the field of artificial intelligence. The data processing device includes: an acquisition module, used to acquire samples to be processed, and the samples to be processed include identification information of at least one target object; a generation module, used to input the samples to be processed into a trained generator to output a target prediction result through the trained generator, and the target prediction result is used to indicate whether an interactive operation will be performed on each target object; wherein the generator is obtained after training a target generative adversarial neural network, and the target generative adversarial neural network includes a generator and a discriminator. In the training stage, the discriminator is used to generate a first probability value and a second probability value, and the first probability value is used to indicate the probability that the prediction result generated by the generator is true data, and the second probability value is used to indicate the probability that the target prediction result is true data. The target correct result comes from the training data set of the target generative adversarial neural network, and the target correct result corresponds to the prediction result generated by the generator.
[0021] 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 be repeated here one by one.
[0022] In a fifth aspect, an embodiment of the present application provides a training device, which may include a processor, the processor and a memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the training method of the neural network described in the first aspect above is implemented.
[0023] In a sixth aspect, an embodiment of the present application provides an execution device, which may include a processor, the processor and a memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the data processing method described in the second aspect above is implemented.
[0024] 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 neural network training method described in the first aspect, or the computer executes the data processing method described in the second aspect.
[0025] 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 neural network training method described in the first aspect above, or the processing circuit is configured to execute the data processing method described in the second aspect above.
[0026] 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 neural network training method described in the first aspect, or enables the computer to execute the data processing method described in the second aspect.
[0027] 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 a 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
[0028] Figure 1 A schematic diagram of the structure of the artificial intelligence main framework provided in the embodiment of the present application;
[0029] Figure 2a An application scenario diagram of a generator obtained by the neural network training method provided in an embodiment of the present application;
[0030] Figure 2b Another application scenario diagram of a generator obtained by the neural network training method provided in an embodiment of the present application;
[0031] Figure 3 A system architecture diagram of a data processing system provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of a flow chart of a neural network training method provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of the workflow of the generator in the embodiment of the present application;
[0034] Figure 6A schematic diagram of the workflow of the discriminator in the embodiment of the present application;
[0035] Figure 7 Another flowchart of the workflow of the discriminator in the embodiment of the present application;
[0036] Figure 8 A flowchart of a data processing method provided in an embodiment of the present application;
[0037] Fig. 9 A schematic diagram of the structure of a neural network training device provided in an embodiment of the present application;
[0038] Fig.10 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0039] Fig.11 A schematic diagram of the structure of an execution device provided in an embodiment of the present application;
[0040] Fig.12 A schematic diagram of the structure of a training device provided in an embodiment of the present application;
[0041] Fig.13 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] 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 need not be 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, which is only to describe the distinction mode adopted by the objects of the same attributes when describing 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.
[0043] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those 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.
[0044] First, the overall workflow of the artificial intelligence system is described. Figure 1 , Figure 1The figure shows a structural diagram of the main framework of artificial intelligence. The following is an explanation of the above artificial intelligence theme framework from the two dimensions of "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis). Among them, the "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has undergone a condensation process of "data-information-knowledge-wisdom". The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the industrial ecology process of the system.
[0045] (1) Infrastructure
[0046] The infrastructure provides computing power support for the artificial intelligence system, enables communication with the outside world, and is supported by the basic platform. It communicates with the outside world through sensors; computing power is provided by smart chips, which can specifically use hardware acceleration chips such as central processing units (CPU), embedded neural network processing units (NPU), graphics processing units (GPU), application specific integrated circuits (ASIC) or field programmable gate arrays (FPGA); the basic platform includes distributed computing frameworks and networks and other related platform guarantees and support, which can include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to obtain data, and these data are provided to the smart chips in the distributed computing system provided by the basic platform for calculation.
[0047] (2) Data
[0048] The data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data of traditional devices, including business data of existing systems and perception data such as force, displacement, liquid level, temperature, and humidity.
[0049] (3) Data processing
[0050] Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
[0051] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0052] 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.
[0053] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
[0054] (4) General ability
[0055] 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 an algorithm or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0056] (5) Smart products and industry applications
[0057] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. 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.
[0058] The embodiments of the present application can be applied to application scenarios in various fields that require the use of a search system, which can also be called a recommendation system, a search engine, a search recommendation system, etc. The search system is configured with a first neural network. When a user inputs a query request through the search system, a list to be displayed is generated through the first neural network. The list to be displayed includes identification information of M target objects, that is, the objects to be displayed are recommended through the first neural network.
[0059] Specifically, in one application scenario, please refer to Figure 2a , Figure 2aAn application scenario diagram of a generator obtained by the training method of a neural network provided in an embodiment of the present application. The generator provided in an embodiment of the present application can be used to test the performance of a trained first neural network, that is, the training device uses iterative training on the first neural network to obtain a mature first neural network, and the first neural network is used to select M target objects from a large number of target objects. The M target objects are the target objects selected by the first neural network to be displayed to the user. Then, the generator provided in an embodiment of the present application can generate M prediction labels corresponding to the M target objects one by one, and a prediction label is used to indicate whether a target object will be interactively operated by the user, that is, before the mature first neural network is put online, the generator provided in an embodiment of the present application can be used to evaluate the performance of the first neural network to improve the user experience.
[0060] In another application scenario, see Figure 2b , Figure 2b Another application scenario diagram of the generator obtained by the neural network training method provided in the embodiment of the present application. The generator provided in the embodiment of the present application can be used to assist the training process of the first neural network. There may be missing data in the training data set of the first neural network, so the generator provided in the embodiment of the present application can be used to generate a prediction label corresponding to the target object. The prediction label is used to indicate whether a target object will be interactively operated by the user, so as to supplement the training data of the first neural network.
[0061] It should be noted that the examples given here are only for the convenience of understanding the application scenarios of the embodiments of the present application. The generator provided in the embodiments of the present application can also be applied to other application scenarios, which are not exhaustively listed here.
[0062] Before introducing the data processing method provided in the embodiment of the present application in detail, Figure 3 The data processing system provided in the embodiment of the present application is introduced. Figure 3 , Figure 3 A system architecture diagram of a data processing system provided in an embodiment of the present application, in Figure 3 In the figure, the data processing system 300 includes an execution device 310, a training device 320, a database 330 and a data storage system 340, and the execution device 310 includes a computing module 311.
[0063] The database 330 stores target training data, the training device 320 generates a target model / rule 301, and uses the target training data in the database 330 to perform adversarial training on the target model / rule 301 to obtain a mature target model / rule 301. Further, the target model / rule 301 can be specifically expressed as a generative adversarial neural network, which includes a generator and a discriminator.
[0064] The mature target model / rule 301 obtained by the training device 320 can be applied to different systems or devices, and the execution device 310 can call the data, code, etc. in the data storage system 340, or store the data, instructions, etc. in the data storage system 340. The data storage system 340 can be placed in the execution device 310, or the data storage system 340 can be an external memory relative to the execution device 310.
[0065] The calculation module 311 can process data through the target model / rule 301 to obtain a prediction label. Specifically, the calculation module 311 can process the sample to be processed through the target model / rule 301 to output the target prediction result through the target model / rule 301. The sample to be processed includes identification information of at least one target object, and the target prediction result is used to indicate whether each of the target objects will be subjected to an interactive operation. Since the discriminator and the generator are subjected to adversarial training in the training phase, that is, the update goal of the generator is that the generated target prediction result can deceive the discriminator so as to be identified as real data, and the update goal of the discriminator is to be able to identify the target prediction result generated by the generator; in the process of this adversarial training, the capabilities of the generator and the discriminator become stronger and stronger. Since the update goal of the generator is that the generated target prediction result can be identified as real data, that is, the update goal of the generator is to mine the user's real click habits, which is conducive to mining the user's inner true intentions through training the generator, and is conducive to improving the accuracy of the prediction results.
[0066] In some embodiments of this application, please refer to Figure 3 The "user" can directly interact with the execution device 310, that is, the execution device 310 can directly display the predicted image output by the target model / rule 301 to the "user". It is worth noting that Figure 3 This is only a schematic diagram of the architecture of the image processing system provided by an embodiment of the present invention, and the positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in other embodiments of the present application, the execution device 310 and the client device can also be separate devices, and the execution device 310 is configured with an input / output (in / out, I / O) interface, and the execution device 310 exchanges data with the client device through the I / O interface.
[0067] 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.
[0068] 1. Training Phase
[0069] In the embodiment of the present application, the training phase describes the process of how the training device 320 generates a trained generator using the training data set in the database 330. For details, please refer to Figure 4 , Figure 4 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:
[0070] 401. The training device obtains a target training sample and a target correct result corresponding to the target training sample.
[0071] In the embodiment of the present application, a target training data set for training a target generative adversarial neural network is pre-stored in the training device, and the target training data set includes multiple training samples and a correct result corresponding to each training sample. The training device can obtain a target training sample and a target correct result corresponding to the target training sample from the target training data set, and the target training sample is any one of the multiple training samples included in the training data set.
[0072] Among them, a training sample may include information of N objects, where the value of N is an integer greater than or equal to 1; the aforementioned objects may be specifically manifested as applications, videos, music, news, product links, advertisements, or other types of objects that may be displayed in the search system, etc. The specific manifestation of an object can be flexibly set in combination with the actual application scenario, and is not limited this time. In the embodiment of the present application, multiple specific manifestations of the target object are provided, which expands the application scenario of the present solution and improves the implementation flexibility of the present solution.
[0073] The information of an object at least includes the identification information of the object, which can be specifically expressed in the form of a string, such as 00000001, GZ000001, ZHg000052, etc. The examples here are only for the convenience of understanding this solution and are not used to limit this solution. The information of an object can also include the type of the object, and the type of the object can refer to the above description.
[0074] The target generative adversarial neural network includes a generator, which is used to generate target prediction results corresponding to N target objects in the target training sample, and the target object refers to the object included in the target training sample. The target prediction result is used to indicate whether each of the N target objects will be interactively operated by the user; correspondingly, the target correct result is used to indicate whether each of the N target objects has been interactively operated by the user.
[0075] Interaction operations include but are not limited to click operations, download operations, purchase operations, play operations, collection operations or other types of interaction operations. As an example, if the target object is specifically an application, the interaction operation can be set to a download operation; as another example, if the target object is specifically a product link, the interaction operation can be set to a purchase operation; as another example, if the target object is specifically news, the interaction operation can be set to a click operation, etc. The specific type of operation set for the interaction operation can be flexibly selected in combination with the actual application scenario, and is not exhaustively listed here.
[0076] Furthermore, a target prediction result may include N prediction labels corresponding one-to-one to N objects, and one prediction label is used to indicate whether a target object will be interactively operated by the user; a target correct result may include N correct labels corresponding one-to-one to N objects, and one correct label is used to indicate whether a target object has been interactively operated by the user.
[0077] Specifically, before obtaining the target training samples, the training device needs to obtain the target training data set. In one case, the server of the search system and the training device are different devices. In this case, the client configured with the search system can collect the interaction behavior between the user and the objects displayed in the search system, and send the interaction behavior to the server of the search system. The server of the search system sends the interaction behavior between the user and the objects displayed in the search system to the training device, so that the training device can obtain the target training data set. In another case, the server of the search system and the training device are the same device. In this case, the training device can directly obtain the interaction behavior between the user and the objects displayed in the search system sent by the client configured with the search system to obtain the target training data set. In another case, the training device can also obtain the target training data set from other devices, which are not exhaustive here.
[0078] Optionally, a target training sample may also include a target query request corresponding to N target objects, that is, when the user inputs the target query request through the search system, the search system feeds back the N target objects to the user.
[0079] To understand this concept more intuitively, as an example, if a user enters a query request through the search system, the search system obtains a document sequence [d1, d2, …, d T], the document sequence may include identification information of each object in the T objects, the value of N may be the same as the value of T, or may be less than the value of T, and T is an integer greater than or equal to 1. The search system displays the T objects to the user, and after the user browses the T objects in sequence, the user clicks on the object of interest in the T objects. The client equipped with the search system may collect the aforementioned user behavior of the user and send it to the server of the search system, so that the training device may obtain target training data according to the user behavior sent by the client equipped with the search system. Specifically, the client equipped with the search system initializes the initial state of the user to the query q; in the process of browsing the T objects, the user will generate a click sequence [c1, c2, …, c T ], each value in the click sequence is used to indicate whether the corresponding object in the document sequence has been clicked. It should be understood that the example here is only for a more intuitive understanding of this solution.
[0080] 402. The training device inputs the target training sample into the generator to output the target prediction result through the generator.
[0081] In an embodiment of the present application, after acquiring the target training sample, the training device can input the target training sample into the generator to output the target prediction result through the generator. Among them, the explanation of the target prediction result can be found in the description in step 401, which is not repeated here. The generator can specifically adopt a recurrent neural network (RNN) or other types of neural networks; further, when the generator adopts a recurrent neural network, the feature extraction network included in the generator can have one or more gated recurrent units (GRU), or the generator can specifically be expressed as a long short-term memory neural network (LSTM), or the generator can also be expressed as other types of recurrent neural networks, etc., which are not exhaustive here.
[0082] Specifically, in one case, if the value of N is greater than or equal to 2, and the target training sample carries a target query request corresponding to N target objects, then step 402 may include: the training device sequentially performs N+1 inference operations through the generator to generate N prediction labels corresponding to the N target objects. As an example, for example, the value of a prediction label can be 0 or 1. When the prediction label value is 0, the prediction label indicates that the user will not perform interactive operations on the target object corresponding to the prediction label. When the prediction label value is 1, the prediction label indicates that the user will perform interactive operations on the target object corresponding to the prediction label. It should be understood that the examples here are only for the convenience of understanding this solution. The prediction label can also take other values, which are not limited here.
[0083] More specifically, after obtaining the target training sample, in order to align the execution process of the generator's training phase with the execution process of the generator's inference phase, in the first step (i.e., when t is equal to 0), the training device can first embed the query request carried in the target training sample through the generator to obtain the initial feature information of the query request. The initial feature information of the query request can also be called the first feature information of the query request. The initial feature information can be specifically expressed as a low-dimensional vector. Then Input into the generator to obtain the hidden state h0. The hidden state generated by the generator can also be called the second feature information, that is, the feature information obtained after feature extraction of the initial feature information again. Represents the splicing operation, v q Represents the initial feature information of the query request, 0 d , 0 v and 0 c are specifically represented as zero vectors, 0 d , 0 v and 0 c The number of values in is fixed.
[0084] In the second step (i.e. when t is equal to 1), the training device embeds the identification information of the N target objects through the generator to obtain the first feature information corresponding to the identification information of the N target objects, and also embeds the object type corresponding to the N target objects to obtain the first feature information corresponding to the object type. Input to the generator to pass it Splice to pass the generator to Feature extraction is performed again to obtain the hidden state h1, and the hidden state h1 is processed by the generator to generate a predicted label corresponding to the first target object among the N target objects (hereinafter referred to as a1 for convenience of description). q and 0c Please refer to the above description, which will not be repeated here. d Represents the first feature information corresponding to the identification information of N target objects, v v represents the first feature information corresponding to the object type corresponding to the N target objects, v d The number of values included in d The number of values included in v is the same. v The number of values included in v The number of values included in is the same.
[0085] In the third step (that is, when t is equal to 2), the training device embeds a1 through the generator to obtain the first feature information of the predicted label corresponding to the first target object. and h1 to pass the generator to Perform feature extraction again to obtain the hidden state h2, and perform feature processing on the hidden state h2 through the generator to generate a predicted label corresponding to the second target object among the N target objects (hereinafter referred to as a2 for convenience of description). q 、v d and v v The meaning of can be found in the above description, v c Represents the first feature information of the predicted label corresponding to the first target object, v c The number of values included in v The number of values included in is the same.
[0086] The training device repeats the operation of step 3 to generate N prediction labels corresponding to the N target objects. That is, the training device needs to use the generator to generate N prediction labels from a1 to a t-1 Embedding is performed to obtain the first feature information of the predicted label corresponding to the first t-1 target objects among the N target objects, and then v q 、v d 、v v It is concatenated with the first feature information of the predicted label corresponding to the first t-1 target objects to obtain x t , through the generator h t-1 With x t Splice and use the generator to splice h t-1 and x t Perform feature extraction to generate the hidden state h t , through the generator to the hidden state h t Perform feature processing to obtain the predicted label corresponding to the tth target object among the N target objects (hereinafter referred to as a for the convenience of description) t). In order to more conveniently understand the execution steps of the generator in the embodiment of the present application, the following example is given in the form of a formula:
[0087]
[0088] h t =GRU(h t-1 ,x t ); (2)
[0089] π θ (a t )=Softmax(Linear(h t )); (3)
[0090] in, v q , 0 d , 0 v , 0 c 、v d 、v v and v c The meaning of can be found in the above description and will not be repeated here. The value of t ranges from 0 to N, which means that the training device can generate N prediction labels corresponding to N target objects after executing N+1 steps (or N+1 inference operations) through the generator. GRU represents the gated recurrent unit included in the feature extraction network in the generator. h t represents the hidden state generated in the current step (also called the second feature information), h t-1 represents the hidden state generated in the previous step, x t The meaning of is described in formula (1), π θ (a t ) represents the predicted label generated by the generator, Softmax(Linear(h t )) represents the feature processing network of the generator for the hidden state h t In the process of feature processing, it should be noted that the examples in formula (1) to formula (3) are only an example for facilitating the understanding of the present solution and are not used to limit the present solution.
[0091] For a more intuitive understanding of the execution process of the generator in the embodiment of the present application, please refer to Figure 5 , Figure 5 A schematic diagram of the workflow of the generator in the embodiment of the present application is shown in FIG. 1 , where A1 represents the target query request carried in the target training sample, such as Figure 5 As shown, in the first step (i.e., t=0), the training device embeds the target query request through the embedding layer (EmbeddingLayer) in the generator to obtain v q , v q, 0 d , 0 v and 0 c For splicing, through the GRU in the generator In the second step (i.e., t=1), the training device also uses the embedding layer in the generator to embed the identification information of the N target objects (i.e., Figure 5 A2 in the embedding process to obtain v d , the type information of the target object (that is, Figure 5 A3 in the embedding process to obtain v v , v q 、v d 、v v and 0 c For splicing, through the GRU in the generator Perform feature extraction to generate h1, and perform feature processing on h1 through the feature processing network of the generator to generate a predicted label corresponding to the first target object (i.e. Figure 5 In the third step (i.e., t=2), the training device also embeds the predicted labels corresponding to the first t-1 target objects through the embedding layer in the generator to obtain v c , v q 、v d 、v v and v c For splicing, through the GRU in the generator Perform feature extraction to generate h2, and perform feature processing on h2 through the feature processing network of the generator to generate a predicted label corresponding to the second target object (i.e. Figure 5 The second A4 from the left). Figure 5 As shown, the training device repeatedly performs the third step to generate N prediction labels corresponding to the N target objects. It should be understood that Figure 5 The examples are only for facilitating the understanding of this solution and are not intended to limit this solution.
[0092] It should be noted that the above description is based on the example that the target training sample carries the object type corresponding to the N target objects. In another case, if the target training sample does not carry the object type corresponding to the N target objects, then the 0 in each of the above steps v and v v That is, in the process of generating N predicted labels corresponding to N target objects, the feature information of the object types corresponding to the N target objects will not be used.
[0093] In the embodiment of the present application, during the current training process of the generator, the generator predicts whether the user will interact with the tth target object based on the actual interaction between the user and the first t-1 target objects. However, in the reasoning stage, the generator predicts whether the user will interact with the tth target object based on the interaction between the user and the first t-1 target objects predicted by the generator. This current single-step prediction method will cause the trained generator to be unable to generate the optimal result. The small error accumulated in each step of the prediction will cause the error of the N prediction labels generated by the generator to become larger and larger. The training stage in this scheme simulates the method of the reasoning stage, that is, in the training stage, the generator needs to process at least two target objects at a time, and the generator also needs to predict whether the user will interact with the tth target object based on the interaction between the user and the first t-1 target objects predicted by the generator, so as to increase the difficulty of the training stage, so that the trained generator can generate more accurate prediction results.
[0094] In another case, if the value of N is 1, and the target training sample carries a target query request corresponding to the target object, step 402 may include: the training device sequentially performs two inference operations through the generator to generate a prediction label corresponding to the target object. The specific implementation of the above steps can refer to the description of the first and second steps in the case of "the value of N is greater than or equal to 2, and the target training sample carries a target query request corresponding to N target objects", which will not be repeated here.
[0095] In another case, if the value of N is greater than or equal to 2, and the target training sample does not carry a target query request corresponding to the 1 target object, then step 402 may include: the training device sequentially performs N inference operations through the generator to generate N prediction labels corresponding to the N target objects. The specific implementation of the above steps can refer to the description of the second step to the N+1 step (that is, the specific implementation of the N steps with the values of t being 1 to N) in the case of "the value of N is greater than or equal to 2, and the target training sample carries a target query request corresponding to the N target objects", which can be referred to for understanding and will not be repeated here; the difference is that, since the target training sample does not carry a target query request in this case, it is necessary to delete the part of the feature information of the target query request in the case of "the value of N is greater than or equal to 2, and the target training sample carries a target query request corresponding to the N target objects", that is, in this case, the feature information of the target query request will not be used in the entire process of generating N prediction labels corresponding to the N target objects.
[0096] In another case, if the value of N is 1, and the target training sample does not carry a target query request corresponding to the target object, step 402 may include: the training device sequentially performs one reasoning operation through the generator to generate one prediction label corresponding to the target object. The specific implementation of the above steps is similar to the description of the second step in the case of "the value of N is greater than or equal to 2, and the target training sample carries a target query request corresponding to N target objects", which can be referred to for understanding and will not be repeated here; the difference is that, since the target training sample in this case does not carry a target query request, it is necessary to delete the feature information of the target query request in the description of the second step of the case of "the value of N is greater than or equal to 2, and the target training sample carries a target query request corresponding to N target objects", that is, in this case, the feature information of the target query request will not be used in the entire process of generating N prediction labels corresponding to N target objects.
[0097] 403. The training device inputs the target training sample, the target prediction result, and the target correct result into the discriminator, so that the discriminator outputs a first probability value and a second probability value.
[0098] In an embodiment of the present application, the target generative adversarial neural network also includes a discriminator. After obtaining the target training samples, target prediction results and target correct results, the training device can input the target training samples, target prediction results and target correct results into the discriminator to output the first probability value and the second probability value through the discriminator.
[0099] Among them, the first probability value is used to indicate the probability that the target correct result is real data, or, the first probability value can also be used to indicate the probability that the target correct result is forged data, or, the first probability value can also be used to indicate the probability that the target correct result is data generated by a generator, etc. The first probability value can also be described from other perspectives, which are not exhaustive here; further, real data refers to data obtained based on the real interaction behavior between the user and the target object, and the concept of forged data is the opposite of the concept of real data.
[0100] The second probability value is used to indicate the probability that the target prediction result is real data, or the second probability value can also be used to indicate the probability that the target prediction result is forged data, or the second probability value can also be used to indicate the probability that the target prediction result is data generated by a generator, etc. The second probability value can also be described from other angles, which are not exhaustive here.
[0101] As an example, the value range of the first probability value and the second probability value can both be 0-1. Here, the first probability value is used as the probability that the target correct result is the real data, and the second probability value is used as the probability that the target predicted result is the real data. The larger the value of the first probability value, the greater the probability that the target correct result is the real data, and the larger the value of the second probability value, the greater the probability that the target predicted result is the real data.
[0102] The description of the target training sample and the target prediction result can refer to the above description, which will not be repeated here. The specific expression form of the target correct result is similar to that of the target prediction result, except that the target prediction result is the result generated by the generator, and the target correct result is obtained based on the actual interaction between the user and the target object. Similar to the generator, the discriminator can also specifically adopt a recurrent neural network or other types of neural networks. The specific structure of the discriminator is not repeated here. In the embodiment of the present application, a specific implementation method of the generator and the discriminator is provided, and when the target training sample includes at least two target objects, the generator and the discriminator process sequence data. The use of a recurrent neural network is conducive to digging out the relationship between different target objects, and is conducive to improving the accuracy of the results output by the generator and the discriminator. Since the generator and the discriminator adopt an adversarial training method, the accuracy of the discriminator output result is improved, which is conducive to further improving the accuracy of the prediction results output by the trained generator.
[0103] In the embodiment of the present application, the training device generates N first probability values corresponding to the N prediction labels included in the target correct result through the discriminator, and generates N second probability values corresponding to the N correct labels included in the target prediction result through the discriminator. That is, if the value of N is 1, then one first probability value and one second probability value can be obtained through step 403, and if the value of N is greater than or equal to 2, then multiple first probability values and multiple second probability values can be obtained through step 403.
[0104] Specifically, the process of generating N first probability values is similar to step 402. In one case, the target training sample carries a target query request corresponding to N target objects. After the training device obtains the target training sample, step 403 may include: the training device performs N+1 inference operations in sequence through the discriminator to generate N first probability values corresponding one by one to the N correct labels included in the target correct result.
[0105] More specifically, in the first step (i.e., when t is equal to 0), the training device can first embed the query request carried in the target training sample through the discriminator to obtain the third feature information of the query request. The third feature information of the query request is the initial feature information of the query request generated by the discriminator. The third feature information can be specifically expressed as a low-dimensional vector. Input to the discriminator, so as to extract features again through the discriminator to obtain the hidden state h0′. The hidden state generated by the discriminator can also be called the fourth feature information, that is, the feature information obtained after the initial feature information is extracted again. Represents the splicing operation, v q Represents the third characteristic information of the query request, 0 d , 0 v and 0 s are specifically represented as zero vectors, 0 d , 0 v and 0 s The number of values in is fixed.
[0106] In the second step (i.e. when t is equal to 1), the training device embeds the identification information of the N target objects through the discriminator to obtain the third feature information corresponding to the identification information of the N target objects, embeds the object type corresponding to the N target objects to obtain the third feature information corresponding to the object type, embeds s1 (i.e. the correct label corresponding to the first target object) to obtain the third feature information of the correct label corresponding to the first target object, and then and h0′ to be concatenated to pass the discriminator Perform feature extraction again to obtain the hidden state h1′, and perform feature processing on the hidden state h1′ through the discriminator to generate the first probability value corresponding to the first correct label included in the target correct result. q and v d The meaning of can be found in the above description, v s Represents the third feature information corresponding to the correct label of the first target object, v c The number of values included in s The number of values included in is the same.
[0107] If the value of N is 1, the target correct result includes only one correct label, and the training device generates a first probability value corresponding to the one correct label through the first and second steps mentioned above.
[0108] If the value of N is greater than or equal to 2, the training device needs to repeat the second step to generate N first probability values corresponding to the N correct labels included in the target training sample. That is, the training device needs to use the discriminator to train the N first probability values of s1 to s2. t-1 Embedding is performed to obtain the third feature information of the correct labels corresponding to the first t-1 target objects among the N target objects (that is, the first t-1 correct labels in the target correct result), and then the discriminator transforms v q 、v d 、v v Concatenate the first feature information of the predicted label corresponding to the first t-1 target objects to obtain x′ t , h is transformed into t-1 ′ and x′ t splicing, and use the discriminator to splice h t-1 ′ and x′ t Perform feature extraction to generate the hidden state h t ′, through the discriminator to the hidden state h t 'Perform feature processing to obtain the first probability value corresponding to the tth correct label included in the target correct result. In order to more conveniently understand the execution steps of the discriminator in the embodiment of the present application, the following example is given in the form of a formula:
[0109]
[0110] h′ t =GRU(h′ t-1 ,x′ t ); (5)
[0111] D w (s t )=Softmax(Linear(h′ t )); (6)
[0112] in, v q , 0 d , 0 v , 0 s 、v d 、v v and v s The meaning of can refer to the above description and will not be repeated here. The value of t ranges from 0 to N, that is, the training device can generate N first probability values corresponding to N correct labels after executing N+1 steps (or N+1 inference operations) through the discriminator. GRU represents the gated recurrent unit included in the feature extraction network in the discriminator. h′ t represents the hidden state generated by the discriminator during the current reasoning process (also known as the fourth feature information), h′t-1 represents the hidden state generated by the discriminator in the previous reasoning process, x′ t The meaning of is as described in formula (1), D w (s t ) represents the first probability value generated by the discriminator, Softmax(Linear(h′ t )) represents the feature processing network of the discriminator for the hidden state h′ t In the process of feature processing, it should be noted that the examples in equations (4) to (6) are only an example for facilitating understanding of the present solution and are not used to limit the present solution.
[0113] It should be noted that the above description is based on the example that the target training sample carries the object type corresponding to the N target objects. In another case, if the target training sample does not carry the object type corresponding to the N target objects, then the 0 in each of the above steps v and v v That is, in the process of generating N first probability values corresponding to the N correct labels included in the target correct result, the feature information of the object type corresponding to the N target objects will not be used.
[0114] In another case, if the target training sample does not carry a target query request corresponding to the N target objects, step 403 may include: the training device performs N inference operations in sequence through the discriminator to generate N first probability values corresponding one-to-one to the N prediction labels included in the target correct result. The specific implementation method of the aforementioned steps can refer to the description of the second to N+1th steps (that is, the specific implementation method of the N steps in which t takes values from 1 to N) in the case of "the target training sample carries a target query request corresponding to the N target objects", which can be referred to for understanding and will not be repeated here; the difference is that, since the target training sample does not carry a target query request in this case, it is necessary to delete the part of the feature information of the target query request in the case of "the target training sample carries a target query request corresponding to the N target objects", that is, in this case, the feature information of the target query request will not be used in the entire process of generating N first probability values corresponding one-to-one to the N correct labels.
[0115] For the generation process of N second probability values, for the generation process of N second probability values, in one case, the target training sample carries a target query request corresponding to N target objects, and step 403 may include: the training device performs N+1 inference operations in sequence through the discriminator to generate N second probability values corresponding one by one to the N prediction labels included in the target prediction results.
[0116] In another case, the target training sample does not carry a target query request corresponding to the N target objects, and step 403 may include: the training device sequentially performs N inference operations through the discriminator to generate N second probability values corresponding to the N prediction labels included in the target prediction result. It should be noted that the specific implementation method of the training device generating N second probability values corresponding to the N prediction labels through the discriminator is similar to the specific implementation method of the training device generating N first probability values corresponding to the N correct labels through the discriminator, except that s1 to s2 in the step of "generating N first probability values" are replaced by s3. t-1 Replace with a1 to a t-1 That is, when the training device generates each first probability value through the discriminator, the input is the correct label corresponding to the first t-1 target objects. When the training device generates each second probability value through the discriminator, the correct label corresponding to the first t-1 target objects needs to be replaced with the predicted label corresponding to the first t-1 target objects. The specific implementation method of the training device generating N second probability values can be found in the above description and will not be repeated here.
[0117] For a more intuitive understanding of the execution process of the generator in the embodiment of the present application, please refer to Figure 6 and Figure 7 , see first Figure 6 , Figure 6 A schematic diagram of the workflow of the discriminator in the embodiment of the present application is shown in FIG. Figure 5 The description in will not be repeated here. The difference is that Figure 6 In the discriminator, feature extraction is performed, that is, Figure 6 After obtaining A1, A2, A3 and A4, the embedding layer and feature extraction network of the discriminator are used to perform feature extraction operations to obtain N+1 h′ t , and then use the feature processing network in the discriminator to generate N h′ t Since the training device also inputs the target correct result into the discriminator, the training device can also generate N h′ t Generate N+1 and h′ t Both are generated by the feature extraction network of the generator, but the difference is that A4 needs to be replaced by B1 (that is, the correct label corresponding to the first t-1 target objects), and then the feature processing network in the discriminator is used to generate the same label as N The corresponding N first probability values. It should be understood that Figure 6 The examples are only for facilitating the understanding of this solution and are not intended to limit this solution.
[0118] See also Figure 7 , Figure 7 A flowchart of the workflow of the discriminator in the embodiment of the present application. Among them, the training device can obtain multiple groups of target correct results corresponding to multiple target training samples from the training data set of the generator, and after the generator generates multiple groups of target prediction results corresponding to multiple target training samples (that is, after executing step 402 multiple times), the multiple target training samples, the multiple groups of target correct results and the multiple groups of target prediction results are input into the discriminator, so as to execute step 403 through the discriminator. It should be understood that Figure 7 The examples are only for facilitating the understanding of this solution and are not intended to limit this solution.
[0119] It should be noted that the training device may execute step 403 multiple times after executing step 402 multiple times.
[0120] 404. The training device performs adversarial training on the discriminator and the generator according to the first probability value and the second probability value until a preset condition is met to obtain a trained generator.
[0121] In an embodiment of the present application, the training device will perform adversarial training on the discriminator and the generator according to the first probability value and the second probability value until the preset conditions are met, and the trained discriminator and the trained generator are obtained, and the trained generator will be configured on the execution device. Among them, adversarial training refers to the generator generating a target prediction result to deceive the discriminator, and then the discriminator determines which of the target prediction result and the target correct result is based on real data generated by real user interaction behavior. In the process of training the generator and the discriminator, the capabilities of the generator and the discriminator are made stronger and stronger, and finally a steady state is reached. The preset condition can be that the number of training times of the generator and the discriminator reaches a preset number, or the prediction condition can be when the generator and the discriminator reach a steady state.
[0122] Specifically, step 404 may include: the training device generates a first gradient value corresponding to the discriminator according to the first probability value and the second probability value, and updates the parameters of the discriminator according to the first gradient value, and the update target of the discriminator includes increasing the value of the first probability value and decreasing the value of the second probability value; the training device generates a second gradient value corresponding to the generator according to the second probability value, and updates the parameters of the generator according to the second gradient value, and the update target of the generator includes increasing the value of the second probability value. As an example, for example, the values of the first probability value and the second probability value are both probability values between 0 and 1, and the update target of the discriminator training is to make the first probability value as close to 1 as possible and the second probability value as close to 0 as possible, but the update target of the generator training is to make the second probability value output by the discriminator as close to 1 as possible.
[0123] More specifically, for the update process of the parameters of the discriminator, regardless of whether the value of N is 1 or the value of N is greater than or equal to 2, the training device can calculate the function value of the first loss function based on the N first probability values and the N second probability values, and directly reversely derive the parameters of the discriminator based on the function value of the first loss function to generate a first gradient value corresponding to the discriminator, and update the parameters of the discriminator based on the first gradient value. Among them, the update target of the first loss function includes increasing the value of the first probability value and reducing the value of the second probability value. In order to understand this solution more intuitively, an example of a generation formula for the first gradient value is disclosed as follows:
[0124]
[0125] Among them, D w (a t ) represents the second probability value corresponding to the tth prediction label included in the target prediction result, Represents logD w (a t ) to find the derivative, represents the operation of finding the average, represents N predicted labels, represents N correct labels, D w (s t ) represents the first probability value corresponding to the tth correct label included in the target correct result, represents log(1-D w (s t )) is derived. It should be understood that the example in formula (7) is only for the convenience of understanding this scheme and is not used to limit this scheme.
[0126] Regarding the updating process of the parameters of the generator, if the value of N is 1, the training device can directly generate the function value of the second loss function based on a second probability value, and directly reversely derive the parameters of the generator based on the function value of the second loss function to generate a second gradient value corresponding to the discriminator, and update the parameters of the generator based on the second gradient value. The updating goal of the second loss function is to increase the value of the second probability value. In order to understand this solution more intuitively, an example of the first loss function and the second loss function when the value of N is 1 is disclosed as follows:
[0127]
[0128] The meanings of some letters in formula (8) can be directly referred to the description in formula (7), and will not be repeated here. The update target representing the first loss function includes increasing the value of the first probability value and decreasing the value of the second probability value. The update target of the second loss function is to improve the value of the second probability value. It should be understood that the example in formula (8) is only for the convenience of understanding this solution and is not used to limit this solution.
[0129] If the value of N is greater than or equal to 2, the training device averages the N second probability values to generate an average value, generates a second gradient value corresponding to the generator based on the N predicted labels generated by the generator and the average value, and updates the parameters of the generator based on the second gradient value. In order to understand this solution more intuitively, an example of a formula for generating the second gradient value is disclosed as follows:
[0130]
[0131] The meanings of the letters in formula (9) can be directly referred to the above description and will not be elaborated here. It should be understood that the examples in formula (9) are only for the convenience of understanding the present solution and are not used to limit the present solution.
[0132] In the embodiment of the present application, a specific implementation method for one-time training of a target generative adversarial neural network is provided, which improves the feasibility of the present solution.
[0133] In an embodiment of the present application, after the generator is used to generate a target prediction result corresponding to the target training sample, the target training sample, the target prediction result and the target correct result are also input into the discriminator to output a first probability value and a second probability value through the discriminator. The discriminator and the generator belong to the same target generation adversarial neural network, and the first probability value is used to indicate the probability that the target correct result is real data, and the second probability value is used to indicate the probability that the target prediction result is real data. Then, according to the first probability value and the second probability value, the discriminator and the generator are adversarially trained, that is, the update goal of the generator is that the generated target prediction result can deceive the discriminator to be identified as real data, and the update goal of the discriminator is to be able to identify the target prediction result generated by the generator; in the process of this adversarial training, the capabilities of the generator and the discriminator become stronger and stronger, because the update goal of the generator is that the generated target prediction result can be identified as real data, that is, the update goal of the generator is to mine the user's real clicking habits, which is conducive to mining the user's inner true intentions through training the generator, and is conducive to improving the accuracy of the prediction results.
[0134] 2. Reasoning Stage
[0135] In the embodiment of the present application, the inference stage describes how the execution device 310 uses the target model / rule 301 to process data to generate a predicted label. For details, please refer to Figure 8 , Figure 8 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:
[0136] 801. An execution device obtains a sample to be processed, where the sample to be processed includes identification information of at least one target object.
[0137] In the embodiment of the present application, the execution device needs to obtain a sample to be processed. A sample to be processed includes identification information of at least one target object. The concept of the sample to be processed is the same as Figure 4 The concept of target training samples in the corresponding embodiments is similar, the only difference is that the target training samples are the concepts used in the training phase of the generator, and the to-be-processed samples are the concepts used in the inference phase of the trained generator. For an understanding of the to-be-processed samples, please refer to Figure 4 The description of the target training samples in is not repeated here.
[0138] 802. The execution device inputs the sample to be processed into the trained generator to output a target prediction result through the trained generator, where the target prediction result is used to indicate whether an interactive operation will be performed on each target object.
[0139] In the embodiment of the present application, the specific implementation steps of step 802 can be referred to Figure 4 The description of step 402 in the corresponding embodiment is not repeated here. Among them, the generator is obtained after training the target generative adversarial neural network, and the target generative adversarial neural network includes a generator and a discriminator. In the training stage, the generator is used to generate a prediction result corresponding to the target training sample based on the target training sample, and the discriminator is used to generate a first probability value and a second probability value based on the target training sample, the prediction result corresponding to the target training sample and the correct result corresponding to the target training sample. The first probability value is used to indicate the probability that the correct result corresponding to the target training sample is the real data, and the second probability value is used to indicate the probability that the prediction result corresponding to the target training sample is the real data. The correct result corresponding to the target training sample comes from the training data set of the target generative adversarial neural network. Furthermore, the meaning of the target prediction result and the training process of the generator can be referred to. Figure 4 The description in the corresponding embodiment is not repeated here.
[0140] In the embodiment of the present application, since the generator used in the inference stage is obtained after training the target generative adversarial neural network, the discriminator is used to generate a first probability value and a second probability value, the first probability value is used to indicate the probability that the prediction result generated by the generator is real data, and the second probability value is used to indicate the probability that the target prediction result is real data, that is, the update goal of the generator is that the generated target prediction result can deceive the discriminator so as to be identified as real data, and the update goal of the discriminator is to be able to identify the target prediction result generated by the generator; in the process of this adversarial training, the capabilities of the generator and the discriminator become stronger and stronger, because the update goal of the generator is that the generated target prediction result can be identified as real data, that is, the update goal of the generator is to mine the user's real clicking habits, so that the trained generator can realize the mining of the user's inner true intentions, which is conducive to improving the accuracy of the prediction results of the trained generator.
[0141] In order to more directly understand the beneficial effects brought by the embodiments of the present application, the following is explained in combination with actual experimental data. Here, an experiment on the TianGong-ST dataset is taken as an example. The generator is used to predict whether the user will perform a click operation on the target object. The experimental results are shown in Table 1 below:
[0142] Table 1
[0143] LL PPL NCM -0.1433 1.1855 CACM -0.1426 1.1832 Embodiments of the present application -0.1385 1.1747
[0144] Among them, LL is the full name of Log-likelihood, which is used to measure the similarity between the predicted result and the true result. The larger the value of the LL indicator, the higher the similarity between the predicted result and the correct result. PPL is the full name of Perplexity. The smaller the value of the PPL indicator, the higher the accuracy of the obtained prediction result. NCM and CACM represent two existing neural networks. It can be seen from the data shown in Table 1 that the similarity between the predicted result and the correct result obtained by the method provided in the embodiment of the present application is higher, and the accuracy is higher.
[0145] exist Figures 1 to 8 On the basis of the corresponding embodiments, in order to better implement the above solutions of the embodiments of the present application, the following also provides related devices for implementing the above solutions. Fig. 9 , Fig. 9A structural schematic diagram of a neural network training device provided in an embodiment of the present application, the neural network training device 900 may include: an acquisition module 901, used to acquire a target training sample and a target correct result corresponding to the target training sample, the target training sample includes identification information of at least one target object, and the target correct result is used to indicate whether each target object in the at least one target object has been subjected to an interactive operation; a generation module 902, used to input the target training sample into a generator, so as to output a target prediction result through the generator, and the target prediction result is used to indicate whether each target object will be subjected to an interactive operation; a discriminant module 903, used to input the target training sample, the target prediction result and the target correct result into a discriminator, so as to output a first probability value and a second probability value through the discriminator, the discriminator and the generator belong to the same target generation adversarial neural network, the first probability value is used to indicate the probability that the target correct result is true data, and the second probability value is used to indicate the probability that the target prediction result is true data; a training module 904, used to perform adversarial training on the discriminator and the generator according to the first probability value and the second probability value until a preset condition is met to obtain a trained generator.
[0146] In one possible design, the training module 904 is specifically used to: generate a first gradient value corresponding to the discriminator according to the first probability value and the second probability value, and update the parameters of the discriminator according to the first gradient value, and the update target of the discriminator includes increasing the value of the first probability value and decreasing the value of the second probability value; generate a second gradient value corresponding to the generator according to the second probability value, and update the parameters of the generator according to the second gradient value, and the update target of the generator includes increasing the value of the second probability value.
[0147] In one possible design, the number of target objects included in the target training sample is N, where N is an integer greater than or equal to 9, the target correct result includes N correct labels corresponding to the N target objects, and the target prediction result includes N predicted labels corresponding to the N target objects; the generation module 902 is specifically used to perform multiple inference operations through a generator to generate N predicted labels.
[0148] In one possible design, the target object is an application, video, music, news, product link, or advertisement.
[0149] In one possible design, both the generator and the discriminator are recurrent neural networks.
[0150] It should be noted that the information interaction, execution process, etc. between the modules / units in the neural network training device 900 are the same as those in the present application. Figures 4 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.
[0151] The present application also provides a data processing device. Fig.10 , Fig.10 A structural schematic diagram of a data processing device provided in an embodiment of the present application, the data processing device 1000 includes: an acquisition module 1001, used to acquire a sample to be processed, the sample to be processed includes identification information of at least one target object; a generation module 1002, used to input the sample to be processed into a trained generator to output a target prediction result through the trained generator, and the target prediction result is used to indicate whether each target object will be subjected to an interactive operation; wherein the generator is obtained after training a target generative adversarial neural network, and the target generative adversarial neural network includes a generator and a discriminator. In the training stage, the generator is used to generate a prediction result corresponding to the target training sample according to the target training sample, and the discriminator is used to generate a first probability value and a second probability value according to the target training sample, the prediction result corresponding to the target training sample, and the correct result corresponding to the target training sample, the first probability value is used to indicate the probability that the correct result corresponding to the target training sample is true data, and the second probability value is used to indicate the probability that the prediction result corresponding to the target training sample is true data, and the correct result corresponding to the target training sample comes from the training data set of the target generative adversarial neural network.
[0152] In one possible design, the target object is an application, video, music, news, product link, or advertisement.
[0153] It should be noted that the information interaction, execution process, etc. between the modules / units in the data processing device 1000 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.
[0154] Next, an execution device provided by an embodiment of the present application is introduced. Fig.11 , Fig.11 A schematic diagram of a structure of an execution device provided in an embodiment of the present application, wherein the execution device 1100 may be deployed with Fig.10 The data processing device 1000 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 1100 includes: a receiver 1101, a transmitter 1102, a processor 1103 and a memory 1104 (wherein the number of the processor 1103 in the execution device 1100 can be one or more, Fig.11In the example of FIG. 1 , the processor 1103 may include an application processor 11031 and a communication processor 11032. In some embodiments of the present application, the receiver 1101, the transmitter 1102, the processor 1103 and the memory 1104 may be connected via a bus or other means.
[0155] The memory 1104 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1103. A portion of the memory 1104 may also include a non-volatile random access memory (NVRAM). The memory 1104 stores processor and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0156] The processor 1103 controls the operation of the execution device. In a specific application, the various components of the execution device are coupled together through a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are referred to as bus systems in the figure.
[0157] The method disclosed in the above embodiment of the present application can be applied to the processor 1103, or implemented by the processor 1103. The processor 1103 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1103. The above processor 1103 can be a general processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 1103 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be combined and executed. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1104, and the processor 1103 reads the information in the memory 1104 and completes the steps of the above method in combination with its hardware.
[0158] The receiver 1101 can be used to receive input digital or character information and generate signal input related to the relevant settings and function control of the execution device. The transmitter 1102 can be used to output digital or character information through the first interface; the transmitter 1102 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1102 can also include a display device such as a display screen.
[0159] In the embodiment of the present application, the processor 1103 is used to execute Figure 8 The data processing method executed by the execution device in the corresponding embodiment. It should be noted that the specific manner in which the application processor 11031 in the processor 1103 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.
[0160] The present application also provides a training device. Fig.12 , Fig.12 is a structural diagram of a training device provided in an embodiment of the present application. The training device 1200 may be deployed with Fig. 9 The neural network training device 900 described in the corresponding embodiment is used to implement Figures 4 to 7 The functions of the training device in the corresponding embodiment, specifically, the training device 1200 is implemented by one or more servers, and the training device 1200 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1222 (for example, one or more processors) and memory 1232, one or more storage media 1230 (for example, one or more mass storage devices) storing application programs 1242 or data 1244. Among them, the memory 1232 and the storage medium 1230 can be short-term storage or permanent storage. The program stored in the storage medium 1230 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the training device. Furthermore, the central processing unit 1222 can be configured to communicate with the storage medium 1230 to execute a series of instruction operations in the storage medium 1230 on the training device 1200.
[0161] The training device 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1258, and / or, one or more operating systems 1241, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0162] In the embodiment of the present application, the central processor 1222 is used to execute Figures 4 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 processor 1222 executes the above steps is the same as that in the present application. Figures 4 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 4 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.
[0163] The present application also provides a computer program product which, when executed on a computer, enables the computer to execute the above Figure 8 The method described in the embodiment shown in the figure executes the steps executed by the device, or causes the computer to execute the above-mentioned Figures 4 to 7 The illustrated embodiment describes the steps performed by the training device in the method.
[0164] 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 method described in the embodiment shown in the figure executes the steps executed by the device, or causes the computer to execute the above-mentioned Figures 4 to 7 The illustrated embodiment describes the steps performed by the training device in the method.
[0165] The data processing device, neural network training device, execution device and training device provided in the embodiments of the present application may be specifically a chip, and the chip includes: a processing unit and a communication unit, the processing unit may be, for example, a processor, and the communication unit may be, for example, an input / output interface, a pin or a circuit. The processing unit may execute the computer execution instructions stored in the storage unit so that the chip executes the above Figure 8 The data processing method described in the embodiment shown in the figure, or, to enable the chip to execute the above Figures 4 to 7 The training method of the neural network described in the illustrated embodiment. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc. The storage unit may also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0166] For details, please refer to Fig.13 , Fig.13 A schematic diagram of the structure of a chip provided in an embodiment of the present application, the chip can be expressed as a neural network processor NPU 130, NPU 130 is mounted on the host CPU (Host CPU) as a coprocessor, and the host CPU assigns tasks. The core part of the NPU is the operation circuit 1303, which is controlled by the controller 1304 to extract matrix data from the memory and perform multiplication operations.
[0167] In some implementations, the operation circuit 1303 includes multiple processing units (Process Engine, PE) inside. In some implementations, the operation circuit 1303 is a two-dimensional systolic array. The operation circuit 1303 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the operation circuit 1303 is a general-purpose matrix processor.
[0168] For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit takes the corresponding data of matrix B from the weight memory 1302 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory 1301 and performs matrix operation with matrix B, and the partial result or final result of the matrix is stored in the accumulator 1308.
[0169] The unified memory 1306 is used to store input data and output data. The weight data is directly transferred to the weight memory 1302 through the direct memory access controller (DMAC) 1305. The input data is also transferred to the unified memory 1306 through the DMAC.
[0170] BIU stands for Bus Interface Unit, i.e., bus interface unit 1310 , which is used for interaction between AXI bus, DMAC and instruction fetch buffer (IFB) 1309 .
[0171] The bus interface unit 1310 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 1309 to obtain instructions from the external memory, and is also used for the storage unit access controller 1305 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0172] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1306 or to transfer weight data to the weight memory 1302 or to transfer input data to the input memory 1301.
[0173] The vector calculation unit 1307 includes multiple operation processing units, which further process the output of the operation circuit when necessary, 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, upsampling of feature planes, etc.
[0174] In some implementations, the vector calculation unit 1307 can store the processed output vector to the unified memory 1306. For example, the vector calculation unit 1307 can apply a linear function and / or a nonlinear function to the output of the operation circuit 1303, such as linear interpolation of the feature plane extracted by the convolution layer, and then, for example, a vector of accumulated values to generate an activation value. In some implementations, the vector calculation unit 1307 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 1303, for example, for use in a subsequent layer in a neural network.
[0175] An instruction fetch buffer 1309 connected to the controller 1304 is used to store instructions used by the controller 1304;
[0176] Unified memory 1306, input memory 1301, weight memory 1302 and instruction fetch memory 1309 are all on-chip memories. External memories are private to the NPU hardware architecture.
[0177] in, Figures 4 to 8 The operations of each layer in the generator and discriminator shown can be performed by the operation circuit 1303 or the vector calculation unit 1307.
[0178] The processor mentioned in any of the above places may 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.
[0179] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, 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 over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0180] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an 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 floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0181] 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.
[0182] 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may 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 may be transmitted from a website site, 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 site, computer, training device, or data center. The computer-readable storage medium may 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 may 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)), etc.
Claims
1. A neural network training method, characterized in that: The method comprises: Acquire a target training sample and a target correct result corresponding to the target training sample, wherein the target training sample includes identification information of at least one target object, and the target correct result is used to indicate whether an interactive operation has been performed on each of the at least one target object, wherein the target object is an application, video, music, news, product link or advertisement; Inputting the target training sample into a generator, so as to output a target prediction result through the generator, wherein the target prediction result is used to indicate whether an interactive operation will be performed on each target object; Inputting the target training sample, the target prediction result and the target correct result into a discriminator, so as to output a first probability value and a second probability value through the discriminator, wherein the discriminator and the generator belong to the same target generative adversarial neural network, the first probability value is used to indicate the probability that the target correct result is true data, and the second probability value is used to indicate the probability that the target prediction result is true data; According to the first probability value and the second probability value, adversarial training is performed on the discriminator and the generator until a preset condition is met to obtain a trained generator.
2. The method according to claim 1, characterized in that The step of performing adversarial training on the discriminator and the generator according to the first probability value and the second probability value includes: Generate a first gradient value corresponding to the discriminator according to the first probability value and the second probability value, and update the parameters of the discriminator according to the first gradient value, wherein the update target of the discriminator includes increasing the value of the first probability value and decreasing the value of the second probability value; According to the second probability value, a second gradient value corresponding to the generator is generated, and the parameters of the generator are updated according to the second gradient value. The update target of the generator includes improving the value of the second probability value.
3. The method according to claim 1 or 2, characterized in that: The number of target objects included in the target training sample is N, where N is an integer greater than or equal to 2, the target correct result includes N correct labels corresponding to the N target objects, and the target prediction result includes N predicted labels corresponding to the N target objects; Outputting the target prediction result through the generator includes: generating the N prediction labels through the generator.
4. The method according to claim 1 or 2, characterized in that: The generator and the discriminator are both recurrent neural networks.
5. A data processing method, characterized in that: The method comprises: Acquire a sample to be processed, wherein the sample to be processed includes identification information of at least one target object, wherein the target object is an application, video, music, news, product link or advertisement; Inputting the sample to be processed into a trained generator, so that the trained generator outputs a target prediction result, wherein the target prediction result is used to indicate whether an interactive operation will be performed on each target object; Among them, the generator is obtained after training the target generative adversarial neural network, and the target generative adversarial neural network includes the generator and the discriminator. In the training stage, the generator is used to generate a prediction result corresponding to the target training sample based on the target training sample, and the discriminator is used to generate a first probability value and a second probability value based on the target training sample, the prediction result corresponding to the target training sample and the correct result corresponding to the target training sample. The first probability value is used to indicate the probability that the correct result corresponding to the target training sample is the true data, and the second probability value is used to indicate the probability that the prediction result corresponding to the target training sample is the true data. The correct result corresponding to the target training sample comes from the training data set of the target generative adversarial neural network.
6. A neural network training device, characterized in that: The device comprises: an acquisition module, configured to acquire a target training sample and a target correct result corresponding to the target training sample, wherein the target training sample includes identification information of at least one target object, and the target correct result is used to indicate whether an interactive operation has been performed on each of the at least one target object, wherein the target object is an application, video, music, news, product link or advertisement; A generating module, used for inputting the target training sample into a generator, so as to output a target prediction result through the generator, wherein the target prediction result is used for indicating whether an interactive operation will be performed on each target object; A discriminant module, configured to input the target training sample, the target prediction result and the target correct result into a discriminator, so as to output a first probability value and a second probability value through the discriminator, wherein the discriminator and the generator belong to the same target generative adversarial neural network, the first probability value is used to indicate the probability that the target correct result is true data, and the second probability value is used to indicate the probability that the target prediction result is true data; A training module is used to perform adversarial training on the discriminator and the generator according to the first probability value and the second probability value until a preset condition is met to obtain a trained generator.
7. The device according to claim 6, characterized in that The training module is specifically used for: Generate a first gradient value corresponding to the discriminator according to the first probability value and the second probability value, and update the parameters of the discriminator according to the first gradient value, wherein the update target of the discriminator includes increasing the value of the first probability value and decreasing the value of the second probability value; According to the second probability value, a second gradient value corresponding to the generator is generated, and the parameters of the generator are updated according to the second gradient value. The update target of the generator includes improving the value of the second probability value.
8. The device according to claim 6 or 7, characterized in that The number of target objects included in the target training sample is N, where N is an integer greater than or equal to 2, the target correct result includes N correct labels corresponding to the N target objects, and the target prediction result includes N predicted labels corresponding to the N target objects; The generation module is specifically used to generate the N prediction labels through the generator.
9. The device according to claim 6 or 7, characterized in that The generator and the discriminator are both recurrent neural networks.
10. A data processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a sample to be processed, wherein the sample to be processed includes identification information of at least one target object, wherein the target object is an application, video, music, news, product link or advertisement; A generating module, used for inputting the sample to be processed into a trained generator, so as to output a target prediction result through the trained generator, wherein the target prediction result is used for indicating whether an interactive operation will be performed on each target object; Among them, the generator is obtained after training the target generative adversarial neural network, and the target generative adversarial neural network includes the generator and the discriminator. In the training stage, the generator is used to generate a prediction result corresponding to the target training sample based on the target training sample, and the discriminator is used to generate a first probability value and a second probability value based on the target training sample, the prediction result corresponding to the target training sample and the correct result corresponding to the target training sample. The first probability value is used to indicate the probability that the correct result corresponding to the target training sample is the true data, and the second probability value is used to indicate the probability that the prediction result corresponding to the target training sample is the true data. The target correct result comes from the training data set of the target generative adversarial neural network.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 4, or the method according to claim 5.
12. A computer-readable storage medium, characterized in that: The method comprises a program, which, when being executed on a computer, enables the computer to execute the method according to any one of claims 1 to 4, or enables the computer to execute the method according to claim 5.
13. 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 used to execute the program in the memory so that the execution device executes the method according to claim 5.
14. 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 used to execute the program in the memory so that the training device performs the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Text-based event detection method and device, computer equipment and storage medium
CN110188172A
Method and device for generating adversarial sample by utilizing adversarial generative network
CN111241291A