A neural network processing method and related equipment
By receiving customized information from a server and using a recurrent neural network to select a neural network that meets the specified criteria from multiple neural networks, the problem of neural network customization in existing technologies has been solved, and efficient customized neural network generation and application have been achieved.
Patent Information
- Application Number
- CN201910665261.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2039-07-22
Smart Images

Figure CN112257840B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a neural network processing method and related equipment. Background Art
[0002] Artificial Intelligence (AI) is the theory, method, technology and application system that simulates, extends and expands human intelligence through digital computers or machines controlled by digital computers, perceives the environment, acquires knowledge and uses 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. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, basic AI theory, etc.
[0003] On the technical level, intelligent machines use neural networks to achieve functions in the fields of natural language processing, computer vision, decision-making and reasoning, or human-computer interaction. Specifically, different types of neural networks are needed to achieve different functions in different fields.
[0004] With the continuous development of artificial intelligence technology, more and more intelligent functions need to be realized with the help of neural networks. Therefore, a customized solution for neural networks is urgently needed. Summary of the invention
[0005] The embodiments of the present application provide a neural network processing method and related equipment, which are used to send N second neural networks to the client according to the functional indicators and performance indicators of the neural network sent by the client, and each second neural network simultaneously meets the requirements of the aforementioned functional indicators and performance indicators to achieve customization of the neural network.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a neural network processing method, which can be used in the field of neural network customization in the field of artificial intelligence. A server receives customization information sent by a client, and the customization information includes functional indicators of the neural network and performance indicators of the neural network. The functional indicators are used for the server to determine the general capabilities of the neural network. Optionally, the general capabilities include one or more combinations of text translation, text analysis, speech recognition, image recognition, image classification, image style transfer, or image super-resolution reconstruction. The performance indicators include any one or a combination of multiple indicators including the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second. Then, the functional indicators and performance indicators of the neural network can be used as targets to select N second neural networks from multiple first neural networks. Through the network, wherein N is a positive integer, multiple first neural networks are generated by the server according to functional indicators and performance indicators, the function of each first neural network meets the requirements of the functional indicators, but does not necessarily meet the requirements of the performance indicators, and the performance of each second neural network meets the requirements of the performance indicators. Specifically, in one case, the server can perform a second neural network selection operation once each time it generates a third neural network, and the third neural network is a neural network among the multiple first neural networks. In another case, the server can perform an operation of selecting N second neural networks from the multiple first neural networks after generating multiple first neural networks; the server sends the N second neural networks to the client, wherein each second neural network can be a convolutional neural network, a recurrent neural network, an artificial neural network, or a generative adversarial neural network.
[0008] In this implementation, the server receives customized information sent by the client, and the customized information includes functional indicators and performance indicators of the neural network to be generated. The server can determine the type of the neural network to be generated according to the functional indicators of the neural network, that is, it can generate multiple first neural networks that meet the functional indicators, and then select N second neural networks from the multiple first neural networks according to the performance indicators of the neural network, and each second neural network is a neural network that meets the performance indicators, thereby providing a customized solution for neural networks; in addition, with the continuous development of artificial intelligence, the forms of neural network operating devices are increasing. The performance indicators in this case include any one or more combinations of indicators including the number of neurons, the accuracy of the neural network, the size of the memory occupied by the neural network, or the processing time of the neural network. Therefore, the client can determine which of the above indicators the performance indicators are according to the specific form of the neural network operating device, which is conducive to expanding the application scenarios of this solution.
[0009] In a possible implementation of the first aspect, the customization information also includes an indicator of the number of neural networks, the indicator of the number is N, and the server selects N second neural networks from multiple first neural networks with the performance indicator of the neural network as a target, which may include: the server selects the final Pareto front from multiple first neural networks with the performance indicator of the neural network as a target, and the final Pareto front includes M second neural networks, each second neural network is the neural network with the best performance among the multiple first neural networks, where M is a positive integer, and M is greater than or equal to N; the server selects N second neural networks from the M second neural networks. In this implementation, users can not only customize the functions and performance of the neural network, but also customize the number of neural networks they want, which further improves the customization accuracy of the neural network and is conducive to enhancing customer stickiness.
[0010] In a possible implementation of the first aspect, the method may further include: the server uses the first recurrent neural network to generate a third neural network based on multiple first neural units. Specifically, the server may use the first recurrent neural network to sample multiple second neural units from multiple first neural units to form the third neural network, and then generate the third neural network, wherein the third neural network is a neural network among the multiple first neural networks, and the third neural network includes at least one second neural unit, and the at least one second neural unit is included in the multiple first neural units; the server selects the final Pareto front from the multiple first neural networks with the performance index of the neural network as a target, including: the server generates performance information of the third neural network, and the performance information of the third neural network is consistent with the type of information included in the performance index of the neural network; the server updates the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front; the server generates a feedback value based on the performance information of the third neural network and the feedback function; the server updates the parameters of the first recurrent neural network based on the feedback value gradient, specifically, if the feedback value is a positive number, the gradient value is a positive value, if the feedback value is a negative number, the gradient value is a negative value, and if the feedback value is zero, the gradient value is zero. In this implementation, the parameters of the first recurrent neural network are updated through a feedback function, that is, the sampling rule of the first recurrent neural network is controlled through a feedback function, thereby avoiding random sampling of the first recurrent neural network and facilitating shortening the time of the Pareto frontier.
[0011] In a possible implementation of the first aspect, before the server generates the third neural network according to the multiple first neural units, the method may further include: the server obtains the fourth neural network, the fourth neural network includes the multiple first neural units; the server performs initial iterative training on the fourth neural network, specifically, the server can use the first recurrent neural network to sample and generate a sub-neural network from the multiple first neural units included in the fourth neural network, initialize the parameters of the sub-neural network, and perform initial iterative training on the sub-neural network to obtain the parameters of the sub-neural network that has been subjected to initial iterative training, wherein the parameters of the sub-neural network that has been subjected to initial iterative training are used to initialize the parameters of the third neural network; the server generates the third neural network according to the multiple first neural units, including: the server generates the third neural network according to the multiple first neural units in the fourth neural network that has been subjected to initial iterative training, and initializes the parameters of the third neural network according to the parameters of the sub-neural network. In this implementation, the fourth neural network is firstly subjected to initial iterative training, and then the fourth neural network that has been subjected to initial iterative training is used to initialize the third neural network, which greatly shortens the training time of each third neural network, thereby improving the efficiency of the neural network customization process in this solution.
[0012] In a possible implementation of the first aspect, the fourth neural network includes multiple neuron layers, each neuron layer includes L first neural units, where L is a positive integer, and the first recurrent neural network is used to generate a third neural network based on the multiple first neural units, including: (1) the server outputs L numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the L first neural units; (2) the server converts the L numerical values into L probability values through a normalized exponential function, and the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; (3) the server selects a second neural unit from the L first neural units based on the L probability values to implement the function of a neuron layer in the third neural network; the server can repeatedly execute (1), (2) and (3) until a second neural unit is selected from all the neuron layers of the H neuron layers of the fourth neural network to generate the third neural network. In this implementation, a specific implementation process for generating the third neural network is provided, which improves the feasibility of this solution; in addition, since the larger the temperature parameter T in the normalized exponential function, the probability that the first recurrent neural network samples each of the L first neural units will tend to be average, the more random the third neural network sampled by the server. The larger the temperature parameter T, the more likely the server will generate the third neural network based on the strategy learned by the first recurrent neural network, and T changes according to the law of the cosine function, which can prevent the parameters of the first recurrent neural network from converging to a local optimal value and being unable to jump out, that is, it is ensured that the last N second neural networks are selected from a large number of first neural networks, rather than from a small number of local first neural networks, thereby ensuring the performance of the N second neural networks.
[0013] In a possible implementation of the first aspect, a first performance parameter and a first threshold are pre-set in the feedback function, the first performance parameter is any indicator in the performance indicators except the accuracy of the neural network, and the server generates a feedback value according to the performance information of the third neural network and the feedback function, including: the server generates a feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the feedback value is a positive number, the relationship between the accuracy of the third neural network and the feedback value is a positive correlation, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is a negative correlation, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero or a negative number; after the server generates the feedback value according to the performance information of the third neural network and the feedback function, the method also includes: the server increases the first performance parameter.
[0014] In a possible implementation of the first aspect, the server generates a feedback value based on the performance information of the third neural network and the feedback function, including: the server compares the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the third neural network is better than the P second neural networks in the current Pareto front, the server generates a feedback value based on P and the feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the third neural network is worse than the Q second neural networks in the current Pareto front, the server generates a feedback value based on Q and the feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is. In this implementation, when the third neural network sampled by the first recurrent neural network is worse than the second neural network structure on the current Pareto front, a negative feedback value is given, so that the first recurrent neural network samples the next new third neural network far away from the current third neural network. Thereby guiding the server to evolve from a Pareto front with poor performance to a Pareto front with excellent performance.
[0015] In a possible implementation of the first aspect, the method may further include: the server receives neural network selection information sent by the client, wherein the neural network selection information may carry identification information of each fifth neural network in at least one fifth neural network, and may also carry a function corresponding to each fifth neural network; so that the server may select at least one fifth neural network from the N second neural networks according to the neural network selection information, and then iteratively train each fifth neural network until the convergence condition of the loss function is met, and send at least one fifth neural network that has completed the iterative training operation to the client. In this implementation, after the server sends the N second neural networks to the client, the client may select at least one fifth neural network from the N second neural networks, and then after the server iteratively trains the at least one fifth neural network selected by the client, it sends the at least one fifth neural network that has completed the iterative training operation to the client, so that the server performs the iterative training operation more targeted and avoids the waste of computer resources.
[0016] In a possible implementation of the first aspect, the method further includes: the server receives a data set sent by the client, the data type in the data set is associated with the functional indicator, the data type in the data set can be text, voice, image, a pair of images consisting of a low-quality image and a high-definition image, etc., the data set is used for the server to perform iterative training operations on the neural network, specifically, the server can use the data set to perform initial iterative training on the fourth neural network, and / or, the server uses the data set to perform iterative training on each fifth neural network. In this implementation, compared with the server autonomously acquiring the data set according to the functional goal of the neural network, the client sends the data set to the server when performing iterative training operations on the neural network, which makes the iterative training process of the neural network more targeted, so that the accuracy of the neural network after iterative training is higher.
[0017] In a second aspect, an embodiment of the present application provides a neural network processing method, which can be used in the field of neural network customization in the field of artificial intelligence. The method may include: a server receives customization information sent by a client, the customization information includes functional indicators of the neural network and performance indicators of the neural network, optionally, the functional indicators are used for the server to determine the general capabilities of the neural network, the general capabilities include text translation, text analysis, speech recognition, image recognition, image classification, image style transfer or image super-resolution reconstruction. One or more combinations of performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network or the number of floating-point operations per second. Any one or a combination of multiple indicators; the server generates N second neural networks according to the functional indicators and the performance indicators, wherein the multiple first neural networks are generated by the server according to the functional indicators and the performance indicators, the function of each first neural network meets the requirements of the functional indicators, N is a positive integer, and the performance of each second neural network meets the requirements of the performance indicators. Specifically, the server can iteratively train the first recurrent neural network with the performance indicator as the target until the first recurrent neural network is trained as a mature neural network, and then directly use the maturely trained first recurrent neural network to sample multiple first neural units; and then send the N second neural networks to the client.
[0018] In a possible implementation manner of the second aspect, the customization information also includes an index of the number of neural networks, and the index of the number is N.
[0019] In a possible implementation of the second aspect, the method also includes: the server receives neural network selection information sent by the client; selects at least one fifth neural network from N second neural networks according to the neural network selection information; performs iterative training on each fifth neural network until a convergence condition of the loss function is met; and sends at least one fifth neural network that has completed the iterative training operation to the client.
[0020] In a possible implementation of the second aspect, the method further includes: the server receives a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0021] For the specific implementation steps of the second aspect 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 first aspect, and will not be repeated here one by one.
[0022] In a third aspect, an embodiment of the present application provides a neural network processing method, which can be used in the field of neural network customization in the field of artificial intelligence, the method comprising: a client can display a customized information input interface, then when a user needs to customize a neural network, the customized information of the neural network can be input through the client, and then the client can obtain the customized information, the customized information includes functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, optionally, the general capabilities include one or more combinations of text translation, text analysis, speech recognition, image recognition, image classification, image style transfer or image super-resolution reconstruction, the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network or the number of floating-point operations per second. Any one or more indicators of combination; and sending customized information to the server, the customized information is used for the server to obtain N second neural networks according to the customized information, wherein N is a positive integer, the function of each second neural network meets the requirements of the functional indicators, and the performance of each second neural network meets the requirements of the performance indicators, so that N second neural networks sent by the server can be received.
[0023] In a possible implementation of the third aspect, the customization information also includes an indicator of the number of neural networks, which is N. The indicator of the number of neural networks is used by the server to determine the number of second neural networks to be sent to the client.
[0024] In a possible implementation manner of the third aspect, the method also includes: after receiving N second neural networks, the client can display the N second neural networks, and then obtain a neural network selection instruction, the neural network selection instruction is used for the client to select at least one fifth neural network from the N second neural networks, the client generates neural network selection information according to the neural network selection instruction, wherein the neural network selection information may carry identification information of each fifth neural network in at least one fifth neural network, and may also carry a function corresponding to each fifth neural network, used to instruct the server to iteratively train each fifth neural network in at least one fifth neural network; the client sends the neural network selection information to the server, and receives at least one fifth neural network that has completed the iterative training operation sent by the server.
[0025] In a possible implementation of the third aspect, the method also includes: the client can also display a data set entry interface to obtain the data set. Specifically, the client can receive the storage address of the data set and then read the data set from the storage address, or the client can directly receive the data set entered by the user; then the client can send the data set to the server, and the data type in the data set is associated with the functional indicator. The type of data in the data set can be text, voice, image, paired image consisting of low-quality image and high-definition image, etc., for the server to perform iterative training operations on the neural network.
[0026] For the beneficial effects brought about by the third aspect of the present application and each possible implementation method of the third aspect, reference may be made to the description of the first aspect and various possible implementation methods of the first aspect, and they will not be described one by one here.
[0027] In a fourth aspect, an embodiment of the present application provides a neural network processing method, which can be used in the field of neural network customization in the field of artificial intelligence. The method may include: a server obtains functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, optionally, the general capabilities include one or more combinations of text translation, text analysis, speech recognition, image recognition, image classification, image style transfer or image super-resolution reconstruction, and the performance indicators include any one or more combinations of indicators in the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network or the number of floating-point operations per second; the server uses a first recurrent neural network to generate a first neural network according to multiple first neural units, the function of the first neural network meets the requirements of the functional indicators, and the first neural network The network includes at least one second neural unit, and the at least one second neural unit is included in multiple first neural units; the server generates performance information of the first neural network, and the performance information of the first neural network is consistent with the type of information included in the performance index of the neural network to be generated; the server updates the current Pareto front by comparing the performance of the first neural network with the performance of each second neural network in the current Pareto front, wherein the performance of each second neural network meets the requirements of the performance index; the server generates a feedback value according to the performance information of the first neural network and the feedback function; the server updates the parameters of the first recurrent neural network according to the gradient of the feedback value; the server repeatedly executes the above-mentioned first neural network generation operation, the first neural network performance information generation operation, the current Pareto front update operation and the first recurrent neural network parameter update operation until a final Pareto front is generated.
[0028] In a possible implementation of the fourth aspect, before the server generates the first neural network based on the multiple first neural units, the method also includes: the server obtains a fourth neural network, the fourth neural network includes the multiple first neural units; the server performs initial iterative training on the fourth neural network, wherein the fourth neural network that has performed the initial iterative training is used to initialize the third neural network; the server generates the first neural network based on the multiple first neural units includes: the server generates the third neural network based on the multiple first neural units in the fourth neural network that has performed the initial iterative training.
[0029] In a possible implementation of the fourth aspect, the fourth neural network includes multiple neuron layers, each neuron layer includes L first neural units, wherein L is a positive integer, and the server uses the first recurrent neural network to generate the first neural network based on the multiple first neural units, including: the server outputs L numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the L first neural units; the server converts the L numerical values into L probability values through a normalized exponential function, and the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; the server selects a second neural unit from the L first neural units according to the L probability values to implement the function of a neuron layer in the first neural network.
[0030] In a possible implementation of the fourth aspect, a first performance parameter and a first threshold are pre-set in the feedback function, the first performance parameter is any indicator in the performance indicator except the accuracy of the neural network, and the server generates a feedback value according to the performance information of the first neural network and the feedback function, including: the server generates the feedback value according to the accuracy of the first neural network, the second performance parameter of the first neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the first neural network and the feedback value is positively correlated, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; after the server generates the feedback value according to the performance information of the first neural network and the feedback function, the method also includes: the server increases the first performance parameter.
[0031] In a possible implementation of the fourth aspect, the server generates a feedback value based on performance information of the first neural network and a feedback function, including: the server compares the performance of the first neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the first neural network is better than P second neural networks in the current Pareto front, the server generates a feedback value based on P and the feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the first neural network is worse than Q second neural networks in the current Pareto front, the server generates a feedback value based on Q and the feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is.
[0032] For the specific implementation steps of the fourth aspect of this application and various possible implementation methods of the fourth aspect, as well as the beneficial effects brought about by each possible implementation method, reference can be made to the description of the first aspect and various possible implementation methods in the first aspect, and they will not be repeated here one by one.
[0033] In a fifth aspect, an embodiment of the present application provides a server that can be used in the field of neural network customization in the field of artificial intelligence. The server may include a receiving unit, a selecting unit and a sending unit, wherein the receiving unit is used to receive customized information sent by a client, the customized information includes functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second, any one of the indicators or a combination of multiple indicators; the selecting unit is used to select N second neural networks from multiple first neural networks with the performance indicators of the neural network as the target, wherein the multiple first neural networks are generated by the server according to the functional indicators and the performance indicators, the function of each first neural network meets the requirements of the functional indicators, N is a positive integer, and the performance of each second neural network meets the requirements of the performance indicators; the sending unit is used to send the N second neural networks to the client.
[0034] In a possible implementation of the fifth aspect, the customization information also includes an indicator of the number of neural networks, and the indicator of the number is N. The selection unit is specifically used to: select a final Pareto front from multiple first neural networks with the performance indicator of the neural network as a target, and the final Pareto front includes M second neural networks, where M is a positive integer and M is greater than or equal to N; select N second neural networks from the M second neural networks.
[0035] In a possible implementation of the fifth aspect, the server also includes: a generation unit, which is used to generate a third neural network based on multiple first neural units using the first recurrent neural network, the third neural network is a neural network among the multiple first neural networks, the third neural network includes at least one second neural unit, and the at least one second neural unit is included in the multiple first neural units; the selection unit is specifically used to: generate performance information of the third neural network, the performance information of the third neural network is consistent with the type of information included in the performance indicator of the neural network; update the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front; generate a feedback value based on the performance information of the third neural network and the feedback function; and update the parameters of the first recurrent neural network according to the gradient of the feedback value.
[0036] In a possible implementation of the fifth aspect, the server also includes: an acquisition unit, used to acquire a fourth neural network, the fourth neural network including a plurality of first neural units; a training unit, used to perform initial iterative training on the fourth neural network, wherein the fourth neural network that has undergone the initial iterative training is used to initialize the third neural network; and the generation unit is specifically used to generate the third neural network according to the plurality of first neural units in the fourth neural network that has undergone the initial iterative training.
[0037] In a possible implementation of the fifth aspect, the fourth neural network includes multiple neuron layers, each neuron layer includes L first neural units, where L is a positive integer; the generating unit is specifically used to: output L numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the L first neural units; convert the L numerical values into L probability values through a normalized exponential function, the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; according to the L probability values, select a second neural unit from the L first neural units to implement the function of a neuron layer in the third neural network.
[0038] In a possible implementation of the fifth aspect, a first performance parameter and a first threshold are pre-set in the feedback function, and the first performance parameter is any indicator in the performance indicator except the accuracy of the neural network; the generation unit is specifically used to: generate a feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, and the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; the server also includes: an increasing unit, used to increase the first performance parameter.
[0039] In a possible implementation manner of the fifth aspect, the generating unit is specifically used to: compare the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the third neural network is better than the P second neural networks in the current Pareto front, generate a feedback value according to P and a feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the third neural network is worse than the Q second neural networks in the current Pareto front, generate a feedback value according to Q and a feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is.
[0040] In a possible implementation of the fifth aspect, the receiving unit is further used to receive neural network selection information sent by the client; the selecting unit is further used to select at least one fifth neural network from the N second neural networks according to the neural network selection information; the server also includes: a training unit, used to iteratively train each fifth neural network until the convergence condition of the loss function is met; and a sending unit, used to send at least one fifth neural network that has completed the iterative training operation to the client.
[0041] In a possible implementation of the fifth aspect, the receiving unit is further used to receive a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0042] For the specific implementation steps of the component modules of the server provided in the fifth aspect of this application to execute the fifth aspect and various possible implementation methods of the fifth aspect, reference can be made to the description in the second aspect and various possible implementation methods in the second aspect, and they will not be repeated here one by one.
[0043] In a sixth aspect, an embodiment of the present application further provides a server that can be used in the field of neural network customization in the field of artificial intelligence. The server may include a receiving unit, a generating unit and a sending unit, wherein the receiving unit is used to receive customized information sent by a client, the customized information includes functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second, any one of the indicators or a combination of multiple indicators; the generating unit is used to generate N second neural networks based on the functional indicators and the performance indicators; the sending unit is used to send the N second neural networks to the client.
[0044] In a possible implementation manner of the sixth aspect, the customization information also includes an index of the number of neural networks, and the index of the number is N.
[0045] In a possible implementation of the sixth aspect, the receiving unit is further used to receive neural network selection information sent by the client; the selecting unit is further used to select at least one fifth neural network from the N second neural networks based on the neural network selection information; the server also includes: a training unit, used to iteratively train each fifth neural network until the convergence condition of the loss function is met; and a sending unit, used to send at least one fifth neural network that has completed the iterative training operation to the client.
[0046] In a possible implementation of the sixth aspect, the receiving unit is further used to receive a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0047] For the specific implementation steps of the component modules of the server provided in the sixth aspect of this application to execute the sixth aspect and various possible implementation methods of the sixth aspect, reference can be made to the description in the second aspect and various possible implementation methods in the second aspect, and they will not be repeated here one by one.
[0048] In a seventh aspect, an embodiment of the present application provides a communication device that can be used in the field of neural network customization in the field of artificial intelligence, the communication device comprising: an acquisition unit, a sending unit and a receiving unit, wherein the acquisition unit is used to acquire customized information, the customized information includes functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second. Any one or more indicators in combination; the sending unit is used to send customized information to the server, and the customized information is used for the server to obtain N second neural networks according to the customized information, wherein N is a positive integer, the function of each second neural network meets the requirements of the functional indicators, and the performance of each second neural network meets the requirements of the performance indicators; the receiving unit is used to receive N second neural networks sent by the server.
[0049] In a possible implementation of the seventh aspect, the customization information also includes an indicator of the number of neural networks, which is N. The indicator of the number of neural networks is used by the server to determine the number of second neural networks to be sent to the client.
[0050] In a possible implementation of the seventh aspect, the acquisition unit is further used to acquire a neural network selection instruction, the neural network selection instruction is used for the client to select at least one fifth neural network from N second neural networks; the communication device also includes: a generation unit, used to generate neural network selection information according to the neural network selection instruction, the neural network selection information is used to instruct the server to iteratively train each fifth neural network in at least one fifth neural network; the sending unit is further used to send the neural network selection information to the server; the receiving unit is further used to receive at least one fifth neural network that has completed the iterative training operation sent by the server.
[0051] In a possible implementation of the seventh aspect, the sending unit is further used to send a data set to the server, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0052] For the specific implementation steps of the component modules of the server provided in the seventh aspect of this application to execute the seventh aspect and various possible implementation methods of the seventh aspect, reference can be made to the description in the third aspect and various possible implementation methods in the third aspect, and they will not be repeated here one by one.
[0053] In an eighth aspect, an embodiment of the present application provides a neural network processing device, which can be used in the field of neural network customization in the field of artificial intelligence. The neural network processing device includes: an acquisition unit, a generation unit and an update unit, wherein the acquisition unit is used to obtain functional indicators of the neural network and performance indicators of the neural network. The functional indicators are used for the server to determine the general capabilities of the neural network. The performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second. Any one or more indicators of the combination; the generation unit is used to use a first recurrent neural network to generate a first neural network based on multiple first neural units. The function of the first neural network meets the requirements of the functional indicators. The first neural network includes at least one second neural unit, and the at least one second neural unit is included in the multiple first neural units. A neural unit; a generating unit, further used for the server to generate performance information of a first neural network, the performance information of the first neural network is consistent with the type of information included in the performance index of the neural network to be generated; an updating unit, further used to update the current Pareto front by comparing the performance of the first neural network with the performance of each second neural network in the current Pareto front, wherein the performance of each second neural network meets the requirements of the performance index; the generating unit, further used to generate a feedback value according to the performance information of the first neural network and a feedback function; the updating unit, further used to update the parameters of the first recurrent neural network according to the feedback value gradient; the generating unit and the updating unit repeatedly perform the above-mentioned first neural network generating operation, the first neural network performance information generating operation, the current Pareto front updating operation and the first recurrent neural network parameter updating operation until a final Pareto front is generated.
[0054] In a possible implementation of the eighth aspect, the acquisition unit is also used to acquire a fourth neural network, which includes multiple first neural units; the neural network processing device also includes: a training unit, used to perform initial iterative training on the fourth neural network, wherein the fourth neural network that has performed the initial iterative training is used to initialize the third neural network; the generation unit is specifically used to: generate the third neural network according to the multiple first neural units in the fourth neural network that has performed the initial iterative training.
[0055] In a possible implementation of the eighth aspect, the fourth neural network includes multiple neuron layers, each neuron layer includes L first neural units, where L is a positive integer; the generating unit is specifically used to: output L numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the L first neural units; convert the L numerical values into L probability values through a normalized exponential function, the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; according to the L probability values, select a second neural unit from the L first neural units to implement the function of a neuron layer in the third neural network.
[0056] In a possible implementation of the eighth aspect, a first performance parameter and a first threshold are pre-set in the feedback function, and the first performance parameter is any indicator in the performance indicators except the accuracy of the neural network; the generation unit is specifically used to: generate a feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, and the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; the server also includes: an increasing unit, used to increase the first performance parameter.
[0057] In a possible implementation manner of the eighth aspect, the generating unit is specifically used to: compare the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the third neural network is better than the P second neural networks in the current Pareto front, generate a feedback value according to P and a feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the third neural network is worse than the Q second neural networks in the current Pareto front, generate a feedback value according to Q and a feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is.
[0058] For the specific implementation steps of the eighth aspect of the present application and the various possible implementation methods of the eighth aspect, as well as the beneficial effects brought about by each possible implementation method, reference may be made to the description of the fourth aspect and the various possible implementation methods in the fourth aspect, and no further details will be given here.
[0059] In a ninth aspect, an embodiment of the present application provides a server, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute programs in the memory, including the following steps: receiving customized information sent by a client, the customized information including functional indicators of a neural network and performance indicators of a neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include any one of the indicators or a combination of multiple indicators such as the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; taking the performance indicator of the neural network as a target, selecting N second neural networks from multiple first neural networks, wherein the multiple first neural networks are generated by the server according to the functional indicators and the performance indicators, the function of each first neural network meets the requirements of the functional indicators, N is a positive integer, and the performance of each second neural network meets the requirements of the performance indicators; sending the N second neural networks to the client, and the bus system is used to connect the memory and the processor so that the memory and the processor communicate.
[0060] In the ninth aspect of the present application, the processor can also be used to execute the steps performed by the server in various possible implementation methods of the first aspect. Please refer to the first aspect for details and will not be repeated here.
[0061] In a tenth aspect, an embodiment of the present application provides a server, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute programs in the memory, including the following steps: receiving customized information sent by a client, the customized information including functional indicators of a neural network and performance indicators of a neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include any one of the indicators or a combination of multiple indicators such as the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; generating N second neural networks according to the functional indicators and performance indicators of the neural network, wherein multiple first neural networks are generated by the server according to the functional indicators and performance indicators, the function of each first neural network meets the requirements of the functional indicators, N is a positive integer, and the performance of each second neural network meets the requirements of the performance indicators; sending the N second neural networks to the client, and the bus system is used to connect the memory and the processor so that the memory and the processor communicate.
[0062] In the tenth aspect of the present application, the processor can also be used to execute the steps performed by the server in various possible implementation methods of the second aspect. The details can be found in the first aspect and will not be repeated here.
[0063] In the eleventh aspect, an embodiment of the present application provides a server, which may include a memory, a processor and a bus system, wherein the memory is used to store programs, and the processor is used to execute programs in the memory, including the following steps: obtaining customized information, the customized information including functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or any one or more indicators in the number of floating-point operations per second; sending customized information to the server, the customized information is used for the server to obtain N second neural networks according to the customized information, wherein N is a positive integer, the function of each second neural network meets the requirements of the functional indicators, and the performance of each second neural network meets the requirements of the performance indicators; receiving the N second neural networks sent by the server, and the bus system is used to connect the memory and the processor so that the memory and the processor communicate.
[0064] In the eleventh aspect of the present application, the processor can also be used to execute the steps performed by the communication device in each possible implementation method of the third aspect. Please refer to the third aspect for details and will not be repeated here.
[0065] In a twelfth aspect, an embodiment of the present application provides a server, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute programs in the memory, including the following steps: obtaining functional indicators of a neural network and performance indicators of the neural network, the performance indicators including the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or any one or more combinations of the number of floating-point operations per second; using a first recurrent neural network, generating a first neural network according to multiple first neural units, the function of the first neural network meets the requirements of the functional indicators, the first neural network includes at least one second neural unit, and the at least one second neural unit is included in multiple first neural units; generating a first neural network The performance information of the first neural network is consistent with the type of information included in the performance index of the neural network to be generated; the current Pareto front is updated by comparing the performance of the first neural network with the performance of each second neural network in the current Pareto front, wherein the performance of each second neural network meets the requirements of the performance index; a feedback value is generated according to the performance information of the first neural network and the feedback function; the parameters of the first recurrent neural network are updated according to the feedback value gradient; the above-mentioned first neural network generation operation, the first neural network performance information generation operation, the current Pareto front update operation and the first recurrent neural network parameter update operation are repeatedly performed until a final Pareto front is generated, and the bus system is used to connect the memory and the processor so that the memory and the processor communicate.
[0066] In the twelfth aspect of the present application, the processor can also be used to execute the steps performed by the server in various possible implementation methods of the fourth aspect. Please refer to the fourth aspect for details and will not be repeated here.
[0067] In the thirteenth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the neural network processing method described in the first aspect, the second aspect, the third aspect, or the fourth aspect.
[0068] In the fourteenth 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 processing method described in the first aspect, the second aspect, the third aspect, or the fourth aspect above.
[0069] In a fifteenth aspect, the present application provides a chip system, which includes a processor for supporting a server or a neural network processing device to implement the functions involved in the above aspects, for example, sending or processing the data and / or information involved in the above methods. In one possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the server or communication device. The chip system can be composed of chips, or it can include chips and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 A schematic diagram of the structure of the artificial intelligence main framework provided in the embodiment of the present application;
[0071] Figure 2 A schematic diagram of a network structure of a neural network processing system provided in an embodiment of the present application;
[0072] Figure 3 A schematic diagram of a flow chart of a neural network processing method provided in an embodiment of the present application;
[0073] Figure 4 A schematic diagram of a plurality of first neural networks is provided for an embodiment of the present application;
[0074] Figure 5 A schematic diagram of the current Pareto front is provided for the embodiment of the present application;
[0075] Figure 6 Another schematic diagram of a flow chart of a neural network processing method provided in an embodiment of the present application;
[0076] Figure 7 A schematic diagram of a process for generating a final Pareto frontier by a server of a neural network processing method provided in an embodiment of the present application;
[0077] Figure 8 A schematic diagram of a flow chart of a neural network processing method provided in an embodiment of the present application;
[0078] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0079] Fig.10 Another structural diagram of a server provided in an embodiment of the present application;
[0080] Fig.11 Another structural diagram of a server provided in an embodiment of the present application;
[0081] Fig.12 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0082] Fig.13 A schematic diagram of the structure of a neural network processing device provided in an embodiment of the present application;
[0083] Fig.14 A schematic diagram of another structure of a server provided in an embodiment of the present application;
[0084] Fig.15 Another structural diagram of a communication device provided in an embodiment of the present application;
[0085] Fig.16 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] The embodiments of the present application provide a neural network processing method and related equipment, which are used to send N second neural networks to the client according to the functional indicators and performance indicators of the neural network sent by the client, and each second neural network simultaneously meets the requirements of the aforementioned functional indicators and performance indicators to achieve customization of the neural network.
[0087] 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.
[0088] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances. This is merely a way of distinguishing objects with the same properties when describing the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, so that a process, method, system, product, or device that includes a series of units is not necessarily limited to those units, but may include other units that are not explicitly listed or inherent to these processes, methods, products, or devices.
[0089] First, the overall workflow of the artificial intelligence system is described. Figure 1 , Figure 1 The 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.
[0090] (1) Infrastructure
[0091] The infrastructure provides computing power support for the AI system, enables communication with the outside world, and supports it through the basic platform. It communicates with the outside world through sensors; computing power is provided by smart chips (CPU, NPU, GPU, ASIC, FPGA and other hardware acceleration chips); 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.
[0092] (2) Data
[0093] 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.
[0094] (3) Data processing
[0095] Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
[0096] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0097] 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.
[0098] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
[0099] (4) General ability
[0100] 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.
[0101] (5) Smart products and industry applications
[0102] 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.
[0103] As artificial intelligence develops, more and more products and industries need to apply neural networks. Specifically, as an example, the instant messaging client of a smart terminal often has a function in which the receiver converts the received voice information into text information. In this case, a convolutional neural network can be used to realize the function of voice recognition. As another example, in the field of autonomous driving, a deep separable convolutional neural network can be used to realize image classification during the driving process of an autonomous driving vehicle. As another example, in the field of autonomous driving, in order to realize simulation testing of autonomous driving vehicles, a generative adversarial neural network can be used to generate a virtual road environment. As another example, in the field of intelligent security, in order to improve the resolution of images captured by surveillance cameras, a convolutional neural network can be used to improve the resolution of images, etc. Other application scenarios will not be given examples one by one here.
[0104] However, not all product manufacturers in industries that apply artificial intelligence have the ability to develop neural networks. Therefore, in combination with the above description, an embodiment of the present application provides a neural network processing method for realizing customization of neural networks. Specifically, a server can provide a client for customizing neural networks, and the client can obtain customization information input by the user and send it to the server, wherein the customization information includes functional indicators and performance indicators of the neural network. The server can determine the general capabilities of the neural network based on the received functional indicators, and then obtain N second neural networks, each of which meets the requirements of functional indicators and performance indicators. The server sends the N second neural networks to the client, thereby realizing customization of the neural network.
[0105] It can be seen from the above description that the embodiment of the present application involves both the server and the client. Figure 2 The network architecture of the neural network processing system in the embodiment of the present application is introduced. Figure 2 A network architecture diagram of a neural network processing system provided in an embodiment of the present application, in Figure 2 In the figure, the neural network processing system 200 includes a client 210, a server 220, a database 230, a first communication device 240, a data storage system 250 and a second communication device 260.
[0106] The client 210 is deployed on the first communication device 240 , and is used to receive customized information entered by the user, the customized information including functional indicators and performance indicators of the neural network, and send the customized information to the server 220 .
[0107] The database 230 stores a data set, which is used for the server 220 to iteratively train the neural network. The data set may be uploaded to the server 220 by the user through the client 210, or may be acquired by the server 220 through a data acquisition device. After receiving the customized information, the server 220 acquires N second neural networks, each of which meets the requirements of functional indicators and performance indicators, and the server 220 sends the N second neural networks to the client 210; further, the server is also used to iteratively train all or part of the N second neural networks using the data set stored in the database 230 to obtain a mature neural network, and send the mature neural network to the client 210.
[0108] After receiving the mature neural network, the client 210 can run the mature neural network on the first communication device 240; it can also send the mature neural network to the second communication device 260, or load the mature neural network to the second communication device 260, and the second communication device 260 can run the mature network.
[0109] The first communication device 240 includes, but is not limited to, a tablet computer, a laptop computer, a PDA, a mobile phone, a voice interaction device, and a personal computer (PC), which are not limited here. The second communication device 260 can represent any computing device, such as a personal computer, a computer workstation, a smart phone, a tablet computer, a smart camera, a smart car or other types of cellular phones, a media consumption device, a wearable device, a set-top box, a game console, etc.
[0110] The client 210 and the server 220 as well as the client 210 and the second communication device 260 can be connected via a wireless network. The wireless network uses standard communication technology and / or protocols. The wireless network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, a private network or any combination of a virtual private network). In other embodiments, customized or dedicated data communication technology can also be used to replace or supplement the above data communication technology.
[0111] Although Figure 2 Only one server 220, one first communication device 240 and one second communication device 260 are shown, but it should be understood that Figure 2 The examples are only used to understand the present solution, and the number of specific servers 220, first communication devices 240 and second communication devices 260 should be flexibly determined in accordance with the actual situation. In the present application embodiment, only the method for generating information provided is applied to a communication type client as an example for explanation.
[0112] In combination with the above description, the specific implementation process of the neural network processing method provided in the embodiment of the present application is described below. After receiving the customized information sent by the client, the server needs to send N second neural networks to the client. Specifically, the server needs to obtain N second neural networks with the functional indicators and performance indicators in the customized information as the target, that is, with the performance indicators as the target, guide the server to generate a first neural network that meets the performance indicators. More specifically, in one case, in the initial stage, the server randomly generates a first neural network through the controller, and updates the controller parameters based on the performance information of the first neural network to feedback whether the first neural network meets the performance index, and then the probability that the first neural structure generated by the server through the controller meets the performance index will become higher and higher. That is, in this case, although the server guides the controller to iteratively update in the direction of generating performance indicators for the purpose of performance indicators, in the process of iterative update of the controller, the server cannot guarantee that all first neural networks generated by the controller meet the performance indicators, so it is necessary to generate multiple first neural networks based on the functional indicators and the performance indicators, and then select N second neural networks from the multiple first neural networks, wherein each first neural network meets the requirements of the functional indicators but not necessarily the requirements of the performance indicators, and each selected second neural network meets both the requirements of the functional indicators and the requirements of the performance indicators; in another case, the server can also directly generate N second neural networks, for example, the server can pre-train the controller so that the server can directly generate N second neural networks based on the functional indicators and the performance indicators through the trained controller.
[0113] Among them, the controller can be specifically manifested as a recurrent neural network. Recurrent Neural Networks (RNNs) are neural networks used to process sequence data; and in theory, RNNs can process sequence data of any length. In the traditional neural network model, from the input layer to the hidden layer and then to the output layer, the layers are fully connected, and the nodes between each layer are disconnected. However, this ordinary neural network is powerless for many problems. For example, if you want to predict what the next word in a sentence is, you generally need to use the previous word, because the previous and next words in a sentence are not independent. RNNs are called recurrent neural networks because the current output of a sequence in a recurrent neural network is also related to the previous output. The specific manifestation is that the network will remember the previous information and apply it to the calculation of the current output, that is, the nodes between the hidden layers are no longer disconnected but connected, and the input of the hidden layer includes not only the output of the input layer but also the output of the hidden layer at the previous moment.
[0114] Since the processes on the server side are different in the above two cases, the specific implementation processes of the above two cases are described below respectively.
[0115] 1. Select N second neural networks from multiple first neural networks
[0116] In the present application, please refer to Figure 3 , Figure 3 A flowchart of a neural network processing method provided in an embodiment of the present application is provided. The neural network processing method provided in an embodiment of the present application may include:
[0117] 301. The client obtains customized information, where the customized information includes functional indicators of the neural network and performance indicators of the neural network.
[0118] In some embodiments of the present application, the client can display a customization information input interface to the user. When the user needs to customize the neural network, the customization information of the neural network to be customized can be input through the client. Correspondingly, the client can obtain the customization information input by the user, wherein the customization information includes the functional indicators of the neural network and the performance indicators of the neural network. Specifically, the functional indicators of the neural network are used for the server to determine the general capabilities of the second neural network, that is, the server can determine what kind of tasks the second neural network needs to complete based on the functional indicators. As an example, the functional indicators of the neural network can be one or more combinations of text translation, text analysis, speech recognition, image recognition, image classification, image super-resolution reconstruction, etc.; the performance indicators of the neural network can include any one or more indicators of the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second.
[0119] More specifically, as an example, for example, if the functional indicator of the second neural network is text translation, the accuracy of the neural network can be the ratio between the number of characters correctly translated by the second neural network and the total number of characters; as another example, for example, if the functional indicator of the second neural network is image super-resolution reconstruction, low-quality images and high-definition images of the same object can be obtained, and the low-quality images can be super-resolved using the second neural network. The accuracy of the neural network can be the similarity between the reconstructed image output by the second neural network and the high-definition image. Here, the accuracy of the neural network in other scenarios is not given one by one. The parameter quantity of the neural network refers to the number of weights in the neural network. Since each neuron corresponds to a weight, the parameter quantity indicator of the neural network can reflect the user's requirements for the number of neurons in the neural network. The processing time of the neural network refers to the time required for the neural network to process a unit of task. As an example, for example, if the functional indicator of the second neural network is text translation, a unit of task can refer to translating 10 words, then the processing time of the neural network refers to the time it takes for the second neural network to translate 10 characters; as another example, for example, if the functional indicator of the second neural network is image classification, a unit of task can refer to 100 images, then the processing time of the neural network refers to the time it takes for the second neural network to classify 100 images, etc. The number of floating point operations per second can reflect the data processing speed of the neural network. It should be understood that the above examples of functional indicators, a unit of task, and the processing time of the neural network are only for the convenience of understanding this solution and are not used to limit this solution.
[0120] Specifically, in one implementation, the client obtains the functional index of the neural network by displaying at least one functional index to the user and receiving the functional index selection instruction input by the user, so that the client can determine a functional index from at least one functional index selection instruction according to the functional index selection instruction. More specifically, in one case, the client can directly display at least one functional index to the user, so that the user can input the functional index selection instruction by pressing or clicking the selection icon corresponding to the functional index; in another case, the client can also display a functional index display button to the user, and when the user clicks the functional index display button, the client displays at least one functional index to the user through a floating window or a sliding text box, so that the user can input the functional index selection instruction by pressing or clicking the selection icon corresponding to the functional index. Further, when the client cannot display all kinds of functional indexes at one time, the user can also switch the functional index displayed in the sliding text box by inputting an up and down sliding operation. Optionally, when displaying at least one functional index, the client can also be provided with an icon corresponding to a custom option at the same time. When the user inputs a custom instruction through the icon, the client can obtain the functional index input by the user to improve the comprehensiveness of this solution.
[0121] In another implementation mode, the client may also display a function indicator input interface in the form of a text box to the user, and the user may directly input the function indicator through the text box; in another implementation mode, the user may also input the function indicator of the neural network in the form of voice, etc. The specific way in which the client obtains the function indicator of the neural network may be determined in combination with the specific form of the actual product. The examples given here are only for the convenience of understanding this solution and are not used to limit this solution.
[0122] The client obtains the performance index of the neural network by displaying at least one performance name to the user, and a text box is configured next to each performance name to receive the performance index input by the user. Furthermore, an adjustment button can be set next to each text box to increase or decrease the performance index. The client can also configure at least two performance index options next to each performance name, and the user enters the performance index by entering a selection instruction. As an example, for example, the performance names shown by the client include the accuracy of the neural network, the number of parameters of the neural network, and the memory size occupied by the neural network. The user can enter the accuracy of the neural network greater than or equal to 95%, the parameter index of the neural network less than or equal to 3 million, and the memory size occupied by the neural network less than or equal to 30M through the text box next to the name. Furthermore, the size of the index can be adjusted by adjusting the button, for example, the parameter index of the neural network can be reduced to 2.8 million by adjusting the button, etc. It should be understood that the examples here are only for the convenience of understanding this solution and are not used to limit this solution.
[0123] Optionally, the customized information entry interface displayed by the client to the user may also include an interface for entering the number of neural network indicators, so that the customized information obtained by the client may also include the number of neural network indicators, wherein the number of indicators is N, N is a positive integer, and the value of N can be 1, 2, 3, 4, 5, 6, etc. The specific value of N is not limited here. Specifically, a text box for inputting the number of neural network indicators may be displayed on the customized information entry interface of the client, so that the user can input the number of neural network indicators through the text box. Similar to the display method of performance indicators, an adjustment button may be provided next to the text box, so that the number of neural network indicators can be increased or decreased through the adjustment button; the client may also display several options for the number of neural network indicators, so that the user can input the number of neural network indicators by inputting selection instructions, etc.
[0124] 302. The client obtains a data set.
[0125] In some embodiments of the present application, in addition to obtaining customized information, the client can also obtain a data set, wherein the data set is used for the server to perform iterative training operations on the neural network, and the data type in the data set is associated with the functional indicator. As an example, if the functional indicator of the neural network is text translation, the data set may include a large amount of text; as another example, if the functional indicator of the neural network is speech recognition, the data set may include a large amount of speech; as another example, if the functional indicator of the neural network is image recognition or image classification, the data set may include a large amount of images; as another example, if the functional indicator of the neural network is image super-resolution reconstruction, the data set includes a large number of paired images, and the paired images are low-quality images and high-definition quality images, etc., and the specifics are not limited here.
[0126] Specifically, the client displays an icon corresponding to the function of adding a data set to the user. When the user clicks, presses or double-clicks the icon, the client can receive a data set adding instruction, and then can obtain the data set. More specifically, in one implementation, the data set can be stored on the execution device where the client is located or on an external storage device connected to the execution device. When the client receives the data set adding instruction input by the user, the client can obtain the storage address of the data set input by the user, and then obtain the data set from the storage address. As an example, if the data type in the data set is an image, the execution device or the external storage device connected to the execution device can store image data. When the client obtains the storage address input by the user, the image data can be read at the location corresponding to the storage address; in another implementation, when the client receives the data set adding instruction input by the user, the client can receive the data set directly input by the user. As an example, if the data type in the data set is text, the client can receive text data directly input by the user, etc. It should be understood that the examples here are only for the convenience of understanding this solution and are not used to limit this solution.
[0127] It should be noted that the embodiment of the present application does not limit the execution order of step 301 and step 302. Step 301 may be executed first, and then step 302; or step 302 may be executed first, and then step 301.
[0128] 303. The client sends customized information to the server.
[0129] In some embodiments of the present application, after acquiring the customized information, the client may package the customized information and send the packaged customized information to the server, and then the server may receive the customized information sent by the client.
[0130] Optionally, when the customization information includes an indicator of the number of neural networks, the indicator of the number of neural networks is used for the server to determine the number of second neural networks to send to the client. Through the aforementioned method, the user can not only customize the functions and performance of the neural network, but also customize the number of desired neural networks, which further improves the customization accuracy of the neural network and is conducive to enhancing customer stickiness.
[0131] 304. The client sends a data set to the server.
[0132] In some embodiments of the present application, after acquiring the data set, the client can package the data set and send the packaged data set to the server, so that the server can receive the data set sent by the client, and then use the data set to perform iterative training operations on the neural network. In the embodiments of the present application, compared with the server autonomously acquiring the data set according to the functional objectives of the neural network, the client sends the data set when performing iterative training operations on the neural network to the server, which makes the iterative training process of the neural network more targeted, so that the accuracy of the neural network after iterative training is higher.
[0133] It should be understood that the embodiment of the present application does not limit the execution order of step 303 and step 304. Step 303 may be executed first, and then step 304; step 304 may be executed first, and then step 303; step 303 and step 304 may also be executed simultaneously, that is, the client may package the customized information and the data set together, and then send the packaged customized information and data set together to the server.
[0134] It should be noted that step 302 and step 304 are optional steps. If step 302 is not executed, step 304 is also not executed. The client can directly execute step 303 after executing step 301, and then execute step 305; if step 302 is executed, step 304 is executed.
[0135] 305. The server obtains a fourth neural network, where the fourth neural network includes multiple first neural units.
[0136] In some embodiments of the present application, after receiving the customized information, the server can determine the general capability type of the neural network to be generated according to the functional indicators in the customized information, and then determine the multiple first neural units that can realize the general capability, then the server can obtain the fourth neural network, and the fourth neural network includes the multiple first neural units. Among them, the first neural unit is a general concept, the first neural unit refers to the neural unit that can form the first neural network that realizes the functional indicators in the customized information, and the fourth neural network refers to the neural network including multiple first neural units. Neural units are different from neurons. Each neural unit can include at least one neuron, and each neural unit is used to implement an operation. As an example, if the functional indicator in the customized information is image recognition, the neural unit can be a 3×3 convolution layer, a 5×5 convolution layer, an average pooling layer, a maximum pooling layer, or a unit operation layer; as another example, if the functional indicator in the customized information is text prediction, the neural unit can be an input layer, a recurrent neural network layer, an output layer, or a unit operation layer, etc. The specific form of expression of each neural unit should be determined in combination with the functional indicator of the neural network, which is not limited here.
[0137] Specifically, a convolutional layer can include many convolution operators, also known as kernels, which act as a filter in image processing to extract specific information from the input image matrix. A convolution operator can essentially be a weight matrix, which is usually predefined. During the convolution operation on the image, the weight matrix is usually processed horizontally one pixel after another (or two pixels after two pixels... depending on the value of the stride) on the input image to complete the work of extracting specific features from the image. The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image. During the convolution operation, the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, a single weight matrix is not used, but multiple weight matrices of the same dimension are applied. The output of each weight matrix is stacked to form the depth dimension of the convolved image. Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to blur unnecessary noise in the image... The multiple weight matrices have the same dimensions, and the feature maps extracted by the multiple weight matrices with the same dimensions are also of the same dimension. The extracted feature maps with the same dimensions are then merged to form the output of the convolution operation.
[0138] In the image processing process, the only purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer can include an average pooling layer and / or a maximum pooling layer to sample the input image to obtain an image of smaller size. The average pooling layer can calculate the pixel values in the image within a specific range to produce an average value. The maximum pooling layer can take the pixel with the largest value in a specific range as the result of the maximum pooling. In addition, just as the size of the weight matrix used in the convolution layer should be related to the image size, the operator in the pooling layer should also be related to the image size. The size of the image output after processing by the pooling layer can be smaller than the size of the image input to the pooling layer. Each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer. The unit operation layer refers to the neuron layer whose input is equal to the output.
[0139] The fourth neural network is also a general concept, which refers to a neural network including multiple first neural units. The fourth neural network may include multiple (for example, H, H is a positive integer) neuron layers, each neuron layer includes L first neural units, and L is a positive integer. The specific values of H and L should be determined in combination with the functional objectives corresponding to the first neural units, and are not limited here. Optionally, the L first neural units of each neuron layer may include a unit operation layer. Since the unit operation layer is a neuron layer whose input is equal to the output, that is, if the unit operation layer is selected to implement the function of a neuron layer of the third neural network, it is equivalent to that this layer does not exist, so the number of neuron layers of the third neural network can be adjusted by adjusting the number of unit operation layers in the third neural network.
[0140] Specifically, multiple first neural units may be pre-stored on the server, and after receiving the customized information, the server generates a fourth neural network including the multiple first neural units; multiple fourth neural networks corresponding to multiple functions may also be pre-stored on the server. After receiving the customized information sent by the client, the server can select a fourth neural network whose function matches the functional indicator from the multiple fourth neural networks according to the functional indicator carried in the customized information. As an example, five fourth neural networks may be pre-stored on the server, which are used for text translation, text analysis, speech recognition, image recognition and image classification respectively. The functional indicator in the customized information received by the server is image classification, then the server can select a fourth neural network for image classification from the five fourth neural networks, and so on. It should be understood that the above examples are only for the convenience of understanding of this solution and are not used to limit this solution.
[0141] 306. The server performs initial iterative training on the fourth neural network.
[0142] In some embodiments of the present application, after acquiring the fourth neural network, the server may perform initial iterative training on the fourth neural network, wherein the fourth neural network that has performed initial iterative training is used to initialize the third neural network. Specifically, if step 304 is performed, step 306 may include: the server performs initial iterative training on the fourth neural network using the data set sent by the client.
[0143] More specifically, since each neuron layer of the fourth neural network includes multiple first neural units, the server may perform initial iterative training on the fourth neural network in the following manner: randomly initialize the parameters of all first neural units with parameters in the fourth neural network, and randomly select a first neural unit from multiple first neural units in each neuron layer of the fourth neural network to form a sub-neural network of the fourth neural network, and use the first loss function to update the parameters of the sub-neural network using the stochastic gradient descent method until the second preset condition is met, wherein the second preset condition may be until the convergence condition of the first loss function is reached, or the number of times the parameters of the sub-neural network are updated reaches the second threshold. As an example, the value of the second threshold may be 1500 times, 2000 times, 2500 times, etc., and the number of times of the second threshold is not specifically limited. After the sub-neural network of the fourth neural network completes the initial iterative operation, the parameters of each neuron in the sub-neural network can be obtained. Then, when the server generates the third neural network, it no longer randomly initializes the parameters for each neuron of the third neural network, but uses the parameters of the sub-neural network that has completed the initial iterative training operation.
[0144] In the embodiment of the present application, since the parameter indicators of the neural network generally include the accuracy indicator of the neural network, when the server performs statistics on the accuracy of the third neural network, it is necessary to first perform iterative training on the third neural network, and then start to count the accuracy of the third neural network. If the parameters of the third neural network are randomly initialized (that is, the parameters of the fourth neural network are not trained in advance), and then the third neural network is iteratively trained to obtain the accuracy of the third neural network, the accuracy statistics of the entire third neural network will be longer, and the server needs to generate multiple third neural networks, each of which must be trained from a randomly initialized state to a relatively mature state, which will cause the entire training time to be particularly long. By using the above method, the fourth neural network is firstly subjected to initial iterative training, and then the fourth neural network that has performed the initial iterative training is used to initialize the third neural network, which will greatly shorten the training time of each third neural network, thereby improving the efficiency of the neural network customization process in this solution.
[0145] 307. The server uses the first recurrent neural network to generate a third neural network based on the multiple first neural units.
[0146] In an embodiment of the present application, after determining multiple first neural units according to the functional indicators of the neural network carried in the customization information, the server can use the first recurrent neural network to generate a third neural network based on the multiple first neural units, that is, the server can select at least one second neural unit from the multiple first neural units and use the at least one second neural unit to form a third neural network. Among them, the third neural network is a general concept, which refers to any one of the multiple first neural networks generated by the server using the first recurrent neural network. The function of the third neural network meets the requirements of the functional indicators, but does not necessarily meet the requirements of the performance indicators. The first recurrent neural network is also a general concept, which refers to a recurrent neural network used to assist the server in generating the third neural network. When the network structure of the generated third neural network changes, the first recurrent neural network may or may not change. As an example, when the network structure of the third neural network is a residual network, and when the network structure of the third neural network is a convolutional neural network, the first recurrent neural network used may be different.
[0147] It should be understood that step 305 and step 306 are optional steps. If step 305 and step 306 are executed, step 307 may specifically include: B1. The server outputs L numerical values through the first recurrent neural network, and each numerical value is used to represent the weight of a first neural unit among the L first neural units; B2. The server converts the L numerical values into L probability values through a normalized exponential function, and the L probability values correspond to the L first neural units one by one; B3. The server selects a second neural unit from the L first neural units according to the L probability values to implement the function of a neural layer in the third neural network; the server repeatedly executes steps B1, B2 and B3 until a second neural unit is selected from all the neural layers of the H neural layers of the fourth neural network to form a third neural network, and further, each neural layer includes a first neural unit for implementing a unit operation among the L first neural units, where the unit operation refers to an operation with the same output as the output.
[0148] More specifically, since the first recurrent neural network processes sequence data, when the server generates the first neuron layer of the third neural network, it needs to input a digital sequence including S zeros into the first recurrent neural network, where S is a positive integer, so that the first recurrent neural network performs the first cycle and outputs a vector containing L values, each of which represents the weight of a first neural unit, for example (x1, x2, ..., x i , ..., x j), since the values of the L values may not be between 0 and 1, the server inputs the L values into the normalized exponential function respectively, and the normalized exponential function converts the L values into L probability values, and the L probability values represent the selection probabilities of the L first neural units respectively, wherein the specific formula of the normalized exponential function can be as follows:
[0149]
[0150] Among them, P(x i ) represents the L probability values and the weight value x i The corresponding probability value, x i represents any of the L weight values, exp(·) refers to the exponential function with the natural constant e as the base, Represents the operation of each xi in L xi The sum after the operation, the temperature parameter T in the normalized exponential function can be a constant, or the variation rule of the temperature parameter T can be preset on the server. Each time the normalized exponential function is executed, the server changes the value of the temperature parameter T according to the variation rule of the preset temperature parameter T. It should be understood that the above formula is only an example, and the exp(·) in the formula can also be replaced by log(·), or by taking the absolute value, etc., which can be flexibly determined in combination with the actual product form and is not limited here.
[0151] Optionally, the temperature parameter T in the normalized exponential function can change according to the law of the cosine function. As an example, the minimum value of the cosine function is 5, and the maximum value is 15, that is, the value range of T is 5 to 15, and the value of T can be changed from 5 to 15 by 2000 changes; as another example, the minimum value of the cosine function is 6, and the maximum value is 12, that is, the value range of T is 6 to 12, and the value of T can be changed from 6 to 12 by 1000 changes, etc. The examples here are only for the convenience of understanding of this scheme and are not used to limit this scheme. In the embodiment of the present application, the server generates L weight values by using the first recurrent neural network, and converts the L weight values into L probability values by using the normalized exponential function, and then the server can select a second neural unit from the L first neural units according to the L probability values to implement the function of a neuron layer in the third neural network. Through the above method, a specific implementation process of generating the third neural network is provided, which improves the feasibility of the present solution; in addition, since the temperature parameter T in the normalized exponential function is larger, the probability of the first recurrent neural network sampling each first neural unit in the L first neural units will tend to be average, and the third neural network sampled by the server is more random. The larger the temperature parameter T is, the server will generate the third neural network according to the strategy learned by the first recurrent neural network, and T changes according to the law of the cosine function, which can avoid the parameters of the first recurrent neural network from converging to a local optimal value and not jumping out, that is, it is ensured that the last N second neural networks are selected from a large number of first neural networks, rather than from a small number of local first neural networks, thereby ensuring the performance of the N second neural networks.
[0152] After obtaining the L probability values of the L first neural units, the server selects a second neural unit from the L first neural units of the first neural layer of the fourth neural network to implement the function of the first neural unit layer of the third neural network. At this point, the server has executed steps B1, B2 and B3 once.
[0153] When the server is generating the second neural layer of the third neural network, the server first obtains a sequence of S numbers corresponding to the second neural unit selected from the first neural layer, and inputs the sequence of S numbers into the first recurrent neural network. The first recurrent neural network outputs L numerical values, and the L numerical values respectively represent the weights of the L first neural units included in the second neural layer of the fourth neural network. The L numerical values are then converted into L probability values using a normalized exponential function. The server selects a first neural unit from the L first neural units included in the second neural layer of the fourth neural network according to the L probability values to implement the function of the second neural layer of the third neural network. At this point, the server has executed steps B1, B2 and B3 again.
[0154] The difference between the process of the server generating the second layer of the third neural network and the process of generating the first layer of the third neural network is that when the server generates the first layer of the third neural network, the server inputs a sequence including S zeros, and when the server generates the second layer of the third neural network, the server inputs a sequence including S numbers corresponding to the second neural unit selected from the first neuron layer.
[0155] The process of the server generating the third neural network from the third neural network layer to the last neural network layer is similar to the process of the server generating the second neural network layer of the third neural network, which will not be repeated here.
[0156] The server repeatedly executes steps B1, B2 and B3 until a second neural unit is selected from all the neuron layers of the H neuron layers of the fourth neural network to form a third neural network. Specifically, after each execution of steps B1, B2 and B3, the server determines whether a third preset condition is met. If the third preset condition is met, the third neural network is output and step B1 is not repeated. If the third preset condition is not met, step B1 continues to be executed, wherein the third preset condition can be determining whether the number of executions of steps B1, B2 and B3 reaches H times, or determining whether the current execution object is the Hth neuron layer of the fourth neural network, etc., which is not limited here.
[0157] If step 305 and step 306 are not performed, step 307 may specifically include: the server arranges multiple first neural units in a matrix, the matrix composed of multiple first neural units has J columns, each column has K rows, wherein J and K are both positive integers, further, the value of J may be the same as H, the value of K may be the same as L, and of course, they may be different, and are not limited here, the C1 server outputs K numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the K first neural units; the C2 server converts the K numerical values into K probability values through a normalized exponential function, and the K probability values correspond to the K first neural units respectively; the C3 server selects a second neural unit from the K first neural units according to the K probability values to implement the function of a neuron layer in the third neural network; the server repeats steps C1, C2 and C3 until a second neural unit is selected from each of the J columns of first neural units to form a third neural network.
[0158] In an embodiment of the present application, the way in which the server executes steps C1, C2 and C3 is similar to the way in which the server executes steps B1, B2 and B3, with the only difference being that in the process of executing steps B1, B2 and B3, the server selects a second neural unit from L first neural units, and then repeats steps B1, B2 and B3 H times; in the process of executing steps C1, C2 and C3, the server selects a second neural unit from K first neural units, and then repeats steps C1, C2 and C3 J times. The way in which the server executes steps C1, C2 and C3 can refer to the above description of the execution process of steps B1, B2 and B3, which will not be repeated here one by one.
[0159] More specifically, since the server already knows what the feedback function used in the subsequent feedback process is like when using the first recurrent neural network to generate the third network, the feedback functions used in the embodiments of the present application include an annealing feedback function and a non-dominant sorting feedback function, wherein the annealing feedback function is used to guide the first recurrent function to generate the third neural network along a direction from small to large performance parameters. As an example, the first recurrent function first generates a third neural network with a small parameter amount, and then generates a third neural network with a large parameter amount, while the non-dominant sorting feedback function guides the server to evolve from a Pareto front with poor performance to a Pareto front with excellent performance.
[0160] Therefore, if the feedback function used is an annealing feedback function, it is necessary to first perform initial training on the first recurrent neural network so that when the first recurrent function initially generates the probability values of the neural units in the third neural network, in the generated weight values, a higher weight is likely to be given to the neural units with small parameters, thereby guiding the server to generate a smaller number of parameters of the third neural network in the initial stage; if the feedback function used is a non-dominant sorting feedback function, there is no need to perform initial training on the first recurrent neural network.
[0161] 308. The server generates performance information of the third neural network, where the performance information of the first neural network is consistent with the type of information included in the performance indicator of the neural network to be generated.
[0162] In some embodiments of the present application, after acquiring the third neural network, the server can generate performance information of the third neural network based on the performance indicators carried in the customized information, and the performance information of the first neural network is consistent with the type of information included in the performance indicators of the neural network to be generated.
[0163] Specifically, if the performance index does not include the accuracy index of the neural network, but includes any one of the indicators or a combination of multiple indicators such as the parameter amount of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second, after obtaining the third neural network, the server can calculate the parameter amount of the third neural network and the memory size occupied by the neural network, and initialize the third neural network using the fourth neural network that has performed the initial iterative training in step 306, that is, use the parameters of the sub-neural network that has completed the initial iterative training operation to initialize the parameters of the third neural network, and then after the third neural network performs a task once, the processing time of the neural network and the number of floating-point operations per second of the neural network can be obtained.
[0164] If the performance index includes the accuracy index of the neural network, after the server initializes the parameters of the third neural network using the parameters of the sub-neural network that has completed the initial iterative training operation, it can use the second loss function to continue iterative training of the third neural network until the third preset condition is met, specifically, the convergence condition of the second loss function is met, or the number of iterative training of the third neural network reaches the fourth threshold, etc., which is not limited here. And the accuracy of the third neural network in multiple iterative training processes is counted.
[0165] Among them, the second loss function and the first loss function can be the same type of loss function, for example, the first loss function and the second loss function can both be pixel-by-pixel contrast loss functions, the difference is that the convergence condition of the second loss function is more difficult than the convergence condition of the first loss function, for example, the first loss function and the second loss function are both pixel-by-pixel contrast loss functions, when the pixel-by-pixel contrast value between the two images is less than 8, the convergence condition of the first loss function can be met, and when the pixel-by-pixel contrast value between the two images is less than 5, the convergence condition of the second loss function is met, etc. Of course, the first loss function and the second loss function can also use different types of loss functions, for example, the first loss function is a pixel-by-pixel contrast loss function, and the second loss function is a perceptual loss function, etc., which are not limited here.
[0166] In the case of executing step 306, the value of the fourth threshold is much smaller than the value of the second threshold, for example, the value of the fourth threshold may be 50 times, 60 times, 65 times or other values, etc. In the case of not executing step 306, the value of the fourth threshold is relatively large, for example, 1500 times, 2000 times, 2500 times, etc., which is not limited here.
[0167] 309. The server updates the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front.
[0168] In some embodiments of the present application, after obtaining the performance information of the third neural network, the server can update the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front. Wherein, the second neural network is a general concept, which refers to the neural network with the best performance selected from multiple first neural networks (i.e., multiple third neural networks); since the performance index can include at least two indicators, the server cannot judge which second neural network has the best performance from a single dimension, and can only say which second neural networks are the best. As an example, for example, the performance index includes accuracy and parameter quantity, the higher the accuracy, the better, and the smaller the parameter quantity, the better. The accuracy of the third neural network No. 1 is 97%, and the parameter quantity is 30; the accuracy of the third neural network No. 2 is 95%, and the parameter quantity is 10; the accuracy of the third neural network No. 3 is 95%, and the parameter quantity is 13; it can be determined that the performance of the third neural network No. 2 is better than that of the third neural network No. 3, but it is impossible to determine which of the third neural networks No. 1 and No. 2 is the second neural network with the best performance, and it can only be said that the third neural networks No. 1 and No. 2 are the two second neural networks with the best performance. The Pareto front includes all the second neural networks with the best performance. Before the server generates the first third neural network, the current Pareto front is an empty set. It should be understood that the above examples are only for the convenience of understanding this solution and are not used to limit this solution.
[0169] Specifically, when the current Pareto front is an empty set, it can be determined whether at least two performances of the first third neural network meet the requirements of at least two performance indicators in the customized information. As an example, if at least two performance indicators in the customized information have an accuracy rate higher than 95% and a memory size lower than 50M, it is necessary to determine whether the first third neural network has an accuracy rate higher than 95% and a memory size lower than 50M. If so, it is added to the current Pareto front; if not, it is not added to the Pareto front. It should be understood that the aforementioned examples are only for the convenience of understanding the present solution and are not used to limit the present solution.
[0170] When the current Pareto front includes at least one second neural network, it is necessary to compare the performance of a third neural network with the performance of each second neural network in the current Pareto front; if the third neural network is better than any second neural network, the third neural network is added to the current Pareto front, and the second neural network inferior to the third neural network is removed from the current Pareto front; if the third neural network is inferior to any second neural network, the current Pareto front is not updated; if the third neural network is not better than any second neural network and is not inferior to any second neural network, the third neural network is added to the current Pareto front, and no second neural network is removed from the current Pareto front.
[0171] More specifically, the execution order of step 309 is not limited in the embodiment of the present application. The server may perform a current Pareto front update operation once after obtaining the performance information of a third neural network. Then step 309 may be performed before or after any step from step 310 to step 312. Alternatively, after determining that the first preset condition is met, multiple current Pareto front update operations may be performed at one time using the generated multiple first neural networks (i.e., the third neural networks) and the performance information of each third neural network to select the final Pareto front from the multiple first neural networks. Then step 309 needs to be performed between step 310 and step 313.
[0172] 310. The server determines whether the first preset condition is met. If so, the server proceeds to step 313; if not, the server proceeds to step 311.
[0173] In some embodiments of the present application, after the server generates the third neural network through step 307, it can determine whether the first preset condition is met. Specifically, the server can determine whether the first preset condition is met by whether the number of times the third neural network is generated reaches a fourth threshold. If the fourth threshold is reached, it is deemed to satisfy the first preset condition, wherein the value of the fourth threshold can be 6000 times, 5000 times, 7000 times or other numerical values; it can also be determined whether the first recurrent neural network satisfies the convergence condition of the third loss function. If the convergence condition of the third loss function is met, it is deemed to satisfy the first preset condition, wherein the third loss function is a general concept, referring to the loss function used to train the first recurrent neural network, etc. The first preset condition can also be other conditions, etc. The examples given here are only for the convenience of understanding this solution and are not used to limit this solution.
[0174] 311. The server generates a feedback value according to the performance information of the third neural network and the feedback function.
[0175] In some embodiments of the present application, after the server obtains the performance information of the current third neural network, if the server determines that the first preset condition is not met, it is necessary to generate the next third neural network again, and a feedback value can be generated based on the performance information of the current third neural network and a feedback function, wherein the feedback function can be an annealing feedback function or a non-dominant sorting feedback function. When these two feedback functions are used, the entire operation process is different, which are described separately below.
[0176] A. Annealing Feedback Function
[0177] In this embodiment, when the feedback function adopts the annealing feedback function, step 311 may specifically include: the server generates a feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the feedback value may be a positive number, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero or a negative number.
[0178] Specifically, the annealing feedback function may be pre-set with a first performance parameter and a first threshold, wherein the first performance parameter and the second performance parameter are both general concepts, and the information type of the first performance parameter and the second performance parameter are the same, and are any performance indicator other than the accuracy of the neural network, such as the parameter quantity of the neural network, the memory size occupied, the running speed, etc., which are not limited here. The first performance parameter refers to the indicator in the annealing feedback function, the second performance parameter is the actual performance parameter of the third neural network, and the value of the first threshold can be determined in combination with the information type of the first performance parameter and the second performance parameter.
[0179] More specifically, the specific formula of the annealing feedback function can be as follows:
[0180]
[0181] Among them, α represents the third neural network, acc valid (α) represents the accuracy of the third neural network, Is a restriction function, the specific form can be as follows:
[0182]
[0183] Among them, τ represents the first performance parameter, δ represents the first threshold value, and f2(α) represents the second performance parameter. It should be understood that the above formula is only an example. In practice, two restriction functions can also be set in an annealing feedback function, and the first performance parameter in each restriction function is different; and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold value, the feedback value can also be a negative number, which is not limited here.
[0184] After each execution of the annealing feedback function, the server can increase the value of the first performance parameter, that is, increase τ→τ+Δτ, where Δτ is the set step size, and the value of the step size is also determined by combining the information type of the first performance parameter and the second performance parameter. For further understanding of this solution, please refer to Figure 4 , Figure 4 A schematic diagram of a plurality of first neural networks is provided for an embodiment of the present application. Figure 4 The direction of the arrow in the middle refers to the generation direction of the third neural network. Figure 4 The horizontal axis of the coordinate system in represents the second performance parameter of each third neural network, Figure 4 The vertical axis of the coordinate system in represents the accuracy of each third neural network. It is not difficult to see that the server generates multiple third neural networks along the direction of the second performance parameter from small to large. It should be understood that the examples given here are only for the convenience of understanding this solution and are not used to limit this solution.
[0185] B. Non-dominant sorting feedback function
[0186] In this embodiment, when the feedback function adopts a non-dominant sorting feedback function, the server compares the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the third neural network is better than the P second neural networks in the current Pareto front, the server generates a feedback value according to P and the feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the third neural network is worse than the Q second neural networks in the current Pareto front, the server generates a feedback value according to Q and the feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is.
[0187] Specifically, the specific formula of the non-dominant sorting feedback function can be as follows:
[0188]
[0189] Among them, N(P f ) represents the number of the second neural network in the current Pareto front. α>α p It means that α dominates α p , that is, the third neural network is better than the second neural network. >represents the number of second neural networks dominated by the third neural network in the current Pareto front. < Indicates the number of second neural networks that dominate the third neural network. ρ is a preset value, which indicates the number of third neural networks on the Pareto front within a small range near α. It is a density penalty term used to guide the third neural network obtained by the next sampling of the first cycle function away from the third neural network with poor performance.
[0190] The meaning of the non-dominant sorting feedback function is that when the third neural network sampled by the first recurrent neural network is better than the second neural network structure on the current Pareto front, a positive feedback value is given to encourage the first recurrent neural network to sample the next new third neural network close to the current third neural network. When the third neural network sampled by the first recurrent neural network is inferior to the second neural network structure on the current Pareto front, a negative feedback value is given to make the first recurrent neural network sample the next new third neural network far away from the current third neural network. This guides the server to evolve from a Pareto front with poor performance to a Pareto front with good performance.
[0191] For further understanding of this solution, please refer to Figure 5 , Figure 5 A schematic diagram of the current Pareto front is provided for the embodiment of the present application. Figure 5 The direction of the middle arrow refers to the update direction of the Pareto front. Figure 5 The horizontal axis of the coordinate system in represents a performance parameter in the performance index of each third neural network. Figure 4 The vertical axis of the coordinate system in represents the accuracy of each third neural network. It is not difficult to see that under the guidance of the non-dominant sorting feedback function, the server evolves from a Pareto front with poor performance quality to a Pareto front with good performance. It should be understood that the examples here are only for the convenience of understanding this solution and are not used to limit this solution.
[0192] It should be understood that only two feedback functions, namely, the annealing feedback function and the non-dominant sorting feedback function, are exemplified here, and feedback values may also be generated by other feedback functions, which are not specifically limited here.
[0193] 312. The server updates the parameters of the first recurrent neural network according to the feedback value gradient.
[0194] In some embodiments of the present application, after obtaining the feedback value, the server can gradient update the parameters of the first recurrent neural network. Specifically, if the feedback value is a positive number, the gradient value is a positive value; if the feedback value is a negative number, the gradient value is a negative value; if the feedback value is zero, the gradient value is zero.
[0195] More specifically, the server uses an update function to obtain a gradient value based on the feedback value. The update function can be specifically expressed as:
[0196]
[0197] Wherein, θ is the parameter value of any parameter of the first recurrent network, P(θ) is the probability value corresponding to the sampled third neural network, that is, the sum or product of the probability values of each first neural unit in the third neural network, R(α; τ, δ) is the feedback value output by the feedback function, Represents the gradient value. It should be understood that the above example of the formula is only an example. R(α; τ, δ) in the formula can also be replaced by the cube of R(α; τ, δ), which is not limited here.
[0198] The server updates the parameter value of each parameter in the first recurrent network one by one through the update function, and the server can update the parameter value of each parameter in the first recurrent network one by one through the update function to implement gradient update of the parameters of the first recurrent neural network.
[0199] In the embodiment of the present application, the parameters of the first recurrent neural network are updated by a feedback function, that is, the sampling rule of the first recurrent neural network is controlled by a feedback function, thereby avoiding random sampling of the first recurrent neural network and facilitating shortening the time of the Pareto frontier.
[0200] It should be noted that after executing step 312 , the process does not continue to execute step 313 , but re-enters step 307 .
[0201] 313. The server selects N second neural networks from the final Pareto front.
[0202] In some embodiments of the present application, since the final Pareto front includes M second neural networks, the server selects N second neural networks from the M second neural networks, where if the customized information includes an indicator of the number of neural networks, the value of N is determined by the client; if the customized information does not include an indicator of the number of neural networks, the server can independently determine the value of N.
[0203] If the value of M is equal to the value of N, the server selects all the second neural networks in the final Pareto front; if the value of M is greater than the value of N, the server can arbitrarily select N second neural networks from the M second neural networks; the M second neural networks can also be divided into N parts according to a preset rule, and a second neural network can be selected from each part. Specifically, in one implementation, the M second neural networks are sorted in order of parameter quantity from small to large, and the sorted M second neural networks are divided into N parts, and a second neural network with the highest accuracy is selected from each part, and then N second neural networks are obtained from the N parts; in another implementation, the M second neural networks can also be sorted in order from small to large in order of occupied memory, and the sorted M second neural networks are divided into N parts, and a second neural network with the highest accuracy is selected from each part; in one implementation, the M second neural networks can also be sorted in order from short to long in order of neural network processing time, and the sorted M second neural networks are divided into N parts, and a second neural network with the highest accuracy is selected from each part, and so on. Other selection methods are not given examples one by one here.
[0204] 314. The server sends N second neural networks to the client;
[0205] In some embodiments of the present application, after acquiring N second neural networks, the server may send the N second neural networks to the client, and the client receives and displays the N second neural networks. Further, while displaying the N second neural networks, the client may also display the performance information of each second neural network, which is described here by taking a table display as an example, please refer to the following Table 1.
[0206] Neural Networks Accuracy Memory size Neural Network A Ninety-eight percent 28M Neural Network B Ninety-six percent 26M Neural Network C Ninety-five percent 20M
[0207] Table 1
[0208] In Table 1, the value of N is 3, and the performance indicators are accuracy and occupied memory size. Three second neural networks are displayed on the client. The accuracy of neural network A is 98%, and the memory size occupied is 28M; the accuracy of neural network B is 96%, and the memory size occupied is 26M; the accuracy of neural network C is 95%, and the memory size occupied is 20M, so that the user can choose from the above three neural networks. It should be understood that the client can also use line charts, bar charts, etc. to display N second neural networks, which are not limited here.
[0209] 315. The client obtains the neural network selection instruction.
[0210] In some embodiments of the present application, when displaying N second neural networks, the client can obtain a neural network selection instruction input by the user through the display interface of the second neural network, wherein the neural network selection instruction is used for the client to select at least one fifth neural network from the N second neural networks. The fifth neural network is a general concept, which refers to the neural network selected by the user from the N second neural networks, and for the server, it is the neural network that the client wants to use from the N second neural networks.
[0211] Specifically, the user can enter the neural network selection instruction by clicking or pressing the display icon of the second neural network. As an example, if N second neural networks are displayed in the form of a table, the neural network execution command can be entered by pressing or clicking on a data row where a fifth neural network is located; as another example, if N second neural networks are displayed in the form of a bar graph, the user can enter the neural network selection instruction by pressing or clicking on the bar graph. It is also possible to enter the neural network instruction by voice, and as an example in conjunction with Table 1, for example, by voice input "select neural network A" to input the neural network selection instruction, etc., which is not limited here.
[0212] 316. The client generates neural network selection information according to the neural network selection instruction.
[0213] In some embodiments of the present application, after the client selects at least one fifth neural network from N second neural networks according to the neural network selection instruction, the client can generate neural network selection information, wherein the neural network selection information includes identification information of each fifth neural network. In one case, when the server sends N second neural networks to the client, it can assign an identification information to each second neural network, and the client can directly use the identification information assigned by the server. The identification information of each fifth neural network can be a character number corresponding to each fifth neural network. As an example, for example, the number generated according to the generation order of each fifth neural network, such as "0000001", "0000028" or other numbers; as another example, the character number can also be "FY000001", "FL000057" and the like, that is, the character number contains the initials of the functional indicators of the neural network. In another case, if the server does not assign identification information to each second neural network, the neural network selection information can also directly carry each fifth neural network selected by the user, that is, the neural network selection information carries the function corresponding to each fifth neural network, etc. It should be understood that the above examples are only for the convenience of understanding of this solution and are not used to limit this solution.
[0214] 317. The client sends neural network selection information to the server.
[0215] In some embodiments of the present application, after generating the neural network selection information, the client may send the neural network selection information to the server, where the neural network selection information is used to instruct the server to select at least one fifth neural network from N second neural networks and perform iterative training on each fifth neural network in the at least one fifth neural network.
[0216] 318. The server selects at least one fifth neural network from the N second neural networks according to the neural network selection information.
[0217] In some embodiments of the present application, after receiving the neural network selection information, the server can directly obtain at least one fifth neural network from the neural network selection information; or select at least one fifth neural network from N second neural networks based on the identification information carried in the neural network, etc., which is not limited here.
[0218] 319. The server iteratively trains each fifth neural network until the convergence condition of the loss function is met.
[0219] In some embodiments of the present application, after determining at least one fifth neural network, the server needs to perform iterative training on each fifth neural network again until the convergence condition of each fourth loss function is met, wherein the fourth loss function is also a general concept, representing the loss function used when performing iterative training on the fifth neural network selected by the user, and the convergence condition of the fourth loss function is more difficult than the convergence conditions of the first loss function and the second loss function.
[0220] Specifically, if step 302 and step 304 are executed, step 319 includes: the server iteratively trains the fifth neural network using the data set sent by the client; if step 302 and step 304 are not executed, step 319 includes: the server iteratively trains the fifth neural network using the data set collected independently.
[0221] More specifically, the training process of the neural network is also introduced here, where the work of each layer in the deep neural network can be expressed mathematically as To describe: From a physical level, the work of each layer in a deep neural network can be understood as completing the transformation from input space to output space (i.e., from row space to column space of a matrix) through five operations on the input space (a set of input vectors). These five operations include: 1. Dimension increase / reduction; 2. Enlargement / reduction; 3. Rotation; 4. Translation; 5. "Bending". Operations 1, 2, and 3 are represented by Completed, operation 4 is completed by +b, and operation 5 is implemented by a(). The word "space" is used here because the classified object is not a single thing, but a class of things, and space refers to the set of all individuals of this class of things. Among them, W is a weight vector, and each value in the vector represents the weight value of a neuron in this layer of the neural network. The vector W determines the spatial transformation from the input space to the output space described above, that is, the weight W of each layer controls how to transform the space. The purpose of training a deep neural network is to eventually obtain the weight matrix of all layers of the trained neural network (the weight matrix formed by many layers of vectors W). Therefore, the training process of a neural network is essentially to learn how to control spatial transformation, and more specifically to learn the weight matrix.
[0222] Because we want the output of the deep neural network to be as close as possible to the value we really want to predict, we can compare the current network's predicted value with the target value we really want, and then update the weight vector of each layer of the neural network based on the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the network's predicted value is high, adjust the weight vector to make it predict a lower value, and keep adjusting until the neural network can predict the target value we really want. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.
[0223] 320. The server sends at least one fifth neural network that has completed the iterative training operation to the client.
[0224] In some embodiments of the present application, after completing iterative training of each fifth neural network, the server sends at least one fifth neural network that has completed the iterative training operation to the client, that is, sends at least one fifth neural network that has been trained to maturity to the client, and then the client can directly run each fifth neural network on the terminal device where the client is located, and can also forward each fifth neural network to other application devices to run the fifth neural network on other application devices.
[0225] In an embodiment of the present application, after the server sends N second neural networks to the client, the client can select at least one fifth neural network from the N second neural networks, and then after the server iteratively trains the at least one fifth neural network selected by the client, it sends the at least one fifth neural network that has completed the iterative training operation to the client, so that the server performs the iterative training operation more specifically and avoids the waste of computer resources.
[0226] In an embodiment of the present application, a server receives customized information sent by a client, wherein the customized information includes functional indicators and performance indicators of a neural network to be generated. The server can determine the type of the neural network to be generated based on the functional indicators of the neural network, that is, it can generate multiple first neural networks that meet the functional indicators, and then select N second neural networks from the multiple first neural networks based on the performance indicators of the neural network, each second neural network is a neural network that meets the performance indicators, thereby providing a customized solution for neural networks; in addition, with the continuous development of artificial intelligence, the forms of neural network operating devices are increasing. The performance indicators in this case include any one or more combinations of indicators including the number of neurons, the accuracy of the neural network, the size of the memory occupied by the neural network, or the processing time of the neural network. Therefore, the client can determine which of the above indicators the performance indicators are based on the specific form of the neural network operating device, thereby facilitating the expansion of the application scenarios of the present solution.
[0227] 2. Directly generate N second neural networks
[0228] In the present application, please refer to Figure 6 , Figure 6 A flowchart of a neural network processing method provided in an embodiment of the present application is provided. The neural network processing method provided in an embodiment of the present application may include:
[0229] 601. The client obtains customized information, where the customized information includes functional indicators of the neural network and performance indicators of the neural network.
[0230] 602. The client obtains a data set.
[0231] 603. The client sends customized information to the server.
[0232] 604. The client sends a data set to the server.
[0233] In the embodiment of the present application, the specific implementation method of step 601 to step 604 is the same as Figure 3 Steps 301 to 304 in the corresponding embodiment are similar, and can be referred to for details. Figure 3 The description in the corresponding embodiment will not be repeated here.
[0234] 605. The server generates N second neural networks according to the functional indicators and performance indicators.
[0235] In one case, the server can use the first recurrent neural network to directly generate N second neural networks based on multiple first neural units according to the functional indicators and performance indicators in the customized information, and if the performance indicators in the customized information are one or at least two, the server can use the first recurrent neural network to directly generate N second neural networks based on the multiple first neural units. Specifically, after obtaining the performance indicators in the customized information, the server can iteratively train the first recurrent neural network with the performance indicators as the target until the first recurrent neural network is trained to be a mature neural network, and then directly use the maturely trained first recurrent neural network to sample the multiple first neural units to generate N second neural networks.
[0236] In another case, the performance indicator in the customized information can be one, and the server can also generate the second neural network not through the first recurrent neural network, but with one functional target and one performance indicator as the target, directly select the neural unit used to form the second neural network from multiple first neural units, and then generate N second neural networks. As an example, for example, the functional indicator is image recognition, and only the parameter amount of the neural network in the performance indicator is less than 50, and multiple first neural units are arranged in a matrix, and the matrix composed of multiple first neural units has J columns, and each column has K rows. For each column in the J columns, the server can select the first neural unit with the least parameter amount from the K rows to form the second neural network. It should be noted that the generated second neural network still needs to meet the requirements of the functional indicator, that is, even if the parameter amount is to be as much as possible, there must be a convolution layer in the final second neural network; as another example, for example, the functional indicator is text translation, and only the memory usage is less than 20M in the performance indicator, then as many unit operation layers as possible can be selected. It should be understood that the examples here are only used to prove the feasibility of this solution, and are not used to limit this solution.
[0237] 606. The server sends the N second neural networks to the client.
[0238] 607. The client obtains a neural network selection instruction.
[0239] 608. The client generates neural network selection information according to the neural network selection instruction.
[0240] 609. The client sends neural network selection information to the server.
[0241] 610. The server selects at least one fifth neural network from the N second neural networks according to the neural network selection information.
[0242] 611. The server iteratively trains each fifth neural network until a convergence condition of the loss function is met.
[0243] 612. The server sends at least one fifth neural network that has completed the iterative training operation to the client.
[0244] In the embodiment of the present application, the specific implementation method of step 606 to step 612 is the same as Figure 3 Steps 316 to 320 in the corresponding embodiment are similar, and can be referred to for details. Figure 3 The description in the corresponding embodiment will not be repeated here.
[0245] The following is a specific example to illustrate the neural network processing method provided by the embodiment of the present application. In this embodiment, the function index is image recognition, the performance index is that the accuracy of the neural network is higher than 90%, the number of parameters of the neural network is less than 50, and the number of neural networks is 50. The feedback function uses the annealing feedback function as an example. For details, please refer to Figure 7 , Figure 7 A schematic diagram of a process for generating a final Pareto frontier by a neural network processing method server provided in an embodiment of the present application, the method may include:
[0246] S1. The server receives the customized information sent by the client.
[0247] In this embodiment, in the customized information sent by the client to the server, the functional indicator of the neural network is image recognition, and the performance indicators are that the accuracy of the neural network is higher than 90%, and the number of parameters of the neural network is less than two million.
[0248] S2. The server generates a fourth neural network, which includes multiple first neural units.
[0249] In this embodiment, the client generates a fourth neural network including multiple first neural units. The fourth neural network is a 12-layer convolutional neural network, each layer has 5 first neural units, namely 3×3 convolutional layer, 5×5 convolutional layer, average pooling layer, maximum pooling layer and unit operation layer. The server records these 5 first neural units as (0, 1, 2, 3, 4). The parameters of all first neural units in the fourth neural network are randomly initialized (for the first neural units with parameters), and a first recurrent neural network is generated.
[0250] S3. The server performs initial iterative training on the fourth neural network.
[0251] In this embodiment, the server randomly selects a first neural unit from the operation in each layer of the fourth neural network. For example, the first layer selects 0, the second layer selects 3... until the 12th layer forms a sub-neural network (0, 3, 4, 2, 3, 1, 2, 3, 1, 0, 4, 2), calculates the first loss function of the sub-neural network, and calculates the gradient value according to the first loss function value, and updates the parameters of each neural unit in the sub-neural network using the stochastic gradient descent method, repeats this step 2000 times, and obtains the parameters of each neural unit in the sub-neural network after the initial iterative training.
[0252] S4. The server uses the first recurrent neural network to generate a third neural network based on multiple first neural units.
[0253] In this embodiment, since the annealing feedback function is used in this embodiment, the server needs to pre-train the first recurrent neural network after initializing the parameters of the first recurrent neural network, so that when the first recurrent neural network initially generates the probability values of the neural units in the third neural network, the generated weight values are likely to give higher weights to the neural units with small parameters. After pre-training the first recurrent neural network, a digital sequence of S zeros is input into the first recurrent neural network. The first recurrent neural network outputs 5 weight values, which are then converted into 5 probability values by a normalization function. The server selects a first neural unit from the 5 first neural units of the first layer based on the 5 probability values. Here, the first layer is taken as an example to select 0 to implement the function of the first neuron layer of the third neural network layer. The server needs to obtain a digital sequence consisting of S numbers corresponding to 0 and input it into the first recurrent neural network again. The first recurrent neural network outputs 5 weight values, which are then converted into 5 probability values by a normalization function. The server selects a first neural unit from the second layer of the fourth neural network based on the 5 probability values, and repeats the above steps until a first neural unit is selected from each of the 12 layers of the fourth neural network to form a third neural network. Here, the third neural network is taken as (1, 3, 4, 0, 3, 1, 2, 3, 1, 0, 4, 2) as an example.
[0254] S5. The server generates performance information of the third neural network.
[0255] In this embodiment, after generating the third neural network, the server needs to generate the parameters of the third neural network, and use the parameters of each neural unit in the sub-neural network after the initial iterative training to initialize the parameters of each neural unit of the third neural network. Then, the second loss function can be used to continue to iteratively train the third neural network 50 times, and the accuracy of the third neural network is counted. Here, the example of the third neural network with 800,000 parameters and an accuracy of 91% is taken.
[0256] S6. The server determines whether the execution times of step S4 and step S5 have reached 6000 times. If so, it proceeds to step S10; if not, it proceeds to step S7.
[0257] S7. The server generates a feedback value according to the performance information of the third neural network and the annealing feedback function.
[0258] In this embodiment, the server generates a feedback value based on the parameter quantity of the third neural network, the accuracy rate of 91%, and the annealing feedback function, wherein the information type of the first performance parameter of the annealing feedback function is the parameter quantity, the value of the first performance parameter is 500,000, and the first threshold is 400,000.
[0259] Enter the above values into The feedback value obtained is 0.2275.
[0260] S8. The server increases the value of the first performance parameter.
[0261] In this embodiment, the server increases the first performance parameter from 500,000 to 550,000, that is, the growth step is 50,000, so that the first performance parameter in the annealing feedback function is a parameter that changes slowly from small to large.
[0262] S9. The server updates the parameters of the first recurrent neural network according to the feedback value gradient.
[0263] In this embodiment, after using the feedback value to update the parameters of the first recurrent neural network, the server re-enters step S4 to continue generating a new third neural network. Since the feedback value is positive, the new third neural network generated by the server is similar to (1, 3, 4, 0, 3, 1, 2, 3, 1, 0, 4, 2).
[0264] S10. The server generates the final Pareto front.
[0265] In this embodiment, after the server determines whether the number of executions of step S4 and step S5 reaches 6000 times, the server can generate a final Pareto front based on the 6000 third neural networks generated 6000 times and the performance information of each third neural network, and then select 50 second neural networks from the final Pareto front to send to the client. It should be understood that all examples in this embodiment are only for the convenience of understanding this solution and are not used to limit this solution.
[0266] In order to have a further understanding of the beneficial effects brought about by the present application, the beneficial effects brought about by the Pareto front generation method adopted in the present solution are further demonstrated in combination with experimental data below, please refer to the following Table 2.
[0267] Adoption Method Processing time (days) Parameter quantity (million) Accuracy ENAS 0.32 38 96.13 DPP-NET-PANS 8 11.39 95.64 This program 2.33 7.74 96.14
[0268] Table 2
[0269] Please refer to Table 2, which shows the time for obtaining the Pareto front by three methods, wherein the first row shows the time for generating a second neural network in the Pareto front by ENAS (Effective Neural Architecture Search), the parameter amount and accuracy of the second neural network; the second and third rows respectively show the time for generating all second neural networks on the Pareto front by DPP-NET-PANS (Device-related Pareto Optimal Progressive Neural Network Architecture Search) and this scheme, as well as the average parameter amount and average accuracy of all second neural networks in the Pareto front. From the comparison in Table 2, it can be seen that the method provided by this scheme, under the premise of high accuracy, obtains a small amount of parameters of the second neural network, and the overall time used to generate the Pareto front is relatively short.
[0270] The present application also provides a neural network processing method. Figure 8 , Figure 8 A flowchart of a neural network processing method provided in an embodiment of the present application, the method may include:
[0271] 801. The neural network processing device obtains the function index of the neural network and the performance index of the neural network.
[0272] In one case, the neural network processing device can obtain the function index and performance index of the neural network from the client, and the specific implementation steps are as follows: Figure 3 Similar to step 303 in the corresponding embodiment, the specific implementation of step 801 can be found in Figure 3 The description of step 303 is not repeated here; in another case, when the neural network processing device wants to autonomously generate the first neural network, it can also autonomously generate the functional indicators of the neural network and the performance indicators of the neural network, etc., which are not limited here.
[0273] 802. The neural network processing device obtains a fourth neural network, where the fourth neural network includes a plurality of first neural units.
[0274] 803. The neural network processing device performs initial iterative training on the fourth neural network.
[0275] 804. The neural network processing device generates a first neural network based on a plurality of first neural units using the first recurrent neural network.
[0276] 805. The neural network processing device generates performance information of the first neural network, and the performance information of the first neural network is consistent with the type of information included in the performance index of the neural network to be generated.
[0277] 806. The neural network processing device updates the current Pareto front by comparing the performance of the first neural network with the performance of each second neural network in the current Pareto front.
[0278] 807. The neural network processing device determines whether the first preset condition is met. If so, it proceeds to step 810; if not, it proceeds to step 808.
[0279] 808. The neural network processing device generates a feedback value according to the performance information of the first neural network and the feedback function.
[0280] 809. The neural network processing device updates the parameters of the first recurrent neural network according to the feedback value gradient.
[0281] In the embodiment of the present application, steps 802 to 809 are Figure 3 The corresponding embodiment of step 305 to step 312 is similar, and the specific implementation of step 802 to step 809 can be referred to. Figure 3 The descriptions of steps 305 to 312 are not repeated here.
[0282] 810. The neural network processing device generates a final Pareto front.
[0283] In the embodiment of the present application, when the server determines that the first preset condition is met, the current Pareto front obtained in step 806 can be determined as the final Pareto front. Through the above scheme, the parameters of the first recurrent neural network are updated through the feedback function, that is, the sampling rule of the first recurrent neural network is controlled through the feedback function, which avoids random sampling of the first recurrent neural network, which is conducive to shortening the time of the Pareto front.
[0284] 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 diagram of a server provided for an embodiment of the present application. The server 900 may include a receiving unit 901, a selecting unit 902, and a sending unit 903, wherein the receiving unit 901 is used to receive customized information sent by the client, wherein the customized information includes the functional index of the neural network and the performance index of the neural network, wherein the functional index is used for the server 900 to determine the general capability of the neural network, and the performance index includes any one of the indicators or a combination of multiple indicators such as the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; the selecting unit 902 is used to select N second neural networks from multiple first neural networks with the performance index of the neural network as the target, wherein the multiple first neural networks are generated by the server 900 according to the functional index and the performance index, wherein the function of each first neural network meets the requirements of the functional index, N is a positive integer, and the performance of each second neural network meets the requirements of the performance index; the sending unit 903 is used to send the N second neural networks to the client.
[0285] In an embodiment of the present application, a receiving unit 901 receives customized information sent by a client, wherein the customized information includes functional indicators and performance indicators of a neural network to be generated. A selecting unit 902 can determine the type of the neural network to be generated according to the functional indicators of the neural network, that is, multiple first neural networks that meet the functional indicators can be generated, and then N second neural networks can be selected from the multiple first neural networks according to the performance indicators of the neural network, and each second neural network is a neural network that meets the performance indicators, thereby providing a customized solution for a neural network; in addition, with the continuous development of artificial intelligence, the forms of neural network operating devices are increasing. The performance indicators in this case include any one or more combinations of indicators including the number of neurons, the accuracy of the neural network, the size of the memory occupied by the neural network, or the processing time of the neural network, so that the client can determine which of the above indicators the performance indicators are according to the specific form of the neural network operating device, thereby facilitating the expansion of the application scenarios of the present solution.
[0286] In one possible design, the customization information also includes an indicator of the number of neural networks, and the indicator of the number is N. The selection unit 902 is specifically used to: select a final Pareto front from multiple first neural networks with the performance indicator of the neural network as a target, and the final Pareto front includes M second neural networks, where M is a positive integer and M is greater than or equal to N; select N second neural networks from the M second neural networks.
[0287] In the embodiments of the present application, users can not only customize the functions and performance of the neural network, but also customize the number of desired neural networks, which further improves the customization accuracy of the neural network and is conducive to enhancing customer stickiness.
[0288] In one possible design, see Fig.10 , Fig.10 A structural diagram of a server provided in an embodiment of the present application, the server 900 also includes: a generating unit 904, which is used to generate a third neural network based on multiple first neural units using the first recurrent neural network, the third neural network is a neural network among the multiple first neural networks, the third neural network includes at least one second neural unit, and the at least one second neural unit is included in the multiple first neural units; the selecting unit 902 is specifically used to: generate performance information of the third neural network, the performance information of the third neural network is consistent with the type of information included in the performance index of the neural network; update the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front; generate a feedback value based on the performance information of the third neural network and the feedback function; update the parameters of the first recurrent neural network according to the feedback value gradient.
[0289] In the embodiment of the present application, the parameters of the first recurrent neural network are updated by a feedback function, that is, the sampling rule of the first recurrent neural network is controlled by a feedback function, thereby avoiding random sampling of the first recurrent neural network and facilitating shortening the time of the Pareto frontier.
[0290] In one possible design, see Fig.10 The server 900 further includes: an acquisition unit 905, used to acquire a fourth neural network, wherein the fourth neural network includes a plurality of first neural units; a training unit 906, used to perform initial iterative training on the fourth neural network, wherein the fourth neural network that has undergone initial iterative training is used to initialize the third neural network; and a generation unit 904 is specifically used to generate a third neural network according to the plurality of first neural units in the fourth neural network that has undergone initial iterative training.
[0291] In the embodiment of the present application, since the parameter indicators of the neural network generally include the accuracy indicator of the neural network, when the selection unit 902 performs statistics on the accuracy of the third neural network, it is necessary to first perform iterative training on the third neural network, and then start to count the accuracy of the third neural network. If the parameters of the third neural network are randomly initialized (that is, the parameters of the fourth neural network are not trained in advance), and then the third neural network is iteratively trained to obtain the accuracy of the third neural network, the statistical time of the accuracy of the entire third neural network will be longer, and the generation unit 904 needs to generate multiple third neural networks, each of which must be trained from a randomly initialized state to a relatively mature state, which will cause the entire training time to be particularly long. In the above manner, the fourth neural network is firstly subjected to initial iterative training, and then the fourth neural network that has performed the initial iterative training is used to initialize the third neural network, which will greatly shorten the training time of each third neural network, thereby improving the efficiency of the neural network customization process in this solution.
[0292] In one possible design, the fourth neural network includes multiple neuron layers, each neuron layer includes L first neural units, where L is a positive integer; the generation unit 904 is specifically used to: output L numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the L first neural units; convert the L numerical values into L probability values through a normalized exponential function, the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; according to the L probability values, select a second neural unit from the L first neural units to implement the function of a neuron layer in the third neural network.
[0293] In the embodiment of the present application, a specific implementation process of generating the third neural network is provided, which improves the feasibility of the present solution; in addition, since the larger the temperature parameter T in the normalized exponential function, the probability that the first recurrent neural network samples each of the L first neural units will tend to be averaged, the more random the third neural network sampled by the generation unit 904 will be. The larger the temperature parameter T, the more the generation unit 904 will generate the third neural network according to the strategy learned by the first recurrent neural network, and T changes according to the law of the cosine function, which can avoid the parameters of the first recurrent neural network from converging to a local optimal value and not being able to jump out, that is, it is ensured that the last N second neural networks are selected from a large number of first neural networks, rather than from a small number of local first neural networks, thereby ensuring the performance of the N second neural networks.
[0294] In one possible design, see Fig.10, a first performance parameter and a first threshold are pre-set in the feedback function, the first performance parameter is any indicator in the performance indicators except the accuracy of the neural network; the generating unit 904 is specifically used to: generate a feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; the server 900 also includes: an increasing unit 907, used to increase the first performance parameter.
[0295] In one possible design, the generating unit 904 is specifically used to: compare the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the third neural network is better than the P second neural networks in the current Pareto front, generate a feedback value according to P and a feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the third neural network is worse than the Q second neural networks in the current Pareto front, generate a feedback value according to Q and a feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is.
[0296] In the embodiment of the present application, when the third neural network sampled by the first recurrent neural network is better than the second neural network structure on the current Pareto front, a positive feedback value is given to encourage the first recurrent neural network to sample the next new third neural network close to the current third neural network; when the third neural network sampled by the first recurrent neural network is worse than the second neural network structure on the current Pareto front, a negative feedback value is given to enable the first recurrent neural network to sample the next new third neural network far away from the current third neural network. Thus, the selection unit 902 can achieve the evolution from a Pareto front with poor performance to a Pareto front with excellent performance.
[0297] In one possible design, see Fig.10 The receiving unit 901 is further used to receive the neural network selection information sent by the client; the selecting unit 902 is further used to select at least one fifth neural network from the N second neural networks according to the neural network selection information; the server 900 also includes: a training unit 906, used to iteratively train each fifth neural network until the convergence condition of the loss function is met; and a sending unit 903, used to send at least one fifth neural network that has completed the iterative training operation to the client.
[0298] In the embodiment of the present application, after the sending unit 903 sends the N second neural networks to the client, the receiving unit 901 can select at least one fifth neural network from the N second neural networks according to the neural network selection information sent by the client, and then after the training unit 906 iteratively trains the at least one fifth neural network selected by the client, the sending unit 903 sends the at least one fifth neural network that has completed the iterative training operation to the client, so that the server performs the iterative training operation more specifically and avoids the waste of computer resources.
[0299] In one possible design, the receiving unit 901 is also used to receive a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0300] In the embodiment of the present application, compared with the server autonomously acquiring a data set according to the functional objectives of the neural network, the receiving unit 901 receives the data set sent by the client when performing iterative training operations on the neural network, which makes the iterative training process of the neural network more targeted, thereby increasing the accuracy of the neural network after iterative training.
[0301] It should be noted that the information interaction, execution process, etc. between the modules / units in the server 900 are the same as those in the present application. Figure 3 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.
[0302] The present application embodiment also provides another server, see Fig.11 , Fig.11 A structural diagram of a server provided in an embodiment of the present application, the server 1100 includes: a receiving unit 1101, a generating unit 1102 and a sending unit 1103, wherein the receiving unit 1101 is used to receive customized information sent by the client, the customized information includes functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second. Any one indicator or a combination of multiple indicators; the generating unit 1102 is used to generate N second neural networks according to the functional indicators and the performance indicators; the sending unit 1103 is used to send the N second neural networks to the client.
[0303] In a possible design, the customization information also includes an index of the number of neural networks, where the index is N.
[0304] In one possible design, the receiving unit 1101 is further used to receive neural network selection information sent by the client; the selecting unit 1104 is further used to select at least one fifth neural network from the N second neural networks according to the neural network selection information; the server also includes: a training unit 1105, used to iteratively train each fifth neural network until the convergence condition of the loss function is met; and a sending unit 1103, used to send at least one fifth neural network that has completed the iterative training operation to the client.
[0305] In one possible design, the receiving unit 1101 is also used to receive a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0306] It should be noted that the information interaction, execution process, etc. between the modules / units in the server 1100 are the same as those in the present application. Figure 6 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.
[0307] The present application also provides a communication device. Fig.12 , Fig.12 A schematic diagram of a structure of a communication device provided in an embodiment of the present application, wherein the communication device 1200 is deployed with Figure 6 Corresponding to the client in the embodiment, the communication device 1200 may include: an acquisition unit 1201, a sending unit 1202 and a receiving unit 1203, wherein the acquisition unit 1201 is used to acquire customized information, the customized information includes functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or any one or more indicators in the number of floating-point operations per second; the sending unit 1202 is used to send customized information to the server, the customized information is used for the server to obtain N second neural networks according to the customized information, wherein N is a positive integer, the function of each second neural network meets the requirements of the functional indicators, and the performance of each second neural network meets the requirements of the performance indicators; the receiving unit 1203 is used to receive the N second neural networks sent by the server.
[0308] In an embodiment of the present application, after the acquisition unit 1201 acquires the customized information entered by the user, the sending unit 1202 sends the customized information to the server, and the customized information includes the functional indicators and performance indicators of the neural network to be generated, so that the receiving unit 1203 can receive N second neural networks, each of which is a neural network that meets the performance indicators. In the above manner, a customized solution for neural networks is provided; in addition, with the continuous development of artificial intelligence, the forms of neural network operating devices are increasing. The performance indicators in this case include any one or more combinations of indicators including the number of neurons, the accuracy of the neural network, the memory size occupied by the neural network, or the processing time of the neural network. Therefore, the client can determine which of the above indicators the performance indicators are based on the specific form of the neural network operating device, which is conducive to expanding the application scenarios of this solution.
[0309] In a possible design, the customization information also includes an indicator of the number of neural networks, which is N. The indicator of the number of neural networks is used by the server to determine the number of second neural networks to be sent to the client.
[0310] In the embodiments of the present application, users can not only customize the functions and performance of the neural network, but also customize the number of desired neural networks, which further improves the customization accuracy of the neural network and is conducive to enhancing customer stickiness.
[0311] In one possible design, the acquisition unit 1201 is further used to acquire a neural network selection instruction, where the neural network selection instruction is used for the client to select at least one fifth neural network from N second neural networks; the communication device also includes: a generation unit 1204, used to generate neural network selection information according to the neural network selection instruction, where the neural network selection information is used to instruct the server to iteratively train each fifth neural network in at least one fifth neural network; the sending unit 1202 is further used to send the neural network selection information to the server; and the receiving unit 1203 is further used to receive at least one fifth neural network that has completed the iterative training operation and sent by the server.
[0312] In the embodiment of the present application, the acquisition unit 1201 can receive a neural network selection instruction from a user to select at least one fifth neural network from N second neural networks, and the sending unit 1202 sends the neural network selection information used to instruct the server to perform iterative training on each fifth neural network in the at least one fifth neural network to the server, so that the receiving unit 1203 can receive at least one fifth neural network that has completed the iterative training operation, so that the server can perform the iterative training operation more specifically and avoid wasting computer resources.
[0313] In one possible design, the sending unit 1202 is also used to send a data set to the server, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
[0314] In the embodiment of the present application, compared with the server autonomously acquiring the data set according to the functional objectives of the neural network, the sending unit 1202 sends the data set when performing iterative training operations on the neural network to the server, which makes the iterative training process of the neural network more targeted, thereby increasing the accuracy of the neural network after iterative training.
[0315] It should be noted that the information interaction, execution process, etc. between the modules / units in the communication device 1200 are the same as those in the present application. Figure 6 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.
[0316] The present application also provides a neural network processing device. Fig.13 , Fig.13A schematic diagram of the structure of a neural network processing device provided in an embodiment of the present application, the neural network processing device 1300 may include: an acquisition unit 1301, a generation unit 1302 and an update unit 1303, wherein the acquisition unit 1301 is used to acquire functional indicators of the neural network and performance indicators of the neural network, the functional indicators are used for the server to determine the general capabilities of the neural network, and the performance indicators include the accuracy of the neural network, the number of parameters of the neural network, the memory size occupied by the neural network, the processing time of the neural network, or any one or more combinations of the number of floating-point operations per second; the generation unit 1302 is used to generate a first neural network based on a plurality of first neural units using a first recurrent neural network, the function of the first neural network meets the requirements of the functional indicators, the first neural network includes at least one second neural unit, and the at least one second neural unit is included in the plurality of first neural units; the generation unit Element 1302 is also used for the server to generate performance information of the first neural network, and the performance information of the first neural network is consistent with the type of information included in the performance index of the neural network to be generated; the updating unit 1303 is also used to update the current Pareto front by comparing the performance of the first neural network with the performance of each second neural network in the current Pareto front, wherein the performance of each second neural network meets the requirements of the performance index; the generating unit 1302 is also used to generate a feedback value according to the performance information of the first neural network and the feedback function; the updating unit 1303 is also used to update the parameters of the first recurrent neural network according to the feedback value gradient; the generating unit 1302 and the updating unit 1303 repeatedly perform the above-mentioned first neural network generating operation, the first neural network performance information generating operation, the current Pareto front updating operation and the first recurrent neural network parameter updating operation until the final Pareto front is generated.
[0317] In one possible design, the acquisition unit 1301 is also used to acquire a fourth neural network, which includes multiple first neural units. The neural network processing device also includes: a training unit 1304, which is used to perform initial iterative training on the fourth neural network, wherein the fourth neural network that has performed the initial iterative training is used to initialize the third neural network; the generation unit 1302 is specifically used to generate the third neural network according to the multiple first neural units in the fourth neural network that has performed the initial iterative training.
[0318] In one possible design, the fourth neural network includes multiple neuron layers, each neuron layer includes L first neural units, where L is a positive integer; the generation unit 1302 is specifically used to: output L numerical values through the first recurrent neural network, each numerical value is used to represent the weight of a first neural unit among the L first neural units; convert the L numerical values into L probability values through a normalized exponential function, the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; according to the L probability values, select a second neural unit from the L first neural units to implement the function of a neuron layer in the third neural network.
[0319] In a possible design, a first performance parameter and a first threshold are pre-set in the feedback function, and the first performance parameter is any indicator in the performance indicators except the accuracy of the neural network; the generation unit 1302 is specifically used to: generate a feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; the server also includes: an increasing unit, used to increase the first performance parameter.
[0320] In one possible design, the generating unit 1302 is specifically used to: compare the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; when the performance of the third neural network is better than P second neural networks in the current Pareto front, generate a feedback value according to P and a feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger P is, the larger the feedback value is; when the performance of the third neural network is worse than Q second neural networks in the current Pareto front, generate a feedback value according to Q and a feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger Q is, the smaller the feedback value is.
[0321] It should be noted that the information interaction, execution process, etc. between the modules / units in the neural network processing device 1300 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.
[0322] The present application also provides a server. Fig.14 , Fig.14 This is a schematic diagram of a structure of a server provided in an embodiment of the present application. The server 1400 may be deployed with Fig. 9 and Fig.10 The server 900 described in the corresponding embodiment is used to implement Fig. 9 and Fig.10 The functions of the server 900 in the corresponding embodiment, or the server 1400 may be deployed with Fig.11 The server 1100 described in the corresponding embodiment is used to implement Fig.11 The functions of the server 1100 in the corresponding embodiment, or the server 1400 may be deployed with Fig.13 The neural network processing device 1300 described in the corresponding embodiment is used to implement Fig.13 The function of the neural network processing device 1300 in the corresponding embodiment. Specifically, the server 1400 is implemented by one or more servers. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1422 (for example, one or more processors) and memory 1432, one or more storage media 1430 (for example, one or more mass storage devices) storing application programs 1442 or data 1444. Among them, the memory 1432 and the storage medium 1430 can be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processor 1422 can be configured to communicate with the storage medium 1430 and execute a series of instruction operations in the storage medium 1430 on the server 1400.
[0323] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0324] In the embodiment of the present application, the central processor 1422 is used to execute Figure 3 The neural network processing method executed by the server in the corresponding embodiment, or for executing Figure 6 The neural network processing method executed by the server in the corresponding embodiment, or for executing Figure 8 The neural network processing method executed by the neural network processing device in the corresponding embodiment. It should be noted that the specific implementation of the neural network processing method executed by the central processor 1422 can refer to Figure 3 , Figure 6 as well as Figure 8 The descriptions in the corresponding method embodiments will not be repeated here one by one.
[0325] The present application also provides a communication device. Fig.15 , Fig.15 A schematic diagram of a structure of a communication device provided in an embodiment of the present application, wherein the communication device 1500 may be deployed with Fig.12 The communication device 1200 described in the corresponding embodiment is used to implement Fig.12 The functions of the communication device 1200 in the corresponding embodiment. Specifically, the communication device 1500 includes: a receiver 1501, a transmitter 1502, a processor 1503 and a memory 1504 (wherein the number of the processor 1503 in the communication device 1500 can be one or more, Fig.15 In the example of FIG. 1501 , the processor 1503 may include an application processor 15031 and a communication processor 15032. In some embodiments of the present application, the receiver 1501, the transmitter 1502, the processor 1503 and the memory 1504 may be connected via a bus or other means.
[0326] The memory 1504 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1503. A portion of the memory 1504 may also include a non-volatile random access memory (NVRAM). The memory 1504 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.
[0327] The processor 1503 controls the operation of the communication device. In a specific application, the various components of the communication 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.
[0328] The method disclosed in the above embodiment of the present application can be applied to the processor 1503, or implemented by the processor 1503. The processor 1503 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 1503. The above processor 1503 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 1503 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 1504, and the processor 1503 reads the information in the memory 1504 and completes the steps of the above method in combination with its hardware.
[0329] The receiver 1501 can be used to receive input digital or character information and generate signal input related to the relevant settings and function control of the communication device. The transmitter 1502 can be used to output digital or character information through the first interface; the transmitter 1502 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 1502 can also include a display device such as a display screen.
[0330] In the embodiment of the present application, the application processor 15031 is used to execute Figure 3 The neural network processing method executed by the client in the corresponding embodiment, or for executing Figure 6 The neural network processing method executed by the client in the corresponding embodiment. It should be noted that the specific implementation of the neural network processing method executed by the application processor 15031 can refer to Figure 3 and Figure 6 The descriptions in the corresponding method embodiments will not be repeated here one by one.
[0331] The present application also provides a computer program product which, when executed on a computer, enables the computer to execute the above Figures 3 to 5 The steps performed by the server in the method described in the embodiment shown, or the steps to enable the computer to perform the above Figure 6 The steps performed by the server in the method described in the embodiment shown, or the steps to enable the computer to perform the above Figure 8 The illustrated embodiment describes the steps performed by the server in the method.
[0332] The present application also provides a computer program product which, when executed on a computer, enables the computer to execute the above Figures 3 to 5 The steps performed by the client in the method described in the embodiment shown, or causing the computer to perform the above Figure 6 The illustrated embodiment describes the steps performed by the client in the method.
[0333] 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 Figures 3 to 5 The steps performed by the server in the method described in the embodiment shown, or the steps to enable the computer to perform the above Figure 6 The steps performed by the server in the method described in the embodiment shown, or the steps to enable the computer to perform the above Figure 8 The illustrated embodiment describes the steps performed by the server in the method.
[0334] 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 Figures 3 to 5 The steps performed by the client in the method described in the embodiment shown, or causing the computer to perform the above Figure 6 The illustrated embodiment describes the steps performed by the client in the method.
[0335] The execution device, training device, terminal device or communication device provided in the embodiment of the present application may be a chip, which includes: a processing unit and a communication unit. The processing unit may be a processor, and the communication unit may be an input / output interface, a pin or a circuit. The processing unit may execute the computer execution instructions stored in the storage unit to enable the chip in the server to execute the above Figures 3 to 5 The neural network processing method described in the embodiment shown in the figure, or, to enable the chip in the server to execute the above Figure 6 The neural network processing method described in the embodiment shown in the figure, or, to enable the chip in the server to execute the above Figure 8The neural network processing method 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.
[0336] For details, please refer to Fig.16 , Fig.16 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 160, NPU 160 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 160, and the controller 1604 controls the operation circuit 1603 to extract matrix data in the memory and perform multiplication operations.
[0337] In some implementations, the operation circuit 1603 includes multiple processing units (Process Engine, PE) inside. In some implementations, the operation circuit 1603 is a two-dimensional systolic array. The operation circuit 1603 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 1603 is a general-purpose matrix processor.
[0338] 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 1602 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory 1601 and performs matrix operation with matrix B, and the partial result or final result of the matrix is stored in the accumulator 1608.
[0339] The unified memory 1606 is used to store input data and output data. The weight data is directly transferred to the weight memory 1602 through the direct memory access controller (DMAC) 1605. The input data is also transferred to the unified memory 1606 through the DMAC.
[0340] BIU stands for Bus Interface Unit 1610 , which is used for the interaction between the AXI bus and the DMAC and the instruction fetch buffer (IFB) 1609 .
[0341] The bus interface unit 1610 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 1609 to obtain instructions from the external memory, and is also used for the storage unit access controller 1605 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0342] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1606 or to transfer weight data to the weight memory 1602 or to transfer input data to the input memory 1601.
[0343] The vector calculation unit 1607 includes multiple operation processing units, and further processes 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.
[0344] In some implementations, the vector calculation unit 1607 can store the processed output vector to the unified memory 1606. For example, the vector calculation unit 1607 can apply a linear function and / or a nonlinear function to the output of the operation circuit 1603, 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 1607 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 1603, for example, for use in a subsequent layer in a neural network.
[0345] An instruction fetch buffer 1609 connected to the controller 1604 is used to store instructions used by the controller 1604;
[0346] Unified memory 1606, input memory 1601, weight memory 1602 and instruction fetch memory 1609 are all on-chip memories. External memories are private to the NPU hardware architecture.
[0347] in, Figure 3 , Figure 6 and Figure 8 The operations of each layer in the shown recurrent neural network can be performed by the operation circuit 1603 or the vector calculation unit 1607.
[0348] 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.
[0349] 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.
[0350] Through the description of the above implementation mode, the technicians in the relevant 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 CLUs, 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, U disk, mobile hard disk, ROM, RAM, disk or optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0351] 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.
[0352] 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 server, 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, server, 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 server or a data center 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 processing method, characterized in that: The method comprises: The server receives the customized information sent by the client, wherein the customized information includes a functional indicator of the neural network and a performance indicator of the neural network, wherein the functional indicator is used by the server to determine the general capability of the neural network, and the performance indicator includes any one indicator or a combination of multiple indicators of the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; The server selects N second neural networks from a plurality of first neural networks with the performance index of the neural network as a target, wherein the plurality of first neural networks are generated by the server according to the functional index and the performance index, the function of each first neural network meets the requirement of the functional index, N is a positive integer, and the performance of each second neural network meets the requirement of the performance index; The server sends the N second neural networks to the client.
2. The method according to claim 1, characterized in that The customization information also includes an indicator of the number of neural networks, the indicator of the number is the N number, and the server selects N second neural networks from the plurality of first neural networks with the performance indicator of the neural network as a target, including: The server selects a final Pareto front from the multiple first neural networks with the performance index of the neural network as a target, wherein the final Pareto front includes M second neural networks, wherein M is a positive integer and is greater than or equal to N; The server selects the N second neural networks from the M second neural networks.
3. The method according to claim 2, characterized in that The method further comprises: The server generates a third neural network using the first recurrent neural network according to the plurality of first neural units, wherein the third neural network is one of the plurality of first neural networks, and the third neural network includes at least one second neural unit, and the at least one second neural unit is included in the plurality of first neural units; The server selects a final Pareto front from the plurality of first neural networks with the performance index of the neural network as a target, including: The server generates performance information of the third neural network, the performance information of the third neural network being consistent with the type of information included in the performance indicator of the neural network; The server updates the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front; The server generates a feedback value according to the performance information of the third neural network and a feedback function; The server updates the parameters of the first recurrent neural network according to the feedback value gradient.
4. The method according to claim 3, characterized in that Before the server generates the third neural network according to the plurality of first neural units, the method further includes: The server acquires a fourth neural network, wherein the fourth neural network includes the plurality of first neural units; The server performs initial iterative training on the fourth neural network, wherein the fourth neural network that has performed the initial iterative training is used to initialize the third neural network; The server generates a third neural network according to the plurality of first neural units, including: The server generates the third neural network based on a plurality of first neural units in the fourth neural network that has undergone the initial iterative training.
5. The method according to claim 4, characterized in that The fourth neural network includes a plurality of neural layers, each of which includes L first neural units, wherein L is a positive integer, and the method of using the first recurrent neural network to generate a third neural network according to the plurality of first neural units includes: The server outputs L values through the first recurrent neural network, each value being used to represent the weight of a first neural unit among the L first neural units; The server converts the L numerical values into L probability values through a normalized exponential function, and the L probability values correspond to the L first neural units respectively, wherein the temperature parameter in the normalized exponential function changes according to the law of the cosine function; The server selects a second neural unit from the L first neural units according to the L probability values to implement the function of a neuron layer in the third neural network.
6. The method according to any one of claims 3 to 5, characterized in that: The feedback function is pre-set with a first performance parameter and a first threshold, the first performance parameter being any one of the performance indicators except the accuracy of the neural network, and the server generating a feedback value according to the performance information of the third neural network and the feedback function, including: The server generates the feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; After the server generates a feedback value according to the performance information of the third neural network and a feedback function, the method further includes: the server increases the first performance parameter.
7. The method according to any one of claims 3 to 5, characterized in that: The server generates a feedback value according to the performance information of the third neural network and the feedback function, including: The server compares the performance of the third neural network with the performance of at least one second neural network in the current Pareto front; In a case where the performance of the third neural network is better than the P second neural networks in the current Pareto front, the server generates the feedback value according to P and the feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger the P is, the larger the feedback value is; In the case that the performance of the third neural network is inferior to the Q second neural networks in the current Pareto front, the server generates the feedback value according to Q and the feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger the Q is, the smaller the feedback value is.
8. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The server receives the neural network selection information sent by the client; The server selects at least one fifth neural network from the N second neural networks according to the neural network selection information; The server iteratively trains each fifth neural network until a convergence condition of the loss function is met; The server sends to the client at least one fifth neural network that completes the iterative training operation.
9. The method according to claim 4, characterized in that The method further comprises: The server receives a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
10. A neural network processing method, characterized in that: The method comprises: The client obtains customized information, wherein the customized information includes functional indicators of the neural network and performance indicators of the neural network, wherein the functional indicators are used by the server to determine the general capabilities of the neural network, and the performance indicators include any one or more indicators selected from the group consisting of the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; The client sends the customized information to the server, and the customized information is used for the server to obtain N second neural networks according to the customized information, wherein N is a positive integer, the function of each second neural network meets the requirements of the functional index, and the performance of each second neural network meets the requirements of the performance index; The client receives the N second neural networks sent by the server.
11. The method according to claim 10, characterized in that The customization information also includes an indicator of the number of neural networks, where the indicator is N, and the indicator of the number of neural networks is used by the server to determine the number of second neural networks to be sent to the client.
12. The method according to claim 10 or 11, characterized in that: The method further comprises: The client obtains a neural network selection instruction, where the neural network selection instruction is used for the client to select at least one fifth neural network from the N second neural networks; The client generates neural network selection information according to the neural network selection instruction, wherein the neural network selection information is used to instruct the server to iteratively train each fifth neural network in the at least one fifth neural network; The client sends the neural network selection information to the server; The client receives at least one fifth neural network that completes the iterative training operation and is sent by the server.
13. The method according to claim 12, characterized in that The method further comprises: The client sends a data set to the server, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
14. A server, characterized in that: The server comprises: A receiving unit, used to receive customized information sent by a client, wherein the customized information includes functional indicators of the neural network and performance indicators of the neural network, wherein the functional indicators are used by the server to determine the general capabilities of the neural network, and the performance indicators include any one of the following indicators or a combination of multiple indicators: the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; a selection unit, configured to select N second neural networks from a plurality of first neural networks with the performance index of the neural network as a target, wherein the plurality of first neural networks are generated by the server according to the functional index and the performance index, the function of each first neural network meets the requirement of the functional index, N is a positive integer, and the performance of each second neural network meets the requirement of the performance index; A sending unit is used to send the N second neural networks to the client.
15. The server according to claim 14, characterized in that: The customization information also includes a number index of neural networks, where the number index is N. The selection unit is specifically configured to: Taking the performance index of the neural network as a target, selecting a final Pareto front from the multiple first neural networks, wherein the final Pareto front includes M second neural networks, wherein M is a positive integer, and M is greater than or equal to N; The N second neural networks are selected from the M second neural networks.
16. The server according to claim 15, characterized in that The server also includes: a generating unit, configured to generate a third neural network using the first recurrent neural network according to the plurality of first neural units, wherein the third neural network is one of the plurality of first neural networks, the third neural network includes at least one second neural unit, and the at least one second neural unit is included in the plurality of first neural units; The selection unit is specifically used for: generating performance information of the third neural network, wherein the performance information of the third neural network is consistent with the type of information included in the performance indicator of the neural network; Updating the current Pareto front by comparing the performance of the third neural network with the performance of each second neural network in the current Pareto front; generating a feedback value according to the performance information of the third neural network and a feedback function; Update the parameters of the first recurrent neural network according to the feedback value gradient.
17. The server according to claim 16, characterized in that: The server also includes: An acquisition unit, configured to acquire a fourth neural network, wherein the fourth neural network includes the plurality of first neural units; A training unit, configured to perform initial iterative training on the fourth neural network, wherein the fourth neural network that has performed the initial iterative training is used to initialize the third neural network; The generating unit is specifically used to generate the third neural network according to a plurality of first neural units in the fourth neural network that has performed the initial iterative training.
18. The server according to claim 17, characterized in that: The fourth neural network includes a plurality of neuron layers, each neuron layer includes L first neural units, wherein L is a positive integer; The generating unit is specifically used for: Outputting L values through the first recurrent neural network, each value is used to represent the weight of a first neural unit among the L first neural units; Converting the L numerical values into L probability values by means of a normalized exponential function, wherein the L probability values correspond to the L first neural units respectively, wherein a temperature parameter in the normalized exponential function changes according to a law of a cosine function; According to the L probability values, a second neural unit is selected from the L first neural units to implement the function of a neuron layer in the third neural network.
19. The server according to any one of claims 16 to 18, characterized in that: A first performance parameter and a first threshold are pre-set in the feedback function, and the first performance parameter is any one of the performance indicators except the accuracy of the neural network; The generating unit is specifically used to generate the feedback value according to the accuracy of the third neural network, the second performance parameter of the third neural network and the feedback function, wherein, when the difference between the second performance parameter and the first performance parameter is less than the first threshold, the relationship between the accuracy of the third neural network and the feedback value is positively correlated, the relationship between the difference between the second performance parameter and the first performance parameter and the feedback value is negatively correlated, and when the difference between the second performance parameter and the first performance parameter is greater than the first threshold, the feedback value is zero; The server further includes: an increasing unit, configured to increase the first performance parameter.
20. The server according to any one of claims 16 to 18, characterized in that: The generating unit is specifically used for: comparing the performance of the third neural network to the performance of at least one second neural network in the current Pareto front; In the case where the performance of the third neural network is better than the P second neural networks in the current Pareto front, generating the feedback value according to P and the feedback function, wherein P is a positive integer, the feedback value is a positive number, and the larger the P is, the larger the feedback value is; In the case where the performance of the third neural network is inferior to the Q second neural networks in the current Pareto front, the feedback value is generated according to Q and the feedback function, wherein Q is a positive integer, the feedback value is a negative number, and the larger the Q is, the smaller the feedback value is.
21. The server according to any one of claims 14 to 18, characterized in that: The receiving unit is further used to receive neural network selection information sent by the client; The selection unit is further configured to select at least one fifth neural network from the N second neural networks according to the neural network selection information; The server also includes: A training unit, used for iteratively training each fifth neural network until a convergence condition of the loss function is satisfied; A sending unit is used to send at least one fifth neural network that completes the iterative training operation to the client.
22. The server according to claim 17, characterized in that The receiving unit is further used to receive a data set sent by the client, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
23. A communication device, characterized in that: The communication device comprises: an acquisition unit, used to acquire customized information, wherein the customized information includes functional indicators of the neural network and performance indicators of the neural network, wherein the functional indicators are used by the server to determine the general capabilities of the neural network, and the performance indicators include any one or more indicators selected from the group consisting of the accuracy of the neural network, the number of parameters of the neural network, the size of the memory occupied by the neural network, the processing time of the neural network, or the number of floating-point operations per second; a sending unit, configured to send the customized information to the server, wherein the customized information is used for the server to obtain N second neural networks according to the customized information, wherein N is a positive integer, the function of each second neural network meets the requirements of the functional index, and the performance of each second neural network meets the requirements of the performance index; A receiving unit is used to receive the N second neural networks sent by the server.
24. The device according to claim 23, characterized in that The customization information also includes an indicator of the number of neural networks, where the indicator is N, and the indicator of the number of neural networks is used by the server to determine the number of second neural networks to be sent to the communication device.
25. The device according to claim 23 or 24, characterized in that The acquisition unit is further used to acquire a neural network selection instruction, where the neural network selection instruction is used for the communication device to select at least one fifth neural network from the N second neural networks; The communication device further includes: a generating unit, configured to generate neural network selection information according to the neural network selection instruction, wherein the neural network selection information is used to instruct the server to perform iterative training on each fifth neural network in the at least one fifth neural network; The sending unit is further used to send the neural network selection information to the server; The receiving unit is further used to receive at least one fifth neural network that completes the iterative training operation and is sent by the server.
26. The device according to claim 25, characterized in that The sending unit is further used to send a data set to the server, the data type in the data set is associated with the functional indicator, and the data set is used for the server to perform iterative training operations on the neural network.
27. A computer-readable storage medium comprising a program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 9, or causes the computer to execute the method according to any one of claims 10 to 13.
28. A communication device, comprising a processor and a memory, wherein the processor is coupled to the memory, wherein: The memory is used to store programs; The processor is configured to execute the program in the memory so that the communication device executes the method according to any one of claims 1 to 9, or the communication device executes the method according to any one of claims 10 to 13.
