A method for acquiring a neural network and related equipment
By incrementally learning new skills in reinforcement learning and adding them to the skill base, the problem of high dependence on the pre-training environment of existing methods is solved, and the scalability of the skill base and the ability to complete tasks are improved.
Patent Information
- Application Number
- CN201910935456.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-09-29
AI Technical Summary
Existing reinforcement learning methods rely on a large skill set, have high requirements for the training environment during the pre-training phase, and lack sufficient skills to complete certain specific tasks, which leads to limitations.
By acquiring an initial neural network, new skills are trained in a simulation environment using reinforcement learning algorithms and added to the skill library until a preset success rate is achieved, thus realizing incremental learning to expand the skill library and reducing dependence on the pre-training environment.
It achieves scalability of the skill set, reduces the requirements for the pre-training environment, overcomes the limitations of existing methods, and improves the ability to complete tasks.
Smart Images

Figure CN112580795B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a method for acquiring a neural network 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] Reinforcement Learning (RL) is an important machine learning method in the field of artificial intelligence, and has many applications in the fields of autonomous driving, intelligent control robots, analysis and prediction. Specifically, the main problem to be solved by reinforcement learning is how smart devices can directly interact with the environment to learn the skills used when performing specific tasks, so as to maximize the long-term reward for specific tasks. Among the current methods for skill learning, random neural networks and information theory regularizers are used to train a series of large-span skills, thereby obtaining a skill library containing many skills. After determining the specific task, the corresponding neural network is trained for the specific task. The neural network is used to select appropriate skills from the above skill library to perform the specific task, thereby maximizing the long-term reward for the task.
[0004] However, the current skill learning method completely relies on a skill library that includes a series of wide-span skills to perform specific tasks. The skills in the skill library acquired in the pre-training stage need to be as comprehensive as possible, which places extremely high demands on the training environment in the pre-training stage. Even if the skill library contains more skills, there is a possibility that certain specific tasks cannot be completed, which leads to certain limitations in the current skill learning method. Summary of the invention
[0005] The embodiments of the present application provide a method for acquiring a neural network and related equipment for incrementally learning skills to expand a skill library, thereby reducing the requirements for the training environment in the pre-training stage; and achieving the scalability of skills in the skill library, overcoming the limitations of current skill learning methods.
[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 method for acquiring a neural network, which can be applied to a scenario of reinforcement learning of a neural network in the field of artificial intelligence. A server acquires a first task. Specifically, the server can acquire a mature first neural network as the first neural network from at least one pre-trained neural network, that is, the first neural network is a neural network trained based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task. Alternatively, after determining the first task, the server initializes a first neural network, wherein the first neural network is used to select a skill for completing the first task from a skill library, and the skills in the skill library can be expressed as neural networks or operation rules. The semantic information of the second task is similar to the semantic information of the first task, which can be obtained by using a neural network to acquire semantic information of the first task and the second task and compare them to determine that the semantic information of the first task is similar to the semantic information of the second task, or the constraints obtained by decomposing the first task and the second task are similar, or the operating environments of the first task and the second task are similar. Then, the server acquires a first success rate of the first neural network for completing the first task. When the first success rate is less than a preset threshold, the server acquires a second neural network and a new skill, adds the new skill to the skill library, and obtains an updated skill library, wherein the second neural network is used to select a skill from the updated skill library. A skill for completing the first task is selected from the server library, where the new skill can be specifically represented as a neural network; then the server trains the second neural network and the new skill based on the simulation environment corresponding to the first task using a reinforcement learning algorithm until a second success rate of the second neural network for completing the first task is greater than or equal to a preset threshold. Specifically, after initializing the second neural network and the new skill, the server trains the second neural network and the new skill based on the simulation environment corresponding to the first task using a reinforcement learning algorithm until both the loss function of the second neural network and the loss function of the new skill meet convergence conditions, then obtains the second success rate of the second neural network for completing the first task, and determines the second success rate. Whether the power is greater than or equal to a preset threshold. If the second success rate is greater than or equal to the preset threshold, the trained second neural network and the updated skill library are stored; if the second success rate is less than the preset threshold, the new new skills and the new second neural network are repeatedly generated, and the new new skills are added to the updated skill library to obtain a new updated skill library. The new second neural network and the new new skills are trained until the loss functions meet the convergence conditions, and the operation of judging whether the second success rate is greater than or equal to the preset threshold is performed until the second success rate of performing the second task through the second neural network is greater than or equal to the preset threshold, and the final trained second neural network and the updated skill library are stored.
[0008] In this implementation, after acquiring the first task, the first success rate of the first neural network for completing the first task can be acquired. When the first success rate is less than a preset threshold, the second neural network and the new skill can be acquired, and the new skill is added to the skill library to obtain an updated skill library. Then, based on the simulation environment corresponding to the first task, the second neural network is trained until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and then stored. Since new skills can be incrementally learned to expand the skill library in the process of learning how to complete the task, the dependence on the skill library obtained in the pre-training stage is greatly reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of new skills realizes the scalability of the skills in the skill library, so that the ability to complete new tasks can be acquired, overcoming the limitations of current skill learning methods.
[0009] In a possible implementation of the first aspect, the server trains the second neural network, which may include: the server selects a skill for completing the first task from an updated skill library using the second neural network. Specifically, the server may pre-configure a serial number for each skill in the updated skill library, and the output of the second neural network may be the serial number, so that the corresponding skill selected by the second neural network can be found according to the serial number output by the second neural network; then the server may generate a control instruction using the skill selected by the second neural network, and then execute the control instruction corresponding to the skill selected by the second neural network through the smart device. During the process of the smart device executing the control instruction corresponding to the skill selected by the second neural network, the server will execute an execution status acquisition operation of the skill selected by the second neural network once every preset time period until the execution status of the skill selected by the second neural network is execution completion. The server will also obtain data of the smart device executing the first task, that is, data generated during the server executing the control instruction corresponding to the skill selected by the second neural network. The data may include any one or more of the operation path, operation speed or operation destination of the smart device. After the server executes the skill selected by the second neural network once, the parameters of the second neural network will be updated according to the data of the smart device executing the first task. In this implementation, a specific implementation method for the server to train the second neural network is provided, which improves the executability of this solution; in addition, the server determines whether the skill selected by the second neural network has been executed by obtaining the execution status of the skill selected by the second neural network once every preset time period, so that the server can iteratively update the new skill strategy and the parameters of the new skill in a timely manner according to the operation behavior information of the smart device, which is conducive to improving the accuracy of the training process.
[0010] In a possible implementation of the first aspect, after inputting the environment state information into the second neural network and obtaining the skill selected by the second neural network, the server can determine whether the skill selected by the second neural network is a new skill. If the skill selected by the second neural network is a new skill, the server updates the parameters of the new skill based on the data of the smart device executing the first task; if the skill selected by the second neural network is not a new skill, the parameters of the skill selected by the second neural network are not updated. In this implementation, the different skills in the updated skill library can be distinguished to a large extent, thereby reducing the storage redundancy of the updated skill library; in addition, if the parameters of skills that are not newly generated are also updated, the evolution direction of the skills in the updated skill library is out of control. Only the newly generated skills are updated, which is conducive to facilitating the gap in skill requirements between the first task and the second task of learning the new skill.
[0011] In a possible implementation of the first aspect, the server uses a reinforcement learning algorithm to update the parameters of the second neural network, including: the server uses the first reinforcement learning algorithm to update the parameters of the second neural network, specifically, the server obtains the feedback value obtained in the process of the intelligent device executing a control instruction corresponding to the skill selected by the second neural network according to the data of the intelligent device executing the first task, determines the advantage function and loss function of the second neural network according to the first reinforcement learning algorithm, brings the feedback value into the advantage function of the second neural network, and then obtains the function value of the loss function of the second neural network according to the function value of the advantage function of the second neural network, so as to gradient update the parameters of the second neural network according to the function value of the loss function of the second neural network, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm or a time difference TD algorithm. In this implementation, a specific implementation method of the reinforcement learning algorithm adopted by the second neural network is provided, which improves the feasibility of this solution and also enables those skilled in the art to have more choices, thereby improving the implementation flexibility of this solution.
[0012] In a possible implementation of the first aspect, the server uses a reinforcement learning algorithm to update the parameters of the new skill, including: the server uses a second reinforcement learning algorithm to update the parameters of the new skill. Specifically, when the skill selected by the second neural network is a new skill, the server determines the loss function of the new skill according to the second reinforcement learning algorithm, obtains the function value of the loss function of the new skill according to the data of the smart device executing the first task, and then updates the parameters of the new skill by gradient, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a DQN algorithm, a PPO algorithm, or a flexible actuation evaluation SAC algorithm. In this implementation, a specific implementation method of the reinforcement learning algorithm used by the new skill is provided, which improves the feasibility of the solution and also allows those skilled in the art to have more choices, thereby improving the implementation flexibility of the solution.
[0013] In a possible implementation of the first aspect, after the server obtains the second neural network, the method further includes: the server uses the parameters of the first neural network to initialize the parameters of the second neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to the second task, and the semantic information of the second task is similar to the semantic information of the first task. Specifically, the server can use the parameters of the first neural network to initialize some parameters of the second neural network, and initialize the parameters that exist in the second neural network but do not exist in the first neural network. In this implementation, the parameters of the second neural network are initialized using the parameters of the trained first neural network, which can directly inherit the capabilities learned by the first neural network, shorten the process of training the second neural network, and improve the training efficiency of the second neural network.
[0014] In a possible implementation of the first aspect, the first neural network and the skill library are neural networks trained using a reinforcement learning algorithm based on a simulation environment corresponding to the second task, and the semantic information of the second task is similar to the semantic information of the first task. The method also includes: when the first success rate is greater than or equal to a preset threshold, the server determines the first neural network as a neural network for completing the first task, stores the first neural network and the skill library, and then configures the first neural network and the skill library on an intelligent device that performs the first task. Specifically, the first neural network and the skill library can be sent to the intelligent device that performs the first task wirelessly or wired. In this implementation, when the first neural network is a neural network trained based on a simulation environment corresponding to the second task, the reuse of the upper neural network and the lower skill library is achieved, which saves time and training resources in the neural network training process and greatly improves the efficiency of the neural network training process.
[0015] In a possible implementation of the first aspect, the server obtains a first success rate of the first neural network for completing the first task, including: the server obtains environmental status information from a simulation environment corresponding to the first task, inputs the environmental status information into the first neural network, and obtains a skill selected by the first neural network from a skill library, wherein the environmental status information includes environmental information around a smart device in the simulation environment corresponding to the first task and self-status information of the smart device, and specifically may include map information around the smart device, destination information of the smart device, movement information of adjacent smart devices, movement information of the current smart device, or other types of environmental information; then the server obtains a control instruction through the skill selected by the first neural network, and According to the control instruction, the intelligent device is controlled to perform the first task. After the server determines that a skill has been executed, it will determine whether the first task has been completed. If not, the next skill is selected from the skill library through the first neural network to perform the first task again, until the first task is completed through at least one skill; the server repeats the above steps until the number of times the first task is completed through the first neural network reaches the first number, and the number of times the result of completing the first task in the first number is successfully counted to obtain the second number. According to the first number and the second number, the first success rate is calculated. Specifically, the ratio of the second number to the first number can be determined as the first success rate, wherein the result of completing the first task includes success and failure. In this implementation method, since the server controls the intelligent device to repeatedly perform the first task through the first neural network in the simulator during the experiment, that is, the first success rate is obtained by restoring the real scene to improve the accuracy of the first success rate.
[0016] In a possible implementation of the first aspect, before obtaining the first success rate of the first neural network for completing the first task, the server can also obtain control instructions through the skills selected by the first neural network to control the intelligent device to perform the first task. In the process of the server performing the first task through the first neural network, it can be determined whether the loss function of the first neural network converges, wherein the first neural network is a neural network trained based on the simulation environment corresponding to the second task, and the semantic information of the first task is similar to the semantic information of the second task; when the loss function of the first neural network has not converged, the first neural network is trained based on the simulation environment corresponding to the first task until the convergence condition of the loss function of the first neural network is reached, so as to obtain a mature first neural network, and then the server can obtain the first success rate of performing the first task through the mature first neural network. In this implementation, since in some scenarios, the similarity between the first task and the second task is very high, that is, the skills used to execute the first task and the skills used to execute the second task are basically the same, it is only necessary to fine-tune the first neural network based on the simulation environment corresponding to the first task, so that the condition that the first success rate of the first neural network for completing the first task is greater than or equal to the preset threshold can be achieved, that is, based on the simulation environment corresponding to the first task, the first neural network is re-trained to achieve the purpose of executing the first task through the first neural network. Therefore, the pre-training method can increase the probability that the first success rate is greater than or equal to the preset threshold, thereby reducing the probability of generating a new second neural network and a new skill, and then the operation of training the second neural network and the new skill can be avoided, thereby saving server resources and improving the generation efficiency of neural networks and skills.
[0017] In a possible implementation of the first aspect, the server obtains a first success rate of the first neural network for completing the first task, including: the server obtains semantic information of the first task, and obtains semantic information of the second task, wherein the semantic information of the second task is similar to the semantic information of the first task, and the first neural network is obtained by training using a reinforcement learning algorithm based on a simulation environment corresponding to the second task. Specifically, the server can use the neural network to obtain the semantic information of the first task and the second task respectively, and generate the similarity between the first task and the second task according to the semantic information of the first task and the second task. The server can also decompose the first task to obtain at least one constraint condition, and decompose the second task to obtain at least one constraint condition, and determine the similarity between the semantic information of the first task and the semantic information of the second task by comparing each constraint condition of the first task and the second task one by one; then the server generates the first success rate according to the similarity, wherein the higher the similarity, the higher the first success rate. In this implementation, the first success rate of the first neural network for completing the first task is determined by obtaining the similarity between the first task and the second task, which provides another implementation method for obtaining the first success rate and expands the application scenario of this solution; and in this method, it is no longer necessary to repeatedly perform the first task through the first neural network, which improves the efficiency of obtaining the first success rate.
[0018] In a possible implementation of the first aspect, the skills in the skill library are driving skills; or, the skills in the skill library are carrying skills; or, the skills in the skill library are grasping skills; in this implementation, multiple specific implementation methods of the skills are provided, which expands the application scenarios of the present solution and improves the comprehensiveness of the present solution.
[0019] In a possible implementation of the first aspect, the skill in the skill library is a driving skill, and the data obtained by the server on the smart device performing the first task includes any one or more of the driving speed, driving path, driving collision situation, or driving destination of the smart device; or, the skill in the skill library is a transporting skill, and the data obtained by the server on the smart device performing the first task includes any one or more of the transporting path, driving speed, or collision situation of the smart device; or, the skill in the skill library is a grasping skill, and the data obtained by the server on the smart device performing the first task includes any one or more of the grasping path, grasping speed, or grasping destination of the smart device. In this implementation, the specific content of the operation behavior information is further provided, thereby further improving the executability of this solution; and the specific content of the operation behavior information in different fields is provided, thereby improving the implementation flexibility of this solution.
[0020] In a second aspect, an embodiment of the present application provides a method for acquiring a neural network, which can be applied to a scenario of reinforcement learning of a neural network in the field of artificial intelligence. The method may include: a server acquires a first success rate of a first neural network for completing a first driving task, the first neural network is used to select a driving skill for completing the first driving task from a skill library, and when the first success rate is less than a preset threshold, a second neural network and a new driving skill are acquired, and the new driving skill is added to the skill library to update the skill library, the second neural network is used to select a driving skill for completing the first driving task from the updated skill library; the server trains the second neural network based on a simulation environment corresponding to the first driving task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first driving task is greater than or equal to the preset threshold, and stores the trained second neural network and the updated skill library.
[0021] In a possible implementation of the second aspect, the server trains the second neural network based on the simulation environment corresponding to the first driving task using a reinforcement learning algorithm, including: the server inputs environmental state information into the second neural network to obtain driving skills selected by the second neural network, the environmental state information including environmental information around the car in the simulation environment corresponding to the first driving task and the car's own state information; the server obtains control instructions through the driving skills selected by the second neural network to control the car to perform the first driving task, and obtains data on the car performing the first driving task, and updates the parameters of the second neural network based on the obtained data on the car performing the first driving task using a reinforcement learning algorithm.
[0022] In a possible implementation of the second aspect, after the server inputs the environmental state information into the second neural network and obtains the driving skill selected by the second neural network, the method may also include: when the driving skill selected by the second neural network is a new driving skill, the server updates the parameters of the new driving skill based on the acquired data of the car performing the first driving task by using a reinforcement learning algorithm.
[0023] In a possible implementation of the second aspect, the server uses a reinforcement learning algorithm to update the parameters of the second neural network, including: the server uses a first reinforcement learning algorithm to update the parameters of the second neural network, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm, or a time difference TD algorithm.
[0024] In a possible implementation of the second aspect, the server uses a reinforcement learning algorithm to update the parameters of the new driving skill, including: the server uses a second reinforcement learning algorithm to update the parameters of the new driving skill, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm, or a flexible actuation evaluation SAC algorithm.
[0025] In a possible implementation of the second aspect, the method also includes: the server uses the parameters of the first neural network to initialize the parameters of the second neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task.
[0026] In a possible implementation of the second aspect, the first neural network and the skill library are trained using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task. The method also includes: when the first success rate is greater than or equal to a preset threshold, the server determines the first neural network as the neural network for completing the first driving task, and stores the first neural network and the skill library.
[0027] In a possible implementation of the second aspect, the server obtains a first success rate of a first neural network for completing a first driving task, including: the server inputs environmental state information into the first neural network to obtain driving skills selected by the first neural network, wherein the environmental state information includes environmental information around the car in a simulation environment corresponding to the first driving task and the car's own state information; obtains control instructions through the driving skills selected by the first neural network to control the car to perform the first driving task, and repeats the above steps until the number of times the first driving task is completed by the first neural network reaches a first number, the number of times the first driving task is completed successfully in the first number is counted to obtain a second number, and the first success rate is calculated based on the first number and the second number.
[0028] In a possible implementation of the second aspect, before the server inputs the environmental state information into the first neural network, the method also includes: the server obtains a control instruction through the driving skill selected by the first neural network to control the car to perform the first driving task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first driving task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task; when the loss function of the first neural network has not converged, the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the first driving task until the convergence condition of the loss function of the first neural network is reached to obtain a mature first neural network; and then the server obtains a first success rate of the first neural network for completing the first driving task, which may include: the server obtains the success rate of the mature first neural network for completing the first driving task as the first success rate.
[0029] In a possible implementation of the second aspect, the server obtains a first success rate of a first neural network for completing a first driving task, including: the server obtains semantic information of the first driving task, and obtains semantic information of a second driving task, wherein the semantic information of the second driving task is similar to the semantic information of the first driving task, and the first neural network is trained by using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task; and the first success rate is obtained according to a similarity between the semantic information of the first driving task and the semantic information of the second driving task, wherein the higher the similarity, the higher the first success rate.
[0030] 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.
[0031] In a third aspect, an embodiment of the present application provides a method for acquiring a neural network, which can be applied to a scenario of reinforcement learning of a neural network in the field of artificial intelligence. The method may include: a server acquires a first success rate of a first neural network for completing a first task, the first neural network is used to select a skill for completing the first task from a skill library, the first neural network and the skill library are trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task; when the first success rate is greater than or equal to a preset threshold, the server determines the first neural network as a neural network for completing the first task, and stores the first neural network and the skill library.
[0032] In a possible implementation of the third aspect, the method also includes: when the first success rate is less than a preset threshold, the server obtains a second neural network and a new skill, and adds the new skill to a skill library to update the skill library, and the second neural network is used to select skills for completing the first task from the updated skill library; based on the simulation environment corresponding to the first task, the server uses a reinforcement learning algorithm to train the second neural network until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and stores the trained second neural network and the updated skill library.
[0033] In a possible implementation of the third aspect, the server trains the second neural network based on the simulation environment corresponding to the first task using a reinforcement learning algorithm, which may include: the server inputs environmental state information into the second neural network to obtain skills selected by the second neural network, the environmental state information including environmental information around the smart device in the simulation environment corresponding to the first task and the smart device's own state information; the server obtains control instructions through the skills selected by the second neural network to control the smart device to perform the first task, and obtains data on the smart device performing the first task, and updates the parameters of the second neural network using a reinforcement learning algorithm based on the obtained data on the smart device performing the first task.
[0034] In a possible implementation of the third aspect, the server inputs the environmental state information into the second neural network, and obtains the skill selected by the second neural network. When the skill selected by the second neural network is a new skill, the server can also update the parameters of the new skill based on the data obtained from the smart device performing the first task, using a reinforcement learning algorithm.
[0035] In a possible implementation of the third aspect, the server uses a reinforcement learning algorithm to update the parameters of the second neural network, which may include: using a first reinforcement learning algorithm to update the parameters of the second neural network, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm, or a time difference TD algorithm.
[0036] In a possible implementation of the third aspect, the server uses a reinforcement learning algorithm to update the parameters of the new skill, which may include: using a second reinforcement learning algorithm to update the parameters of the new skill, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm, or a flexible actuation evaluation SAC algorithm.
[0037] In a possible implementation manner of the third aspect, the method further includes: the server initializes parameters of the second neural network using parameters of the first neural network.
[0038] In a possible implementation of the third aspect, the server obtains a first success rate of the first neural network for completing a first task, which may include: the server inputs environmental status information into the first neural network to obtain skills selected by the first neural network, wherein the environmental status information includes environmental information around the intelligent device in the simulation environment corresponding to the first task and the intelligent device's own status information; obtains control instructions through the skills selected by the first neural network to control the intelligent device to perform the first task, and repeats the above steps until the number of times the first task is completed by the first neural network reaches a first number, the number of times the result of completing the first task successfully in the first number is counted to obtain a second number, and the first success rate is calculated based on the first number and the second number.
[0039] In a possible implementation of the third aspect, before the server inputs the environmental status information into the first neural network, the method may also include: the server obtains control instructions through the skill selected by the first neural network to control the intelligent device to perform the first task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first task; when the loss function of the first neural network has not converged, based on the simulation environment corresponding to the first task, the first neural network is trained using a reinforcement learning algorithm until the convergence condition of the loss function of the first neural network is reached to obtain a mature first neural network; and then the server obtains a first success rate of the first neural network for completing the first task, including: obtaining the success rate of the mature first neural network for completing the first task as the first success rate.
[0040] In a possible implementation of the third aspect, the server obtains a first success rate of the first neural network for completing a first task, including: obtaining semantic information of the first task, and obtaining semantic information of the second task; obtaining the first success rate based on a similarity between the semantic information of the first task and the semantic information of the second task, wherein the higher the similarity, the higher the first success rate.
[0041] In a possible implementation manner of the third aspect, the skills in the skill library are driving skills; or, the skills in the skill library are carrying skills; or, the skills in the skill library are grasping skills.
[0042] For the specific implementation steps of the third aspect of the present application and various possible implementation methods of the third 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.
[0043] In a fourth aspect, an embodiment of the present application provides a neural network acquisition device, which can be applied to the scenario of reinforcement learning of neural networks in the field of artificial intelligence, including: an acquisition unit, a training unit and a storage unit, wherein the acquisition unit is used to obtain a first success rate of a first neural network for completing a first task, and the first neural network is used to select skills for completing the first task from a skill library; the acquisition unit is also used to acquire a second neural network and a new skill when the first success rate is less than a preset threshold, and add the new skill to the skill library to update the skill library, and the second neural network is used to select skills for completing the first task from the updated skill library; the training unit is used to train the second neural network based on the simulation environment corresponding to the first task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold; the storage unit is used to store the trained second neural network and the updated skill library.
[0044] In the fourth aspect of the present application, the constituent modules of the neural network acquisition device can also be used to execute the steps performed by the server in various possible implementation methods of the first aspect. The details can be referred to the first aspect and will not be repeated here.
[0045] In a fifth aspect, an embodiment of the present application provides a neural network acquisition device, which can be applied to the scenario of reinforcement learning of neural networks in the field of artificial intelligence, including: an acquisition unit, a training unit and a storage unit, wherein the acquisition unit is used to acquire a first success rate of a first neural network for completing a first driving task, and the first neural network is used to select driving skills for completing the first driving task from a skill library; the acquisition unit is also used to acquire a second neural network and a new driving skill when the first success rate is less than a preset threshold, and add the new driving skill to the skill library to update the skill library, and the second neural network is used to select driving skills for completing the first driving task from the updated skill library; the training unit is used to train the second neural network based on the simulation environment corresponding to the first driving task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first driving task is greater than or equal to the preset threshold; the storage unit is used to store the trained second neural network and the updated skill library.
[0046] In the fifth aspect of the present application, the constituent modules of the neural network acquisition device can also be used to execute the steps performed by the server in various possible implementation methods of the second aspect. For details, please refer to the second aspect and will not be repeated here.
[0047] In a sixth aspect, an embodiment of the present application provides a neural network acquisition device, which can be applied to the scenario of reinforcement learning of neural networks in the field of artificial intelligence, including: an acquisition unit, a determination unit and a storage unit, wherein the acquisition unit is used to obtain a first success rate of a first neural network for completing a first task, the first neural network is used to select skills for completing the first task from a skill library, the first neural network and the skill library are trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task; the determination unit is used to, when the first success rate is greater than or equal to a preset threshold, the server determines the first neural network as a neural network for completing the first task; the storage unit is used to store the first neural network and the skill library.
[0048] In the sixth aspect of the present application, the constituent modules of the neural network acquisition device can also be used to execute the steps performed by the server in each possible implementation method of the third aspect. For details, please refer to the second aspect and will not be repeated here.
[0049] In a seventh aspect, an embodiment of the present application provides a server, including a processor, wherein the processor is coupled to a memory, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the method for acquiring a neural network described in the first aspect, the second aspect, or the third aspect above is performed.
[0050] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method for acquiring a neural network as described in the first aspect, the second aspect, or the third aspect above.
[0051] In a ninth aspect, an embodiment of the present application provides a circuit system, wherein the circuit system includes a processing circuit, and the processing circuit is configured to execute the method for acquiring a neural network described in the first aspect, the second aspect, or the third aspect above.
[0052] In a tenth aspect, an embodiment of the present application provides a computer program, which, when executed on a computer, enables the computer to execute the method for acquiring a neural network as described in the first aspect, the second aspect, or the third aspect above.
[0053] In the eleventh aspect, the present application provides a chip system, which includes a processor for supporting a server 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 a chip, or it can include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of the structure of the artificial intelligence main framework provided in the embodiment of the present application;
[0055] Figure 2 A schematic diagram of a network structure of a neural network acquisition system provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of a flow chart of a method for acquiring a neural network provided in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of the structure of a convolutional neural network provided in an embodiment of the present application;
[0058] Figure 5 Another structural schematic diagram of a convolutional neural network provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of using skills to perform a first task in the neural network acquisition method provided in an embodiment of the present application;
[0060] Figure 7 Another schematic diagram of a flow chart of a method for acquiring a neural network provided in an embodiment of the present application;
[0061] Figure 8 A schematic diagram of a driving task in the neural network acquisition method provided in an embodiment of the present application;
[0062] Fig. 9 Another schematic diagram of a driving task in the method for acquiring a neural network provided in an embodiment of the present application;
[0063] Fig.10 A schematic diagram of another flow chart of the method for acquiring a neural network provided in an embodiment of the present application;
[0064] Fig.11 Another schematic diagram of a driving task in the method for acquiring a neural network provided in an embodiment of the present application;
[0065] Fig.12 A schematic diagram of another flow chart of the method for acquiring a neural network provided in an embodiment of the present application;
[0066] Fig.13 A schematic diagram of another flow chart of the method for acquiring a neural network provided in an embodiment of the present application;
[0067] Fig.14 A schematic diagram of another flow chart of the method for acquiring a neural network provided in an embodiment of the present application;
[0068] Fig.15A schematic diagram of another flow chart of the method for acquiring a neural network provided in an embodiment of the present application;
[0069] Fig.16 A schematic diagram of the structure of a neural network acquisition device provided in an embodiment of the present application;
[0070] Fig.17 Another schematic diagram of the structure of the neural network acquisition device provided in the embodiment of the present application;
[0071] Fig.18 A schematic diagram of another structure of a neural network acquisition device provided in an embodiment of the present application;
[0072] Fig.19 A schematic diagram of another structure of the neural network acquisition device provided in the embodiment of the present application;
[0073] Fig. 20 A schematic diagram of another structure of a neural network acquisition device provided in an embodiment of the present application;
[0074] Fig.21 A schematic diagram of another structure of the neural network acquisition device provided in the embodiment of the present application;
[0075] Fig. 22 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0076] Fig.23 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] The embodiments of the present application provide a method for acquiring a neural network and related equipment for incrementally learning skills to expand a skill library, thereby reducing the requirements for the training environment in the pre-training stage; and achieving the scalability of skills in the skill library, overcoming the limitations of current skill learning methods.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] (1) Infrastructure
[0082] 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.
[0083] (2) Data
[0084] 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, humidity, and distance between smart devices.
[0085] (3) Data processing
[0086] Data processing usually includes data training, machine learning, reinforcement learning, deep learning, search, reasoning, decision-making and other methods.
[0087] Among them, machine learning, reinforcement learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, training, etc.
[0088] 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.
[0089] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as skill selection, classification, sorting, and prediction.
[0090] (4) General ability
[0091] 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, the selection of driving skills, the selection of carrying skills, the selection of grasping skills, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0092] (5) Smart products and industry applications
[0093] 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.
[0094] With the development of artificial intelligence, many tasks that need to be completed by people are gradually replaced by smart terminals. In this case, the smart terminal needs to be configured with the skills used to complete the task, as well as the neural network for the task, so as to realize the function of completing specific tasks through the smart terminal. Specifically, it can be applied to mobile smart terminals. As an example, in the field of autonomous driving, the driving operation originally completed by people can be replaced by smart cars, so the smart car needs to be equipped with a large number of driving skills and neural networks for driving skills; as another example, in the field of freight, the handling operation originally completed by people can be replaced by a handling robot, so the handling robot needs to be equipped with a large number of handling skills and neural networks for handling skills. It can also be applied to smart terminals that do not have mobile operations. As an example, on an assembly line for parts processing, the spare parts grabbing operations that were originally performed by humans can be completed by smart robotic arms. In this case, the smart robotic arms need to be configured with grabbing skills and neural networks for grabbing skills, wherein different grabbing skills may have different grabbing angles, displacements of smart robotic arms, etc.; as another example, in the field of automatic cooking, the cooking operations that were originally performed by humans can be completed by smart robotic arms. In this case, the smart robotic arms need to be configured with cooking skills such as raw material grabbing skills and stir-frying skills, as well as neural networks for cooking skills, etc. Other application scenarios are not enumerated here.
[0095] The neural networks and various skills configured in the above-mentioned smart products such as smart terminals, smart cars and smart robotic arms need to be acquired through pre-learning. In combination with the above description, an embodiment of the present application provides a method for acquiring a neural network. Specifically, the server acquires a first task and acquires a first success rate of the first neural network for completing the first task. When the first success rate is lower than a preset threshold, the server acquires a second neural network and a new skill, adds the new skill to the skill library, and obtains an updated skill library; based on the simulation environment corresponding to the first task, the second neural network is trained using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and then the trained second neural network and the updated skill library are stored so that they can be configured to various smart products.
[0096] It can be seen from the above description that the embodiments of the present application involve both a server and an intelligent terminal. Figure 2 The network architecture of the neural network acquisition system in the embodiment of the present application is introduced. Figure 2 The network architecture diagram of the neural network acquisition system provided in the embodiment of the present application is shown in FIG. Figure 2In the figure, the neural network acquisition system 200 includes a server 210, a data acquisition device 220, an intelligent device 230, a database 240, a first communication device 250 and a second communication device 260.
[0097] The server 210 is used to obtain a first task, and then use the environmental status information obtained by the data acquisition device 220 to obtain a first success rate of the first neural network for completing the first task, wherein the first neural network is used to select a skill from a skill library for completing the first task.
[0098] The data acquisition device 220 is used to acquire environmental status information. Specifically, a simulator may be configured on the server 210. The data acquisition device 220 collects current environmental status information around the smart device 230 in the simulator when the smart device 230 performs the first task.
[0099] The server 210 is also used to generate a second neural network when the first success rate is less than a preset threshold, add the new skill to the skill library, and obtain an updated skill library; based on the simulation environment corresponding to the first task, the second neural network is trained using the environmental state information obtained by the data acquisition device 220 until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold; then the trained second neural network and the updated skill library are stored in the database 240, and the mature second neural network and the updated skill library are sent to the first communication device 250. The database 240 can be configured in the server 210, or it can be a storage device independent of the server 210. Figure 2 In the example, the database 240 and the server 210 are taken as independent storage devices.
[0100] After receiving the second neural network and the updated skill library, the first communication device 250 may run the mature second neural network and the updated skill library on the first communication device 250; it may also send the mature second neural network and the updated skill library to the second communication device 260, or load the mature second neural network and the updated skill library to the second communication device 260 and have the second communication device 260 run them.
[0101] The first communication device 240 may be specifically represented by a smart car, a handling robot, a smart mechanical arm, a chess and card robot, a sweeping robot, and other smart devices that can directly perform tasks, or may be specifically represented by a communication device such as a personal computer, a computer workstation, a smart phone, a tablet computer, etc., for storing a mature second neural network and an updated skill library, etc., which is not limited here. The second communication device 260 may be represented by a smart car, a handling robot, a smart mechanical arm, a chess and card robot, a sweeping robot, and other smart devices that can directly perform tasks.
[0102] The first communication device 250 and the server 210 as well as the first communication device 250 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.
[0103] Although Figure 2 Only one server 210, one first communication device 250 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 numbers of the specific servers 210, the first communication devices 250, and the second communication devices 260 should be flexibly determined based on actual conditions.
[0104] In combination with the above description, the specific implementation process of the method for acquiring a neural network provided in the embodiment of the present application is described below. Since the method for acquiring a neural network provided in the embodiment of the present application involves both the training side and the application side of the neural network, the specific implementation process of the training side and the specific implementation process of the application side are introduced below respectively.
[0105] 1. Training side
[0106] See also Figure 3 , Figure 3 As an embodiment of a method for acquiring a neural network in an embodiment of the present application, the method may include:
[0107] 301. The server obtains the first task.
[0108] In the embodiment of the present application, the server will first obtain the first task. Specifically, the server can receive the first task input by the technicians in the field, that is, the first task can be input by the technicians in the field through the receiving interface of the server; a large number of tasks can also be input in advance by the technicians in the field, so that the server can select the first task from the pre-input tasks; the task generation rule can also be pre-set for the technicians in the field, so that the server can generate the first task by itself according to the generation rule, and further, the generation rule can be that the task difficulty is getting more and more difficult. As an example, for example, the initial task is that the car drives out of the roundabout, the traffic flow at the entrance of the roundabout is one car every 5 seconds, and the car can only be in the outer lane of the roundabout, without the lane changing function; then the first task generated by the server with a higher difficulty than the initial task can be that the car drives out of the roundabout, the traffic flow at the entrance of the roundabout is one car every 5 seconds, and the car can drive in any lane of the roundabout, that is, there is a lane changing function; the first task generated by the server with a further increased difficulty can be that the car drives out of the roundabout, the traffic flow at the entrance of the roundabout is one car every 2.5 seconds, and the car has the lane changing function. As another example, for example, the initial task is to put the goods into the warehouse, and the initial task is to place the goods on the bottom shelf, with a handling speed of one every two minutes; then the first task generated by the server that is more difficult than the initial task may be to put the goods into the warehouse, place the goods on the bottom shelf, and carry them at a handling speed of one every minute; the first task generated by the server with further increased difficulty may be to put the goods into the warehouse, place the goods on the entire four-layer shelf, with a handling speed of one every minute, and so on. It should be understood that the form in which the server obtains the first task is not specifically limited here.
[0109] 302. The server obtains a first neural network.
[0110] In some embodiments of the present application, after obtaining the first task, the server will obtain the first neural network, wherein the first neural network is used to select skills from the skill library for completing the first task; further, the first neural network can be specifically expressed as a neural network; each skill in the skill library can be specifically expressed as a neural network, or can be specifically expressed as an operation rule. As an example, the skills in the skill library can be specifically accelerated at a speed of 10 meters per second, turned right 30 degrees, moved forward 3 meters to the right, or other operation rules, etc., which are not specifically limited here. When the solution provided in the embodiment of the present application is applied to the field of autonomous driving, the skills in the skill library can be driving skills; when the solution provided in the embodiment of the present application is applied to the field of freight, the skills in the skill library can be handling skills; when the solution provided in the embodiment of the present application is applied to an intelligent mechanical arm, the skills in the skill library can be grasping skills, etc. The specific forms of expression of the skills are no longer exhaustively listed here. Through the above-mentioned method, a variety of specific implementation methods of the skills are provided, which expands the application scenarios of the present solution and improves the comprehensiveness of the present solution.
[0111] Specifically, in one implementation, since the server is used to train the neural network and the skill library based on a variety of different tasks, that is, a variety of neural networks and skill libraries can be stored on the server, the first neural network can be a neural network trained based on the simulation environment corresponding to the second task, that is, the first neural network can be a mature first neural network in at least one pre-trained neural network. Correspondingly, the server can determine the skill library corresponding to the first neural network as the skill library. More specifically, the first neural network can be selected from at least one pre-trained neural network by a technician in this field, and then the server obtains the first neural network selected by the technician in this field; or the server can autonomously select the first neural network from at least one pre-trained neural network, wherein the semantic information of the first task is similar to the semantic information of the second task. Specifically, the similarity of the semantic information of the first task and the semantic information of the second task can refer to the use of the neural network to obtain the semantic information of the first task and the second task. The information is compared to determine whether the semantic information of the first task is similar to the semantic information of the second task; the constraint conditions obtained by decomposing the first task and the second task are similar. For example, the constraint conditions obtained by decomposing the first task are exiting the roundabout, the traffic flow is 5 seconds / vehicle, and the vehicle has a lane-changing function, and the constraint conditions obtained by decomposing the second task are exiting the roundabout, the traffic flow is 5 seconds / vehicle, and the vehicle does not have a lane-changing function. In this case, the semantic information of the first task can be regarded as similar to the semantic information of the second task; the operating environment of the first task and the second task can be similar. For example, the operating environment of the first task is a roundabout with a traffic flow of 5 seconds / vehicle and a lane-changing function for vehicles, and the operating environment of the second task is an overpass with a traffic flow of 5 seconds / vehicle and a lane-changing function for vehicles. In this case, the semantic information of the first task can be regarded as similar to the semantic information of the second task. Of course, other methods can also be used to determine whether the semantic information of the first task is similar to the semantic information of the second task. The examples given here are only for the convenience of understanding of this solution, and all implementation methods are not exhaustive.
[0112] In another implementation, the server may also initialize a first neural network after determining the first task and the neural network type of the first neural network, and initially train a skill library based on the simulation environment corresponding to the first task and using a reinforcement learning algorithm; in another implementation, the server may also initialize a first neural network after determining the first task and the neural network type of the first neural network, and then a technician in this field may configure at least one skill in the skill library according to the first task, and so on. Since the skills in the skill library may be expanded in subsequent steps, the number of skills in the skill library does not need to be particularly large.
[0113] More specifically, the server inputs the environmental status information into the first neural network to obtain the skills selected by the first neural network from the skill library, wherein the environmental status information may include the environmental information around the smart device in the simulation environment corresponding to the first task and the smart device's own status information, specifically including map information around the smart device, destination information of the smart device, movement information of adjacent smart devices, movement information of the current smart device or other types of environmental information, etc. As an example, for example, the embodiment of the present application is applied to the field of autonomous driving, and the environmental status information may include the distance to adjacent vehicles, the driving direction of the relative vehicle relative to the driving vehicle, the speed of the relative vehicle relative to the driving vehicle, the speed of the driving vehicle, the direction of the driving vehicle, the distance between the driving vehicle and the destination, etc.
[0114] Further, the environmental state information can be input into the first neural network in the form of an image, a sequence data or other data forms. The neural network type of the first neural network can be determined according to the data type of the input data. For example, if the input data is image data, the first neural network can use a convolutional neural network (CNN). For example, if the input data is sequence data, the first neural network can use a recurrent neural network (RNN), etc. Other situations are not listed here one by one; the output of the first neural network can be a serial number corresponding to the skill, that is, the server can pre-configure a serial number for each skill in the skill library, so that the corresponding skill can be found according to the serial number output by the first neural network, that is, the skill can be selected from the skill library. The server can store the mapping relationship between the serial number and the single skill in a table, array, index or other form. The following is an example of storing the mapping relationship between a single skill and the serial number in the form of a table. Please refer to the following Table 1.
[0115] Table 1
[0116] Serial Number Skill 68 Skill 1 69 Skill 2 70 Skill 3 71 Skill 4
[0117] As shown in Table 1 above, 4 rows of data in the mapping relationship table between a single skill and a serial number are shown. In actual situations, the mapping relationship between a single skill and a serial number may include more or less data; the example in Table 1 shows 4 consecutive serial numbers, but in actual products, different skills may be configured with non-consecutive serial numbers; and skills 1 to 4 in Table 1 are all nicknames. In actual situations, skills 1 to 4 can be expressed as specific operating rules, neural networks, or interface numbers for calling a certain skill, etc. It should be understood that the examples in Table 1 are only for intuitively displaying the mapping relationship between a single skill and a serial number, so as to facilitate understanding of the present solution, and are not used to limit the present solution.
[0118] When the skill is specifically represented by a neural network, the input of the skill can also be environmental state information. Similar to the first neural network, the neural network type of the skill is also related to the data type of the skill input. The output of the skill can directly correspond to the operation rule. As an example, the output of the skill can be 60, which means that the car moves at a speed of 60 meters per second. The output of the skill can also be a serial number with a mapping relationship with the operation rule, that is, the server will store the mapping relationship between the serial number of the skill output and the operation rule represented by the skill. As an example, when the output of the skill is 2.23, it means that the car needs to turn the steering wheel to the right by 23 degrees; as another example, when the output of the skill is 1.58, it means that the car needs to turn the steering wheel to the left by 58 degrees, etc., which are not exhaustive here. Correspondingly, the server can also store the mapping relationship between the serial number of the skill output and the operation rule represented by the skill in a table, array, index or other form. The following is an example of storing the mapping relationship between the serial number of the skill output and the operation rule represented by the skill in the form of a table.
[0119] Table 2
[0120] Serial Number 1.2 1.3 1.4 Operation Rules Turn the steering wheel 20 degrees to the left Turn the steering wheel 30 degrees left Turn the steering wheel 40 degrees to the left Serial Number 3.4 3.45 3.5 Operation Rules Control vehicle speed to 40m / s Control vehicle speed to 45m / s Control vehicle speed to 50m / s
[0121] Please refer to Table 2 above, which shows some data between the mapping relationship between the sequence number of skill output and the operation rule represented by the skill. 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. To further understand this solution, the concepts of convolutional neural network and recurrent neural network are further introduced here. First, convolutional neural network, please refer to Figure 4 , Figure 4A schematic diagram of the structure of a convolutional neural network provided in an embodiment of the present application. A convolutional neural network (CNN) is a deep neural network with a convolutional structure and a deep learning architecture. A deep learning architecture refers to multiple levels of learning at different abstract levels through machine learning algorithms. As a deep learning architecture, it is a feed-forward artificial neural network in which each neuron responds to overlapping areas in an image input thereto. Figure 4 As shown, the convolutional neural network 100 may include an input layer 110 , a convolutional layer / pooling layer 120 , wherein the pooling layer is optional, and a neural network layer 130 .
[0122] Convolutional layer / pooling layer 120:
[0123] Convolutional Layer:
[0124] like Figure 4 The convolution layer / pooling layer 120 shown may include layers 121-126 as shown in the examples. In one implementation, layer 121 is a convolution layer, layer 122 is a pooling layer, layer 123 is a convolution layer, layer 124 is a pooling layer, layer 125 is a convolution layer, and layer 126 is a pooling layer. In another implementation, layers 121 and 122 are convolution layers, layer 123 is a pooling layer, layers 124 and 125 are convolution layers, and layer 126 is a pooling layer. That is, the output of a convolution layer can be used as the input of a subsequent pooling layer, or as the input of another convolution layer to continue the convolution operation.
[0125] Taking the convolution layer 121 as an example, the convolution layer 121 may include a plurality of convolution operators, which are also called kernels. The convolution operator is equivalent to a filter that extracts specific information from the input image matrix in image processing. The convolution operator can essentially be a weight matrix, which is usually predefined. In the process of performing convolution operations on the image, the weight matrix is usually processed one pixel after another (or two pixels after two pixels, etc., the number of pixels depends on the value of the stride) along the horizontal direction on the input image, so as 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. In the process of performing convolution operations, the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, a single weight matrix is not used, but multiple weight matrices of the same dimension are applied. The output of each weight matrix is stacked to form the depth dimension of the convolved image. Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to blur unnecessary noise in the image, etc. All weight matrices are not enumerated here. The multiple weight matrices have the same dimensions, and the feature maps extracted by the multiple weight matrices with the same dimensions are also the same in dimensions. The extracted feature maps with the same dimensions are then merged to form the output of the convolution operation.
[0126] The weight values in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values obtained through training can extract information from the input image, thereby helping the convolutional neural network 100 to make correct predictions.
[0127] When the convolutional neural network 100 has multiple convolutional layers, the initial convolutional layer (for example, 121) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 100 increases, the features extracted by the later convolutional layers (for example, 126) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
[0128] Pooling layer:
[0129] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer, such as Figure 4The layers 121-126 illustrated in 120 may be a convolution layer followed by a pooling layer, or may be multiple convolution layers followed by one or more pooling layers. In the image processing process, the only purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and / or a maximum pooling operator for sampling the input image to obtain an image of smaller size. The average pooling operator may calculate the pixel values in the image within a specific range to generate an average value. The maximum pooling operator may take the pixel with the largest value within 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 may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average value or maximum value of the corresponding sub-region of the image input to the pooling layer.
[0130] Neural network layer 130:
[0131] After being processed by the convolution layer / pooling layer 120, the convolution neural network 100 is not sufficient to output the required output information. As mentioned above, the convolution layer / pooling layer 120 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network 100 needs to use the neural network layer 130 to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer 130 may include multiple hidden layers (such as Figure 4131, 132 to 13n) and the output layer 140 shown, the parameters contained in the multi-layer hidden layer can be pre-trained according to the relevant training data of the specific task type, for example, the task type can include image processing and skill selection after image processing, wherein the image processing part can include image recognition, image classification, image super-resolution reconstruction, etc., after the image is processed, the skill selection can be performed according to the acquired image information; as an example, for example, in the present application applied to the field of self-driving, the neural network is specifically manifested as a convolutional neural network and the task is to exit the roundabout, that is, the environmental image is input into the convolutional neural network of the neural network, then the convolutional neural network needs to identify the car, the roundabout exit, the lane and other information in the environmental image, and then obtain the vehicle spacing information, the distance information from the roundabout exit, the lane change operation to be performed and other information, and then determine the driving skills for executing the task of exiting the roundabout in combination with the aforementioned environmental status information; optionally, when the pixels of the collected image are too low, it is also necessary to perform an image super-resolution reconstruction operation to increase the accuracy of the image, etc. As another example, for example, the present application is applied to a robotic arm that grasps parts, and the neural network is specifically a convolutional neural network and the task is to place the appropriate parts into the correct container at a rate of 20 parts per minute. The environmental image can be input into the convolutional neural network, and the convolutional neural network needs to identify various types of parts (with different specifications, materials, etc.) and different parts containers in the environmental image, and then obtain information such as the type of parts and parts containers, the correspondence between parts and parts containers, and the distance between parts and parts containers. Then, the convolutional neural network needs to select the grasping skills to complete the part grasping task from the skill library based on the aforementioned information, and the examples are not exhaustive here.
[0132] After the multiple hidden layers in the neural network layer 130, that is, the last layer of the entire convolutional neural network 100 is the output layer 140, which has a loss function similar to the classification cross entropy, specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network 100 (such as Figure 4 The propagation from 110 to 140 is forward propagation), and the reverse propagation (such as Figure 4 The propagation from 140 to 110 is called back propagation) and then the weight values and biases of the aforementioned layers will begin to be updated to reduce the loss of the convolutional neural network 100 and the error between the result output by the convolutional neural network 100 through the output layer and the ideal result.
[0133] It should be noted that if Figure 4 The convolutional neural network 100 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models, for example, Figure 5The multiple convolutional layers / pooling layers shown are operated in parallel, and the features extracted respectively are input to the full neural network layer 130 for processing.
[0134] Next, we will introduce recurrent neural networks (RNNs). 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 the next word in a sentence, 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. Specifically, as an example, for example, in the present application applied to the field of self-driving, the neural network is specifically manifested as a recurrent neural network and the task is to drive out of the roundabout, that is, the acquired environmental image is preprocessed to obtain sequence data carrying environmental state information, so that the aforementioned sequence data can be input into the recurrent neural network of the neural network, and then the recurrent neural network can directly use the input environmental state information to obtain vehicle spacing information, distance information from the roundabout exit, lane change operations that need to be performed and other information, and then combine the aforementioned environmental state information to determine the skills to perform the task, etc. It should be understood that the server can also use other types of neural networks to implement the functions of the neural network, and other types of neural networks will not be introduced one by one here.
[0135] 303. The server obtains control instructions through the skills selected by the first neural network to control the smart device to perform the first task.
[0136] In some embodiments of the present application, after acquiring the first task and the first neural network, the server may first obtain control instructions through the skills selected by the first neural network to control the intelligent device to perform the first task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first task; specifically, the server will input environmental state information into the first neural network to obtain the skills selected by the first neural network, the environmental state information including environmental information around the intelligent device in the simulation environment corresponding to the first task and the intelligent device's own state information; the server may obtain control instructions through the skills selected by the first neural network to control the intelligent device to perform the first task. More specifically, the server can input the acquired environmental status information into the first neural network to obtain the first serial number output by the first neural network, and then select a skill matching the first serial number from the skill library according to the first serial number output by the first neural network, and then control the intelligent device to perform the first task by executing the control instructions corresponding to the skill selected by the first neural network; of course, the server can complete the first task through one or at least two skills. In the case where the server completes the first task through at least two skills, after the server determines that one skill has been executed, it will determine whether the first task has been completed. If completed, the execution ends; if not completed, the next skill is selected from the skill library through the first neural network again, and then when the next skill is executed, it is determined again whether the first task has been completed, and the aforementioned steps are repeated until the first task is completed through at least two skills.
[0137] More specifically, the server can pre-set the execution time of each skill, where the execution time of the skill can be T timestamps, and the value of T can be 6, 8, 10, 12, 15, 18, 20, etc. The specific value of T can be determined in combination with the actual application scenario and is not limited here. For a more intuitive understanding of this solution, please refer to Figure 6 , Figure 6 A schematic diagram of using skills to perform a first task in the neural network acquisition method provided in an embodiment of the present application, Figure 6 In the example of performing the first task by using at least two skills, π h It represents the operation process of the first neural network, π s It represents the operation process of at least two skills. t It represents the environmental state at time t, S t+1 It represents the environmental state at time t+1, S t+Trepresents the state of the environment at time t+T, A1 represents the skill selected by the server through the first neural network at time t, and A2 represents the skill selected by the server through the first neural network at time t+T. Since A1 selected at time t has run T timestamps, the server needs to select a new skill A2 through the first neural network again at time t+T to continue to execute the first task. In addition, r t represents the feedback value obtained after A1 is executed from time t to time t+1, r t+1 represents the feedback value obtained after A1 is executed from time t+1 to time t+2, r t+T-1 represents the feedback value obtained after A1 is executed from time t+T-1 to time t+T, r t 、r t+1 and r t+T-1 can be directly derived from the environment, or obtained from the feedback value after executing a skill. t 、r t+1 and r t+T-1 The generation method of is described in detail, which will not be repeated here. It should be understood that Figure 6 The example is only for the convenience of understanding the concept of reselecting a skill every T timestamps, and is not used to limit this solution. The way for the server to determine that a skill has been executed can be that the server performs an execution status acquisition operation of the skill every preset time until the execution status of the skill is completed, where the length of the preset time can be 0.1 seconds, 800 Hz, 600 Hz or other lengths, etc. The specific length of the preset time can be determined in combination with the actual application scenario and is not limited here.
[0138] Furthermore, the server side may be configured with a simulator, which is used to provide an environment for performing the first task, that is, the server is the environmental status information collected from the simulator, and the smart device is also a virtual object running in the simulated environment. As an example, if the simulation is of a scene of exiting a toll station in automatic driving, the simulator can be used to display a scene of multiple cars (an example of a smart device) exiting a toll station; as another example, if the simulation is of a scene of a warehouse robot (an example of a smart device) carrying goods, the simulator can be used to display a scene of multiple warehouse robots performing carrying tasks in a warehouse, and so on. Other scenarios will not be given examples one by one here.
[0139] The environmental status information input by the server to the first neural network may be specifically expressed as environmental image information, or environmental status information in the form of sequence data, or environmental status information in other data forms, etc., which is not limited here. Since the above introduction to the convolutional neural network and the recurrent neural network has already given an example of inputting the environmental status information corresponding to the first task into the first neural network, it will not be repeated here.
[0140] 304. The server determines whether the loss function of the first neural network converges. If the loss function does not converge, execute step 305; if the loss function converges, execute step 307.
[0141] In some embodiments of the present application, after the server completes the first task at least once through the first neural network, it can determine whether the loss function of the first neural network converges, and then if the loss function does not converge, step 304 can be executed, and if the loss function converges, step 306 can be executed directly. Among them, the convergence condition of the loss function of the first neural network can be that the function value rises to a stable numerical range, or that the function value decreases to a stable numerical range, etc.; the loss function of the first neural network can be determined according to the type of reinforcement learning algorithm used when training the first neural network, and different reinforcement learning algorithms correspond to different loss functions. Specifically, the server can display the function value of the loss function of the first neural network in the form of a line graph, so that it can intuitively feel whether the loss function of the first neural network converges. The specific display method is not limited here. More specifically, the type of reinforcement learning algorithm used when training the first neural network may include a proximal policy optimization (PPO) algorithm, a trust region policy optimization (TRPO) algorithm, a temporal-difference learning (TD) algorithm, or other reinforcement learning algorithms of the same strategy. Here, when the first neural network adopts the PPO algorithm as an example, an example of the loss function adopted by the first neural network is given, and the formula of the loss function may be specifically as follows:
[0142]
[0143] Where T represents the number of timestamps included in the execution time of a skill, π h,θ and θ represent the parameters of the first neural network, π s,t represents the skill selected by the first neural network at time t, s t represents the environmental status information at time t, π h,oldRepresents the network model of the first neural network saved before the last training, is the function value of the advantage function of the neural network after the skill is executed from time t to time t+T, which can be specifically expressed as R represents the feedback value obtained from the skill execution from time t to time t+T. γ refers to the discounted factor. The value range of γ is 0 to 1, which can be expressed as a continuous value. In actual implementation, the value of γ can be very close to 1. t+T Represents the environmental status information at time t+T, represents the state value function of the neural network, KL divergence (Kullback–Leibler divergence, KL divergence) represents the asymmetric measure of the difference between two probability distributions, which is used to limit the changes between two trainings, and β represents the hyperparameter of KL divergence, which is used to control the size of the limitation.
[0144] It should be understood that the above example of the loss function of the first neural network is only to prove the feasibility of this solution. When the first neural network adopts other types of reinforcement learning algorithms, other loss functions will be selected accordingly. The specific form of expression of the loss function of the first neural network is not limited here.
[0145] It should be noted that the relationship between the number of executions of step 303 and step 304 is not limited in the embodiment of the present application. Step 304 may be executed once after executing step 303 at least twice, that is, after executing the first task at least twice through the first neural network, it is determined whether the loss function of the first neural network converges; or step 304 may be executed directly after executing step 303 once.
[0146] 305. The server trains the first neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first task.
[0147] In some embodiments of the present application, if it is determined through step 304 that the loss function of the first neural network has not converged, then based on the simulation environment corresponding to the first task, the first neural network is trained multiple times using a reinforcement learning algorithm, wherein the number of times the server trains the first neural network should be determined in combination with actual conditions and is not limited here. Specifically, in the process of the server training the first neural network once using a reinforcement learning algorithm based on the simulation environment corresponding to the first task, the first task will be completed by at least one skill selected by the first neural network, and in the process of the server controlling the intelligent device to perform the first task, data of the intelligent device performing the first task will be obtained, and the parameters of the first neural network will be updated using a third reinforcement learning algorithm.
[0148] More specifically, the server inputs the environmental state information into the first neural network to obtain the skill selected by the first neural network, the environmental state information includes the environmental information around the intelligent device in the simulation environment corresponding to the first task and the state information of the intelligent device itself, and the skill selected by the first neural network to perform the first task is obtained through the skill selected by the first neural network, and then the control instruction can be controlled in the simulator to perform the operation corresponding to the control instruction. During the execution process, the server performs an execution state acquisition operation for the skill selected by the first neural network every preset time until the execution state of the skill selected by the first neural network is the end of execution; the server obtains the data generated during the operation corresponding to the execution of the control instruction by the intelligent device, and the data includes any one or more of the operation path, operation speed or operation destination of the intelligent device; the server updates the parameters of the first neural network based on the data using the third reinforcement learning algorithm. Among them, the concepts of intelligent device, preset time, and execution state are all introduced in detail in the above description, and will not be repeated here. In the embodiment of the present application, the server determines whether the skill selected by the first neural network is finished by obtaining the execution state of the skill selected by the first neural network once every preset time, so that the server can timely iterate and update the new skill strategy and the parameters of the new skill according to the operation behavior information of the intelligent device, which is conducive to improving the accuracy of the training process.
[0149] Further, the server obtains a feedback value (R) obtained in the process of the smart device executing an operation corresponding to the skill selected by the first neural network based on the data generated during the operation corresponding to the control instruction executed by the smart device. Then, the server determines the advantage function and loss function of the first neural network according to the third reinforcement learning algorithm, and brings the feedback value (R) into the advantage function of the first neural network, and then obtains the function value of the loss function of the first neural network according to the function value of the advantage function of the first neural network, so as to gradient update the parameters of the first neural network according to the function value of the loss function of the first neural network. The type of the third reinforcement learning algorithm may include a proximal policy optimization (PPO) algorithm, a trust region policy optimization (TRPO) algorithm, a temporal difference (TD) algorithm or other reinforcement learning algorithms of the same strategy type, etc., which are not specifically limited here. Since the advantage function and loss function adopted by the first neural network when the third reinforcement learning algorithm is the PPO algorithm have been introduced in detail in step 304, no example is given here.
[0150] 306. The server determines whether the loss function of the first neural network can converge. If not, the process re-enters step 302. If it can converge, a mature first neural network is obtained.
[0151] In some embodiments of the present application, since in some implementations, the first neural network is trained based on the simulation environment corresponding to the second task, during the process of the server training the first neural network based on the simulation environment corresponding to the first task, there may be a situation where the loss function of the first neural network cannot converge. Specifically, for example, when the implementation methods of the first task and the second task are too different, it may cause the loss function of the first neural network to fail to converge. As an example, for example, the first task and the second task are both applied to the field of autonomous driving, the first task is to exit the roundabout, and the second task is to exit the toll station. The server uses a reinforcement learning algorithm based on the simulation environment corresponding to the exit of the roundabout to re-train the first neural network (the neural network trained based on the simulation environment corresponding to the exit of the toll station). There is a possibility that the loss function of the first neural network cannot converge. Of course, there is also the possibility that the loss function of the first neural network cannot converge in other situations, and other situations are not listed one by one here.
[0152] In the process of training the first neural network, the server can determine whether the loss function of the first neural network can converge. If it cannot converge, the first neural network whose loss function cannot converge can be abandoned, and step 301 can be re-entered, so that the server can re-select a new first neural network through step 301; if it can converge, the server trains the first neural network until the convergence condition of the loss function of the first neural network is reached, so that a mature first neural network can be obtained; specifically, the server can determine when the loss function of the first neural network can converge according to the function value trend of the loss function of the first neural network. If the function value of the loss function of the first neural network presents a random distribution state, it can be regarded that the loss function of the first neural network cannot converge, and step 301 can be entered to re-acquire a new first neural network; if the function value of the loss function of the first neural network presents a stable upward trend or downward trend, the first neural network can be trained until the convergence condition of the loss function of the first neural network is reached, so that a mature first neural network can be obtained.
[0153] It should be understood that steps 302 to 306 are optional steps. If the first neural network is obtained by training based on the simulation environment corresponding to the second task, step 307 can be directly executed after step 301 is executed; if the first neural network is a neural network initialized by the server with the first task as the target, steps 303, 304 and 306 may not be executed, but after step 302 is executed, the first neural network is directly trained through step 305 until the convergence condition of the loss function of the first neural network is reached to obtain a mature first neural network. In the case where the first neural network is a neural network trained based on the simulation environment corresponding to the second task, the first neural network obtained may not be suitable for executing the first task. Since the neural network whose loss function has not yet converged is not stable, it will lead to instability in the subsequent task execution process. Excluding the first neural network whose loss function cannot converge, that is, excluding the unstable neural network, is conducive to improving the security of the neural network finally obtained, that is, improving the security of the smart product running the neural network.
[0154] 307. The server obtains a first success rate of the first neural network for completing the first task.
[0155] In the embodiment of the present application, after acquiring the first task, the server needs to obtain a first success rate of the first neural network for completing the first task. Further, if steps 302 to 306 are all executed, step 307 may specifically include obtaining a success rate of the mature first neural network for completing the first task as the first success rate.
[0156] Specifically, in one implementation, the server may input the environmental state information into the first neural network to obtain the skill selected by the first neural network, wherein the environmental state information includes the environmental information around the intelligent device in the simulation environment corresponding to the first task and the self-state information of the intelligent device; the control instruction is obtained through the skill selected by the first neural network to control the intelligent device to perform the first task; the above steps are repeated until the number of times the first task is completed by the first neural network reaches the first number; the number of times the result of completing the first task in the first number is successful is counted to obtain the second number; the first success rate is calculated according to the first number and the second number. Wherein, the result of completing the first task includes success and failure. As an example, for example, if the first task is to drive from one intersection to another intersection at an intersection, then when the car safely drives out from the correct intersection, it is considered a success. If the car collides, drives out of the road, drives out from the wrong intersection, etc. during the process of driving through the intersection, it is considered a failure; the value of the first number can be determined in combination with the processing efficiency of the simulator, the complexity of the first task, etc., as an example, for example, the value of the first number can be 500 times, 600 times or other values, etc.; it should be understood that the examples here are only for the convenience of understanding.
[0157] More specifically, the specific implementation method of the server completing the first task through the first neural network each time is similar to step 303, which will not be repeated here. After obtaining the second number, the server can calculate the ratio of the second number to the first number, and then determine the ratio of the second number to the first number as the first success rate; or there may be a mapping relationship between the ratio of the second number to the first number and the first success rate, and then determine the first success rate according to the ratio of the second number to the first number and the mapping relationship. Among them, in this implementation method, a simulator can be arranged on the server. Since the server controls the intelligent device to repeatedly perform the first task through the first neural network in the simulator during the experiment, the first success rate is obtained by restoring the real scene to improve the accuracy of the first success rate.
[0158] In another implementation, the first neural network is trained by using a third reinforcement learning algorithm based on a simulation environment corresponding to the second task, the semantic information of the first task is similar to the semantic information of the second task, and the server obtains a first success rate of the first neural network for completing the first task, including: the server obtains the semantic information of the first task, and obtains the semantic information of the second task, and obtains the first success rate based on the similarity between the semantic information of the first task and the semantic information of the second task, wherein the higher the similarity, the higher the first success rate.
[0159] More specifically, in one implementation, after acquiring the first task and the second task, the server may use a neural network to respectively acquire semantic information of the first task and the second task, and generate a similarity between the first task and the second task based on the semantic information of the first task and the second task. In another implementation, after acquiring the first task and the second task, the server may further decompose the first task to obtain at least one constraint condition, and decompose the second task to obtain at least one constraint condition, and determine the similarity between the semantic information of the first task and the semantic information of the second task by comparing each constraint condition of the first task and the second task one by one. As an example, for example, the first task is for the car to exit the roundabout, and the traffic flow at the entrance of the roundabout is one car every 5 seconds. The car can drive in any lane of the roundabout, that is, there is a lane changing function. The second task is for the car to exit the roundabout, and the traffic flow at the entrance of the roundabout is one car every 2.5 seconds. The car has a lane changing function. After decomposing the first task, the constraints include exiting the roundabout, the traffic flow is one car every 5 seconds, and there is a lane changing function. After decomposing the second task, the constraints include exiting the roundabout, the traffic flow is one car every 2.5 seconds, and there is a lane changing function. Then, each constraint condition of the first task and the second task can be compared to determine the similarity between the semantic information of the first task and the semantic information of the second task, etc. Of course, other methods can also be used to determine the similarity between the semantic information of the first task and the semantic information of the second task, which will not be given one by one here. After obtaining the similarity between the semantic information of the first task and the semantic information of the second task, the server can generate a first success rate based on the similarity, wherein the higher the similarity, the higher the first success rate. Specifically, the server can directly determine the similarity between the first task and the second task as the first success rate; or there can be a mapping relationship between the similarity and the first success rate, so that after obtaining the similarity, the first success rate can be determined based on the mapping relationship between the similarity and the first success rate, and so on. In this implementation, the first success rate of the first neural network for completing the first task is determined by obtaining the similarity between the semantic information of the first task and the semantic information of the second task, providing another implementation method for obtaining the first success rate, and expanding the application scenario of this solution; and in this method, it is no longer necessary to repeatedly perform the first task through the first neural network, thereby improving the efficiency of obtaining the first success rate.
[0160] 308. The server determines whether the first success rate is greater than or equal to a preset threshold. If so, the process proceeds to step 309; if less than the preset threshold, the process proceeds to step 311.
[0161] In the embodiment of the present application, a preset threshold is set on the server. After the server obtains the first success rate, it can determine whether the first success rate is greater than or equal to the preset threshold. If it is greater than or equal to the preset threshold, it proceeds to step 309, and if it is less than the preset threshold, it proceeds to step 312. The preset threshold on the server can be presented in the form of 1-ε, where the value of ε is close to 0 but not equal to 0. For example, the value of the preset threshold can be 99%, 98% or other values, etc., which are not specifically limited here.
[0162] 309. The server determines the first neural network as a neural network for completing the first task.
[0163] In some embodiments of the present application, when the server determines that the first success rate is greater than or equal to a preset threshold, it proves that the first neural network is sufficient to be used directly to perform the first task, so that the server can determine the first neural network as a neural network for performing the first task, and determine the skill library as a skill library for performing the first task.
[0164] 310. The server stores the first neural network and the skill library.
[0165] In some embodiments of the present application, after the server determines the first neural network as a neural network for completing the first task and determines the skill library as a skill library for completing the first task, the first neural network and the skill library may be stored, and then the first neural network and the skill library may be configured on an intelligent device for performing the first task, wherein the intelligent device refers to the above-mentioned Figure 1 The smart product described in the corresponding embodiment. Specifically, the server can send the first neural network and the skill library to the smart product wirelessly; or the smart device can be connected to the server by wire before it leaves the factory, and the server configures the first neural network and the skill library to the smart device; or the server can store the first neural network and the skill library to a removable storage device, such as Bluetooth, a mobile hard disk, etc., so as to configure the first neural network and the skill library to the smart device through the removable storage device, etc. The specific method is not limited here. As an example, for example, if the smart device is a smart car, and the first task is to exit the roundabout during the automatic driving process, the service can send the first neural network and skills used to execute the task of exiting the roundabout to the smart car. The example here is only for the convenience of understanding this solution.
[0166] In an embodiment of the present application, after acquiring the first task, the server can obtain a first success rate of the first neural network for completing the first task. When the first success rate is greater than or equal to a preset threshold, the first neural network can be directly determined as the neural network for performing the first task, and then the first neural network and the skill library can be stored to configure the first neural network and the skill library to the intelligent device that performs the first task, thereby improving the completeness of the present solution; when the first neural network is a neural network trained based on a simulation environment corresponding to the second task, the reuse of the upper neural network and the lower skill library is achieved, saving time and training resources in the neural network training process, and greatly improving the efficiency of the neural network training process.
[0167] 311. The server obtains the second neural network and the new skill, adds the new skill to the skill library, and obtains an updated skill library.
[0168] In some embodiments of the present application, when the server determines that the first success rate is less than the preset threshold, it proves that the first neural network is not sufficient to be directly used to complete the first task, that is, the skills in the skill library cannot achieve the successful completion of the first task, so that the server can generate a new skill, add the new skill to the skill library, and obtain an updated skill library. The new skill is specifically manifested as a neural network. The type of neural network corresponding to the new skill needs to be determined according to the data type of the environmental state information. For details, please refer to the above-mentioned introduction to the type of neural network of the skills in the skill library, which will not be repeated here. After determining the network type of the new skill, the server generates the new skill. As an example, for example, the second task is for the car to drive out of the roundabout, and the traffic flow at the entrance of the roundabout is one car every 5 seconds. The car can only be in the outer lane of the roundabout, and there is no lane change function. The first task is for the car to drive out of the roundabout, and the traffic flow at the entrance of the roundabout is one car every 5 seconds. The car can drive in any lane of the roundabout, that is, there is a lane change function. Then the new skill can be specifically a lane change skill. The example here is not used to limit this solution.
[0169] Correspondingly, due to the increase in the number of skills in the skill library, the original first neural network is not sufficient to realize the selection operation of the skills in the new updated skill library. The server needs to generate a new second neural network. The second neural network is used to select skills from the updated skill library to complete the first task. The neural network type of the second neural network is the same as the network type of the first neural network. It will not be introduced in detail here. However, since the number of skills in the updated skill library is greater than the number of skills in the skill library before the update, that is, the processing objects of the second neural network are more than the processing objects of the first neural network, the output channel of the output layer of the second neural network is more than that of the first neural network, and the parameters of the second neural network are likely to be more than those of the first neural network. The skills selected by the second neural network can be specifically expressed as new skills, or they can be non-new skills.
[0170] 312. The server uses the parameters of the first neural network to initialize the parameters of the second neural network.
[0171] In some embodiments of the present application, after generating the second neural network, the server can obtain the parameters of the first neural network, and use the parameters of the first neural network to initialize the parameters of the second neural network. Specifically, since the number of parameters of the second neural network may be greater than the number of parameters of the first neural network, the server can use the parameters of the first neural network to initialize some parameters of the second neural network, as well as initialize the parameters that exist in the second neural network but not in the first neural network. Furthermore, in the case where the first neural network is a neural network trained based on the simulation environment corresponding to the second task, the parameters of the second neural network can be initialized using the parameters of the trained first neural network in the above manner, which can directly inherit the capabilities learned by the first neural network, shorten the training process of the second neural network, and improve the training efficiency of the second neural network.
[0172] It should be understood that step 312 is an optional step. If step 312 is not performed, after generating the second neural network, the parameters of the second neural network may not be initialized using the parameters of the first neural network, but all the parameters of the second neural network may be directly initialized.
[0173] 313. The server trains the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first task until a second success rate of the second neural network for completing the first task is greater than or equal to a preset threshold.
[0174] In some embodiments of the present application, after initializing the second neural network and the new skill, the server needs to train the second neural network based on the simulation environment corresponding to the first task using the first reinforcement learning algorithm until the loss function of the second neural network meets the convergence condition, and then obtain the second success rate for completing the first task through the second neural network, and judge whether the second success rate is greater than or equal to the preset threshold. Optionally, since the server selects the skill for completing the first task from the updated skill library through the second neural network, it can be judged whether the skill selected by the second neural network is a new skill. In the case that the skill selected by the second neural network is a new skill, the server can also iteratively train the new skill based on the simulation environment corresponding to the first task using the second reinforcement learning algorithm. Then, the server can obtain the second success rate for completing the first task through the second neural network after the loss function of the second neural network and the loss function of the new skill meet the convergence condition, and judge whether the second success rate is greater than or equal to the preset threshold. The specific implementation method in which the server uses the second neural network to select skills for completing the first task from the updated skill library is similar to the specific implementation method in which the server uses the first neural network to select skills from the skill library. The only difference is that the number of skills in the updated skill library is greater than the number of skills in the skill library. Therefore, the specific implementation method can refer to the above description and will not be described in detail here.
[0175] If the second success rate is greater than or equal to the preset threshold, the server will determine the maturely trained second neural network as the neural network for performing the first task, and then enter step 314; if the second success rate is less than the preset threshold, re-enter step 312, that is, generate a new skill and a new second neural network again, add the new skill to the updated skill library, obtain a skill library that has been updated again, initialize and train the new second neural network and the new skill until the loss function of the new second neural network and the loss function of the new skill both meet the convergence conditions, obtain the second success rate of performing the second task through the new second neural network again, and judge again whether the second success rate is greater than or equal to the preset threshold. If it is greater than or equal to the preset threshold, enter step 314; if it is less than the preset threshold, enter step 312 again, and repeat the above steps until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and then obtain the final second neural network and the corresponding updated skill library.
[0176] In an embodiment of the present application, the process of the server training the second neural network may include that the server trains the second neural network once. Specifically, the server inputs the environmental state information into the second neural network, obtains the skills selected by the second neural network, and the environmental state information includes the environmental information around the intelligent device in the simulation environment corresponding to the first task and the self-state information of the intelligent device. The control instructions are obtained through the skills selected by the second neural network to control the intelligent device to perform the first task, and the data of the intelligent device performing the first task is obtained. According to the data of the intelligent device performing the first task, the parameters of the second neural network are updated using the first reinforcement learning algorithm. In an embodiment of the present application, a specific implementation method for the server to train the second neural network is provided, which improves the executability of the scheme. The specific implementation method for the server to train the second neural network once is similar to the specific implementation method for the server to train the first neural network once, except that the processing object of the former is the first neural network, and the processing object of the latter is the second neural network. The specific implementation method for the server to train the second neural network once can refer to the description in step 305, which will not be repeated here.
[0177] Further, in the application of the present invention in the field of autonomous driving, the data generated during the operation corresponding to the execution of the control instruction by the intelligent device may include the driving speed, driving path, driving collision situation, driving destination or other driving behavior information of the intelligent device, etc.; in the application of the present invention in the field of freight, the data generated during the operation corresponding to the execution of the control instruction by the intelligent device may include the transportation path, driving speed, collision situation or other transportation behavior information of the intelligent device; in the application of the present invention in the intelligent mechanical arm, the data generated during the operation corresponding to the execution of the control instruction by the intelligent device may include any one or more of the grasping path, grasping speed or grasping destination position of the intelligent device, etc. Through the above method, the specific content of the operation behavior information is further provided, thereby further improving the executability of the present solution; and the specific content of the operation behavior information in different fields is provided, thereby improving the implementation flexibility of the present solution. The type of the first reinforcement learning algorithm may include the proximal policy optimization (PPO) algorithm, the trust region policy optimization (TRPO) algorithm, the time difference (TD) algorithm or other reinforcement learning algorithms of the same strategy class, etc., which are not specifically limited here. Through the above method, a specific implementation method of the reinforcement learning algorithm adopted by the second neural network is provided, which improves the feasibility of the present solution and also enables those skilled in the art to have more choices, thereby improving the implementation flexibility of the present solution. In addition, since the advantage function and loss function adopted by the first neural network when the first reinforcement learning algorithm is the PPO algorithm have been introduced in detail in step 304, and the advantage function and loss function adopted by the second neural network can be the same as the advantage function and loss function adopted by the first neural network, they are not introduced again here by examples.
[0178] During the process of training the second neural network, after the server selects the skill for performing the first task from the updated skill library through the second neural network, it will determine whether the skill selected by the second neural network is a new skill. If the skill selected by the second neural network is a new skill, the server will update the parameters of the new skill based on the data of the first task performed by the smart device acquired by the server using the second reinforcement learning algorithm; if the skill selected by the second neural network is not a new skill, the server will not update the parameters of the skill selected by the second neural network. Through the aforementioned method, the different skills in the updated skill library can maintain a large degree of distinction, thereby reducing the storage redundancy of the updated skill library; in addition, if the parameters of skills that are not newly generated are also updated, the evolution direction of the skills in the updated skill library is out of control. Only updating the newly generated skills is conducive to guiding the gap in skill requirements between the first task and the second task of learning the new skill.
[0179] Specifically, the server obtains data in the process of obtaining the intelligent device to execute a control instruction corresponding to the skill selected by the second neural network (that is, the new skill), and can determine the loss function of the new skill according to the second reinforcement learning algorithm used when training the new skill. After obtaining the function value of the loss function of the new skill, the parameters of the new skill are updated by gradient. The type of the second reinforcement learning algorithm used by the new skill may include a same-strategy reinforcement learning algorithm or an off-strategy reinforcement learning algorithm, such as a deep deterministic policy gradient (DDPG) algorithm, a deep Q network (DQN) algorithm, a PPO algorithm, or a soft actor-critic (SAC) algorithm, etc. The specifics are not limited here. Through the above method, a specific implementation method of the reinforcement learning algorithm used by the new skill is provided, which improves the feasibility of the present solution and enables technical personnel in this field to have more choices, thereby improving the implementation flexibility of the present solution.
[0180] This time, we take the second reinforcement learning algorithm that also uses the PPO algorithm as an example to illustrate the advantage function and loss function used by the new skill. Since the second reinforcement learning algorithm also uses the PPO algorithm, the loss function used by the new skill is also consistent with the loss function used by the first neural network mentioned above, so the loss function used by the new skill is no longer an example here, but the loss function of the new skill is Compared with the loss function of the first neural network The calculation method of the new skill is different. The following will introduce the loss function of the new skill in detail. The calculation method of It can be obtained by the following formula:
[0181]
[0182] Among them, r represents the feedback value obtained from the execution of the new skill from time t to time t+1. r can be directly calculated based on the operation behavior information obtained by the server from time t to time t+1 when the smart device executes the operation corresponding to the new skill, or it can be calculated based on the feedback value obtained from the execution of the second neural network from time t to time t+T. Here, taking r calculated based on the feedback value of the second neural network as an example, the value of r can be the ratio of the function value of the advantage function of the neural network from the execution of the skill selected by the second neural network from time t to time t+T to T. Therefore, after obtaining the feedback value (R) obtained in the process of the smart device executing the operation corresponding to the skill selected by the second neural network once according to the operation behavior information of the smart device, the function value of the advantage function of the neural network from the execution of the skill selected by the second neural network from time t to time t+T can be obtained, and then r can be obtained, and then the new skill loss function can be obtained. s t+1 represents the environmental status information at time t+1, A state-value function representing the new skill.
[0183] It should be understood that even if the second reinforcement learning algorithm still adopts the PPO algorithm, in other implementations, The value of can be directly r. When the second reinforcement learning algorithm adopts other algorithms, the advantage function and loss function of the new skill can also be changed accordingly. The above example of the calculation method of the function value of the advantage function of the new skill is only to prove the feasibility of this scheme and is not used to limit this scheme.
[0184] Further, the server obtains the feedback value (R) obtained in the process of the intelligent device performing an operation corresponding to the skill selected by the second neural network based on the data of the intelligent device performing the first task, which can be specifically that the server compares each type of information in the operation behavior information of the intelligent device obtained from time t to time t+T with the expected state, and gives positive feedback if the expected state is met; if the expected state is not met, negative feedback is given. Specifically, positive feedback is given when the operation path of the intelligent device meets the expected operation path, otherwise negative feedback is given; positive feedback is given when the operation speed of the intelligent device meets the expected operation speed, otherwise negative feedback is given; positive feedback is given when the operation destination of the intelligent device meets the expected operation destination, otherwise negative feedback is given. As an example, for example, when the embodiment of the present application is applied to the field of autonomous driving, the car in the simulator maintains the expected average speed to give positive feedback; the car drives according to the correct route to give positive feedback; the car collides to give negative feedback; the car leaves the road to give negative feedback; the car reaches the correct destination to give positive feedback, and so on. As another example, for example, when the embodiment of the present application is applied to the freight field, the transport robot in the simulator maintains the desired average speed and gives positive feedback; the transport robot drives according to the correct route and gives positive feedback; the transport robot collides and gives negative feedback; the transport robot places the goods on the correct shelf and gives positive feedback, etc. Other application scenarios are not given examples one by one here. In addition, if r is directly calculated based on the operation behavior information obtained by the server from time t to time t+1 when the smart device performs the operation corresponding to the new skill, then the calculation method of r is similar to the calculation method of R, the difference is that R is calculated based on the operation behavior information of the smart device obtained from time t to time t+T, and r is calculated based on the operation behavior information obtained from time t to time t+1. The method of obtaining r will not be introduced here.
[0185] 314. The server stores the trained second neural network and the updated skill library.
[0186] In some embodiments of the present application, step 314 is similar to step 309. After the server determines the second neural network as the neural network for performing the first task and determines the updated skill library as the skill library for performing the first task, the second neural network and the updated skill library can be stored, and then the second neural network and the updated skill library can be configured on the smart device for performing the first task. The specific implementation method of the server configuring the second neural network and the updated skill library on the smart device for performing the first task can refer to the description in step 309 and will not be repeated here.
[0187] It should be understood that steps 302 to 306 are all optional steps. If steps 302 to 306 are not performed, step 307 can be performed directly after step 301 is performed. If steps 302 to 306 are performed, in the case where the first neural network is a neural network obtained by training based on the simulation environment corresponding to the second task, since in some scenarios, the first task and the second task have a high degree of similarity, that is, the skills used to perform the first task and the second task are basically the same, it is only necessary to fine-tune the first neural network based on the simulation environment corresponding to the first task to achieve the condition that the first success rate of the first neural network for completing the first task is greater than or equal to the preset threshold, that is, based on the simulation environment corresponding to the first task, the first neural network is retrained to achieve the purpose of performing the first task through the first neural network. Therefore, the use of pre-training can increase the probability that the first success rate is greater than or equal to the preset threshold, thereby reducing the probability of generating a new second neural network and the new skill, and then avoiding the operation of training the second neural network and the new skill, thereby saving server resources and improving the generation efficiency of neural networks and skills.
[0188] In an embodiment of the present application, after acquiring the first task, the server acquires a first success rate of the first neural network for completing the first task, generates a second neural network and a new skill when the first success rate is less than a preset threshold, and trains the second neural network based on the simulation environment corresponding to the first task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and stores the new skill. Since the new skill can be incrementally learned to expand the skill library in the process of learning how to complete the task, the dependence on the skill library obtained in the pre-training stage is greatly reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of the new skill realizes the scalability of the skills in the skill library, thereby obtaining the ability to complete new tasks and overcoming the limitations of current skill learning methods.
[0189] 2. Application side
[0190] See also Figure 7 , Figure 7 As an embodiment of the method for processing a neural network in the embodiment of the present application, the method may include:
[0191] 701. The smart device obtains current environment status information and a third task, wherein the current environment status information includes environment information around the smart device and status information of the smart device itself.
[0192] In this embodiment, the information collection module of the smart device can collect the environmental information around the smart device and the state information of the smart device itself in real time, and the processing module of the smart device can determine the first task based on the surrounding environmental information. Optionally, the smart device can also be configured with map data corresponding to the environmental information around the smart device, so that the processing module can determine the first task in combination with the collected surrounding environmental information and map data, or the smart device is configured with a navigation-type interactive application, so that the processing module can determine the first task in combination with the collected environmental information and the map data obtained by the navigation-type interactive application. Specifically, the smart device can perform the current environmental state information acquisition operation and the first task determination operation once every preset time period. The value of the preset time period can refer to the above embodiment and will not be repeated here.
[0193] More specifically, the third task refers to a task generated by the processing module of the smart device. Different from the first task and the second task, the first task and the second task are tasks determined by the server during the training of the neural network, while the third task is a task determined by the smart device when applying the trained mature neural network. The information acquisition module can be various types of sensors, such as distance sensors, speed sensors or other sensors for collecting environmental information and status information, etc.; the processing module can be specifically manifested as a main processor, AI processor or image processor in the smart device, etc., which is not limited here. As an example, the smart device is taken as a vehicle, and a map of the road on which the vehicle is traveling is configured on the smart device. According to the map data in the vehicle, it can be determined that the current task of the vehicle is to exit from the D entrance of the roundabout, and the traffic flow of the roundabout is 5s / vehicle. The current environmental status information may include road sign information along the roundabout, the entry position of the driving vehicle (for example, the outer lane of the A entrance of the roundabout), the lane information where the vehicle is located, the driving speed of adjacent vehicles, the distance between the driving vehicle and the adjacent vehicles, the speed of the driving vehicle, the driving direction of the driving vehicle, or any one or more combinations of other current environmental status information. The processing module can determine the first task as entering from the A entrance of the roundabout and exiting from the D entrance, the traffic flow is 5s / vehicle, and the vehicle has a need to change lanes. 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.
[0194] 702. The smart device obtains a third neural network corresponding to the third task.
[0195] In this embodiment, since a plurality of different skill libraries and neural networks corresponding to each skill library can be pre-configured on the smart device, and different skill libraries and neural networks are used to perform different tasks, the processing module of the smart device can obtain the third neural network corresponding to the third task after obtaining the third task, wherein the third neural network is used to select skills from the skill library, and the skills selected by the third neural network are used to obtain control instructions for controlling the smart device to perform the third task, and the third neural network and the skill library are both configured on the smart terminal device after training. As an example, for example, there are 5 skill libraries and 5 neural networks corresponding to the 5 skill libraries configured on the smart device, which are respectively used to perform the 5 tasks of automatic parking, exiting a toll station, exiting a roundabout, exiting an overpass, and high-speed driving. The third task determined by the processing module of the smart device is to exit a roundabout, and the smart device needs to obtain the neural network corresponding to exiting a roundabout. The example here is not used to limit this solution.
[0196] 703. The smart device inputs the current environment state information into the third neural network so as to select a skill for performing the third task from the skill library through the third neural network.
[0197] In this embodiment, after the smart device determines the third neural network for performing the third task, that is, determines a skill library that corresponds one-to-one to the third neural network, the smart device inputs the current environment state information into the third neural network, obtains the serial number output by the third neural network, and then selects a skill indicated by the serial number from the skill library. The specific mapping relationship between the serial number output by the third neural network and the skill selected by the third neural network can be found in Table 1 above, which will not be elaborated here.
[0198] 704. The smart device controls the smart device to execute the third task according to the control instruction corresponding to the skill selected by the third neural network.
[0199] In this embodiment, after the smart device acquires the skill selected by the third neural network, if the skill selected by the third neural network is specifically manifested as a neural network, it is necessary to input the current environment state information into the skill selected by the third neural network to obtain the control instruction output by the skill selected by the third neural network, or, if the skill selected by the third neural network outputs a serial number corresponding to the control instruction, then the smart device needs to be pre-configured with a mapping relationship between the serial number and the operation rule. After acquiring the serial number, the operation rule corresponding to the serial number is found from the mapping relationship, and then the control instruction for the smart device is generated according to the operation rule. The specific presentation of the operation rule can refer to the above embodiment, and the mapping relationship between the serial number and the operation rule can refer to the above Table 2, which will not be repeated here. If the skill selected by the third neural network is specifically manifested as an operation rule, the smart device can directly generate a control instruction corresponding to the operation rule.
[0200] After the processor of the smart device obtains the control instruction, it can control the main body of the smart device to perform the operation corresponding to the control instruction to perform the third task; specifically, the main body of the smart device can be controlled to perform the operation corresponding to the control instruction within T timestamps. As an example, if the control instruction includes controlling the driving speed to slow down to 40m / s, the processor of the smart device can control the engine of the smart device to drive the wheels, and gradually slow down the driving speed of the smart device to 40m / s within 8 timestamps. It should be understood that the examples given here are only for the convenience of understanding this solution.
[0201] 705. The intelligent device determines whether the execution status of the skill selected by the third neural network is completed. If the execution is completed, the process proceeds to step 706; if the execution is not completed, the process re-enters step 705.
[0202] In this embodiment, since the execution time of the smart device can execute step 705 once every preset time, and the execution time of a skill selected by the third neural network can be T timestamps, after the smart device starts to execute the operation corresponding to the skill selected by the third neural network, it will execute the acquisition operation of the execution status of the skill selected by the third neural network once every preset time. If the execution is completed, continue to execute step 706; if the execution is not completed, re-enter step 705, and execute the acquisition operation of the execution status of the skill selected by the third neural network again after a preset time, until the execution status of the skill selected by the third neural network is completed. It should be understood that step 705 is an optional step. If the smart device can determine whether the skill is completed by other means, step 705 does not need to be executed. After completing step 704, after determining that the skill selected by the third neural network is completed by other means, step 706 can be directly executed.
[0203] 706. The smart device determines whether the third task is completed. If not, the process re-enters step 701. If the third task is completed, the process re-enters step 707.
[0204] In this embodiment, after the smart device determines that a skill selected by the third neural network from the skill library has been executed, it is necessary to determine whether the third task has been completed. If the execution is completed, it is determined that the third task has been completed, and the execution process of the third task is completed; if the third task has not been completed, the smart device re-enters step 701, re-acquires the current environment state information, and inputs the current environment state information into the third neural network corresponding to the third task, so as to use the third neural network to select a new skill from the skill library, and then through the control instructions corresponding to the skill selected by the third neural network, the smart device is controlled again to execute the third task until the third task is completed through at least two skills.
[0205] Specifically, the smart device can determine whether the third task is completed based on the current environmental status information collected by the information collection module. As an example, if the third task is for the vehicle to exit from the C port of the roundabout, it is necessary to determine the current position of the vehicle based on the current environmental status information to determine whether the vehicle has exited the C port. If the current position of the vehicle indicates that the vehicle has exited the C port, it is determined that the third task is completed; if the current position of the vehicle indicates that the vehicle is still in the roundabout, it is determined that the third task has not been completed. Other scenarios are not exhaustively listed here.
[0206] 707. The smart device determines that execution of the third task is completed.
[0207] In the embodiment of the present application, through the above-mentioned method, a specific application method is provided for applying the mature neural network and skill library trained by the server to the smart device, thereby improving the integrity of the present solution. The server side uses incremental learning of the new skills to achieve the scalability of the skills in the skill library, thereby obtaining the ability to complete new tasks and expanding the application scenarios of smart devices.
[0208] Two specific embodiments are cited below to further explain in detail the implementation of the neural network acquisition method provided in the embodiments of the present application on the training side. In these two embodiments, an example is taken in which the first neural network is a neural network obtained by training based on a simulation environment corresponding to the second task, the first driving task and the second driving task are both to exit a roundabout, and the preset threshold of the success rate is ninety-nine percent, but the constraints for exiting the roundabout are different. In one embodiment, the second driving task is similar to but different from the first driving task. The second driving task is to drive a car out of a roundabout, the traffic flow at the entrance of the roundabout is one car every five seconds, and the car can only be in the outer lane of the roundabout, and there is no lane change function. For details, please refer to Figure 8 , Figure 8 B1 in the figure represents the vehicles traveling in the roundabout, B2 represents the dividing line between the outer lane and the inner lane in the roundabout, and B3 represents an entrance to the roundabout. It is not difficult to see that Figure 8 The vehicles in the lane are all running in the outer lane, and Figure 8 The vehicle density in the roundabout shown is not very high; the first driving task is for the car to drive out of the roundabout. The traffic flow at the entrance of the roundabout is one car every 5 seconds. The car can drive in any lane of the roundabout, that is, there is a lane change function. For details, please refer to Fig. 9 , Fig. 9 Traffic flow and Figure 8 Similar to , but see Fig. 9 B4 in the figure is moving from the outer lane to the inner lane, i.e. Fig. 9 The car in has the lane change function. See next Fig.10 , Fig.10A schematic flow chart of a method for acquiring a neural network provided in an embodiment of the present application, the method may include:
[0209] C1. The server obtains the first driving task and the first neural network.
[0210] In this embodiment, the first neural network and the skill library corresponding to the first neural network are both obtained by training the server based on the simulation environment corresponding to the second driving task.
[0211] C2. The server performs the first driving task through the first neural network.
[0212] C3. The server determines whether the loss function of the first neural network converges.
[0213] In this embodiment, the server determines whether the loss function of the first neural network converges, and the judgment result obtained is that the loss function of the first neural network has not converged.
[0214] C4. The server trains the first neural network using the third reinforcement learning algorithm based on the simulation environment corresponding to the first driving task.
[0215] C5. The server determines whether the loss function of the first neural network can converge.
[0216] In this embodiment, the server determines whether the loss function of the first neural network can converge, and if the judgment result is that the loss function of the first neural network can converge, the first neural network is trained until a mature first neural network is obtained.
[0217] C6. The server obtains a success rate of the mature first neural network in completing the first driving task as a first success rate.
[0218] C7. The server determines whether the first success rate is greater than or equal to ninety-nine percent.
[0219] In this embodiment, the server determines whether the first success rate is greater than or equal to ninety-nine percent, and the determination result is that the first success rate is less than ninety-nine percent.
[0220] C8. The server generates a second neural network and new driving skills, adds the new driving skills to the skill library, and obtains an updated skill library.
[0221] C9. The server uses the parameters of the first neural network to initialize the parameters of the second neural network.
[0222] C10. The server trains the second neural network using the first reinforcement learning algorithm based on the simulation environment corresponding to the first driving task until a second success rate of the second neural network for completing the first driving task is greater than or equal to a preset threshold.
[0223] C11. The server stores the trained second neural network and the updated skill library.
[0224] In this embodiment, the server obtains a first success rate of the first neural network for completing the first task. Since the first success rate is less than a preset threshold, the server generates a second neural network and a new driving skill, adds the new driving skill to the skill library to obtain an updated skill library, and then trains the second neural network until the second success rate of the second neural network for completing the first driving task is greater than or equal to the preset threshold, which is then stored. Since new driving skills can be incrementally learned to expand the skill library in the process of learning how to complete the task, the dependence on the skill library obtained in the pre-training stage is reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of new driving skills realizes the scalability of the skills in the skill library, overcoming the limitations of current skill learning methods.
[0225] In another embodiment, the second driving task is similar to but different from the first driving task. For example, the second driving task is for a car to drive out of a roundabout. The traffic flow at the entrance of the roundabout is one car every 5 seconds. The car can drive in any lane of the roundabout, that is, there is a lane change function. For details, please refer to Fig. 9 ; The first driving task is to drive the car out of the roundabout. The traffic flow at the entrance of the roundabout is one car every 2.5 seconds. The car can drive in any lane of the roundabout, that is, there is a lane change function. For details, please refer to Fig.11 , Fig.11 In the B5 in the figure, there are cars driving in the outer lane and cars driving in the inner lane, which means that it has the lane change function. Fig.11 and Fig. 9 ,obvious Fig.11 The density of vehicles in is greater. Fig.12 , Fig.12 A schematic flow chart of a method for acquiring a neural network provided in an embodiment of the present application, the method may include:
[0226] D1. The server obtains the first driving task and the first neural network.
[0227] In this embodiment, the first neural network and the skill library corresponding to the first neural network are both obtained by training the server based on the simulation environment corresponding to the second driving task.
[0228] D2. The server performs the first driving task through the first neural network.
[0229] D3. The server determines whether the loss function of the first neural network converges.
[0230] In this embodiment, the server determines whether the loss function of the first neural network converges, and the judgment result obtained is that the loss function of the first neural network has not converged.
[0231] D4. The server trains the first neural network using the third reinforcement learning algorithm based on the simulation environment corresponding to the first driving task.
[0232] D5. The server determines whether the loss function of the first neural network can converge.
[0233] In this embodiment, the server determines whether the loss function of the first neural network can converge, and if the judgment result is that the loss function of the first neural network can converge, the first neural network is trained until a mature first neural network is obtained.
[0234] D6. The server obtains the success rate of the mature first neural network in completing the first driving task as the first success rate.
[0235] D7. The server determines whether the first success rate is greater than or equal to ninety-nine percent.
[0236] In this embodiment, the server determines whether the first success rate is greater than or equal to ninety-nine percent, and the determination result is that the first success rate is greater than ninety-nine percent.
[0237] D8. The server determines the first neural network as the neural network used to complete the first driving task.
[0238] D9. The server stores the first neural network and the skill library.
[0239] In this embodiment, since the similarity between the first task and the second task is very high, the first neural network is trained again based on the simulation environment corresponding to the first task, so the purpose of the first success rate being greater than or equal to the preset threshold is achieved. Therefore, the pre-training method can increase the probability that the first success rate is greater than or equal to the preset threshold, thereby reducing the probability of generating a new second neural network and a new skill, and then avoiding the operation of training the second neural network and the new skill, thereby saving server resources and improving the generation efficiency of neural networks and skills.
[0240] It should be understood that the above two embodiments are only used to prove the feasibility of this solution, and are not used to limit this solution.
[0241] Based on the description of the above embodiments, the present application also provides a method for obtaining a neural network to demonstrate the Figures 3 to 12 For the implementation of the neural network acquisition method provided in the field of autonomous driving, please refer to Fig.13 , Fig.13A schematic flow chart of a method for acquiring a neural network provided in an embodiment of the present application, the method may include:
[0242] 1301. The server obtains a first driving task.
[0243] 1302. The server obtains a first neural network.
[0244] 1303. The server obtains a control instruction through the driving skill selected by the first neural network to control the smart device to perform the first driving task.
[0245] 1304. The server determines whether the loss function of the first neural network converges. If the loss function does not converge, execute step 1305; if the loss function converges, execute step 1307.
[0246] 1305. The server trains the first neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first driving task.
[0247] 1306. The server determines whether the loss function of the first neural network can converge. If not, the server re-enters step 1302. If it can converge, a mature first neural network is obtained.
[0248] 1307. The server obtains a first success rate of the first neural network for completing the first driving task.
[0249] 1308. The server determines whether the first success rate is greater than or equal to a preset threshold. If so, the process proceeds to step 1309; if less than the preset threshold, the process proceeds to step 1311.
[0250] 1309. The server determines the first neural network as a neural network for completing the first driving task.
[0251] 1310. The server stores the first neural network and the skill library.
[0252] 1311. The server obtains the second neural network and the new driving skill, adds the new driving skill to the skill library, and obtains an updated skill library.
[0253] 1312. The server uses the parameters of the first neural network to initialize the parameters of the second neural network.
[0254] 1313. The server trains the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first driving task until a second success rate of the second neural network for completing the first driving task is greater than or equal to a preset threshold.
[0255] 1314. The server stores the trained second neural network and the updated skill library.
[0256] In the embodiment of the present application, steps 1301 to 1314 are Figure 3 Steps 301 to 314 in the corresponding embodiment are similar, except that in steps 1301 to 1314, the driving skills in the skill library are downgraded to driving skills. For the specific implementation of steps 1301 to 1314, please refer to Figure 3 The descriptions of steps 301 to 314 are not repeated here one by one.
[0257] In the embodiment of the present application, through the above-mentioned method, since the new driving skills can be incrementally learned to expand the driving skill library in the process of learning how to complete the driving task, the dependence on the driving skill library obtained in the pre-training stage is greatly reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of the new driving skills realizes the scalability of the driving skills in the driving skill library, so that the ability to complete new driving tasks can be obtained, overcoming the limitations of the current driving skill learning methods.
[0258] The present application also provides a method for obtaining a neural network to demonstrate the Figures 3 to 12 For the implementation of the neural network acquisition method provided in the field of freight transport, please refer to Fig.14 , Fig.14 A schematic flow chart of a method for acquiring a neural network provided in an embodiment of the present application, the method may include:
[0259] 1401. The server obtains the first transport task.
[0260] 1402. The server obtains a first neural network.
[0261] 1403. The server obtains a control instruction through the handling skill selected by the first neural network to control the smart device to perform the first handling task.
[0262] 1404. The server determines whether the loss function of the first neural network converges. If the loss function does not converge, execute step 1405; if the loss function converges, execute step 1407.
[0263] 1405. The server trains the first neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first transport task.
[0264] 1406. The server determines whether the loss function of the first neural network can converge. If not, re-enter step 1402; if it can converge, a mature first neural network is obtained.
[0265] 1407. The server obtains a first success rate of the first neural network for completing the first transport task.
[0266] 1408. The server determines whether the first success rate is greater than or equal to a preset threshold. If so, the process proceeds to step 1409; if less than the preset threshold, the process proceeds to step 1411.
[0267] 1409. The server determines the first neural network as the neural network used to complete the first transport task.
[0268] 1410. The server stores the first neural network and the skill library.
[0269] 1411. The server obtains the second neural network and the new transport skill, adds the new transport skill to the skill library, and obtains an updated skill library.
[0270] 1412. The server uses the parameters of the first neural network to initialize the parameters of the second neural network.
[0271] 1413. The server trains the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first handling task until a second success rate of the second neural network for completing the first handling task is greater than or equal to a preset threshold.
[0272] 1414. The server stores the trained second neural network and the updated skill library.
[0273] In the embodiment of the present application, steps 1401 to 1414 are Figure 3 Steps 301 to 314 in the corresponding embodiment are similar, except that in steps 1401 to 1414, the neural network is downgraded to the transport neural network, and the skills in the skill library are downgraded to the transport skills. For the specific implementation of steps 1401 to 1414, please refer to Figure 3 The descriptions of steps 301 to 314 are not repeated here one by one.
[0274] In the embodiment of the present application, through the above-mentioned method, since new carrying skills can be incrementally learned to expand the carrying skill library in the process of learning how to complete the carrying task, the dependence on the carrying skill library obtained in the pre-training stage is greatly reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of new carrying skills realizes the scalability of the carrying skills in the carrying skill library, so that the ability to complete new carrying tasks can be acquired, overcoming the limitations of the current carrying skill learning methods.
[0275] The present application also provides a method for obtaining a neural network to demonstrate the Figures 3 to 12 The neural network acquisition method provided is applied to the implementation of an intelligent robotic arm with grasping function. Fig.15 , Fig.15 A schematic flow chart of a method for acquiring a neural network provided in an embodiment of the present application, the method may include:
[0276] 1501. The server obtains the first crawling task.
[0277] 1502. The server obtains a first neural network.
[0278] 1503. The server obtains control instructions through the grasping skills selected by the first neural network to control the smart device to perform the first grasping task.
[0279] 1504. The server determines whether the loss function of the first neural network converges. If the loss function does not converge, execute step 1505; if the loss function converges, execute step 1507.
[0280] 1505. The server trains the first neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first grasping task.
[0281] 1506. The server determines whether the loss function of the first neural network can converge. If not, the server re-enters step 1502. If it can converge, a mature first neural network is obtained.
[0282] 1507. The server obtains a first success rate of the first neural network for completing the first grasping task.
[0283] 1508. The server determines whether the first success rate is greater than or equal to a preset threshold. If so, the process proceeds to step 1509; if less than the preset threshold, the process proceeds to step 1511.
[0284] 1509. The server determines the first neural network as the neural network for completing the first crawling task.
[0285] 1510. The server stores the first neural network and the skill library.
[0286] 1511. The server obtains the second neural network and the new grasping skill, adds the new grasping skill to the skill library, and obtains an updated skill library.
[0287] 1512. The server uses the parameters of the first neural network to initialize the parameters of the second neural network.
[0288] 1513. The server trains the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first grasping task until a second success rate of the second neural network for completing the first grasping task is greater than or equal to a preset threshold.
[0289] 1514. The server stores the trained second neural network and the updated skill library.
[0290] In the embodiment of the present application, steps 1501 to 1514 are Figure 3 Steps 301 to 314 in the corresponding embodiment are similar, except that in steps 1501 to 1514, the neural network is downgraded to the capture neural network, and the skills in the skill library are downgraded to the capture skills. For the specific implementation of steps 1501 to 1514, please refer to Figure 3 The descriptions of steps 301 to 314 are not repeated here one by one.
[0291] In the embodiment of the present application, through the above-mentioned method, since new grasping skills can be incrementally learned to expand the grasping skill library in the process of learning how to complete the grasping task, the dependence on the grasping skill library obtained in the pre-training stage is greatly reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of new grasping skills realizes the scalability of the grasping skills in the grasping skill library, so that the ability to complete new grasping tasks can be acquired, overcoming the limitations of current grasping skill learning methods.
[0292] It should be understood that Figures 13 to 15 Display only Figures 3 to 12 The three specific application scenarios of the neural network acquisition method provided are as follows, but in actual situations Figures 3 to 12 The provided method for obtaining a neural network can also be applied to more other application scenarios. As an example, it can be applied to obtaining a neural network configured in a chess and card robot; as another example, it can be applied to obtaining a neural network configured in an intelligent sweeping robot or other scenarios, etc. Other application scenarios are not enumerated here.
[0293] exist Figures 1 to 15 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.16 , Fig.16A structural schematic diagram of a neural network acquisition device provided in an embodiment of the present application. The neural network acquisition device 1600 may include an acquisition unit 1601, a training unit 1602, and a storage unit 1603. The acquisition unit 1601 is used to obtain a first success rate of the first neural network for completing a first task, and the first neural network is used to select a skill for completing the first task from a skill library; the acquisition unit 1601 is also used to obtain a second neural network and a new skill when the first success rate is less than a preset threshold, and add the new skill to the skill library to update the skill library, and the second neural network is used to select a skill for completing the first task from the updated skill library; the training unit 1602 is used to train the second neural network based on the simulation environment corresponding to the first task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold; the storage unit 1603 is used to store the trained second neural network and the updated skill library.
[0294] In an embodiment of the present application, the acquisition unit 1601 can acquire a first success rate of the first neural network for completing a first task. When the first success rate is less than a preset threshold, the acquisition unit 1601 acquires a second neural network and a new skill, and adds the new skill to the skill library to obtain an updated skill library. Then the training unit 1602 trains the second neural network based on the simulation environment corresponding to the first task until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and then the storage unit 1603 stores it. Since new skills can be incrementally learned to expand the skill library in the process of learning how to complete the task, the dependence on the skill library obtained in the pre-training stage is greatly reduced, that is, the requirements for the training environment in the pre-training stage are reduced; and the incremental learning of new skills realizes the scalability of the skills in the skill library, so that the ability to complete new tasks can be acquired, overcoming the limitations of current skill learning methods.
[0295] In one possible design, the training unit 1602 is specifically used to: input environmental state information into the second neural network to obtain skills selected by the second neural network, the environmental state information including environmental information around the intelligent device in the simulation environment corresponding to the first task and the intelligent device's own state information; obtain control instructions through the skills selected by the second neural network to control the intelligent device to perform the first task, and obtain data of the intelligent device performing the first task; and update the parameters of the second neural network using a reinforcement learning algorithm based on the acquired data of the intelligent device performing the first task.
[0296] In the embodiment of the present application, a specific implementation method for the training unit 1602 to train the second neural network is provided, which improves the feasibility of the present solution.
[0297] In one possible design, the training unit 1602 is also used to update the parameters of the new skill by using a reinforcement learning algorithm based on the data obtained from the smart device performing the first task when the skill selected by the second neural network is a new skill.
[0298] In the embodiment of the present application, through the above-mentioned method, it is possible to maintain a large degree of distinction between different skills in the updated skill library, thereby reducing the storage redundancy of the updated skill library; in addition, if the parameters of skills that are not newly generated are also updated, the evolution direction of the skills in the updated skill library is out of control. Only updating the newly generated skills is conducive to bridging the gap in skill requirements between the first task and the second task of learning the new skill.
[0299] In one possible design, the training unit 1602 is specifically used to: update the parameters of the second neural network using a first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm, or a time difference TD algorithm.
[0300] In the embodiment of the present application, a specific implementation method of the reinforcement learning algorithm adopted by the second neural network is provided through the above method, which improves the feasibility of the present solution and also enables technical personnel in this field to have more choices, thereby improving the implementation flexibility of the present solution.
[0301] In one possible design, the training unit 1602 is specifically used to: update the parameters of the new skill using a second reinforcement learning algorithm, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm, or a flexible actuation evaluation SAC algorithm.
[0302] In the embodiments of the present application, a specific implementation method of the reinforcement learning algorithm adopted by the second neural network and the new skill is provided through the above-mentioned method, which improves the feasibility of the present solution and also enables technical personnel in this field to have more choices, thereby improving the implementation flexibility of the present solution.
[0303] In one possible design, see Fig.17 , Fig.17 A structural schematic diagram of a neural network acquisition device provided in an embodiment of the present application, the neural network acquisition device 1600 also includes: an initialization unit 1604, used to initialize the parameters of the second neural network using the parameters of the first neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task.
[0304] In the embodiment of the present application, the initialization unit 1604 uses the parameters of the trained first neural network to initialize the parameters of the second neural network, which can directly inherit the capabilities learned by the first neural network, shorten the training process of the second neural network, and improve the training efficiency of the second neural network.
[0305] In one possible design, see Fig.17 The first neural network and the skill library are obtained by training using a reinforcement learning algorithm based on a simulation environment corresponding to the second task, and the semantic information of the second task is similar to the semantic information of the first task; the neural network acquisition device 1600 also includes: a determination unit 1605, which is used to determine the first neural network as a neural network for completing the first task when the first success rate is greater than or equal to a preset threshold; the storage unit 1603 is also used to store the first neural network and the skill library.
[0306] In an embodiment of the present application, the acquisition unit 1601 can obtain a first success rate for executing the first task through the first neural network. When the first success rate is greater than or equal to a preset threshold, the determination unit 1605 determines the first neural network as a neural network for executing the first task, and then the storage unit 1603 stores the first neural network and the skill library to configure the first neural network and the skill library to the intelligent device that executes the first task, thereby improving the completeness of the present solution; when the first neural network is a neural network trained based on a simulation environment corresponding to the second task, the reuse of the upper neural network and the lower skill library is realized, which saves time and training resources in the neural network training process and greatly improves the efficiency of the neural network training process.
[0307] In one possible design, the acquisition unit 1601 is specifically used to: input environmental state information into the first neural network to obtain skills selected by the first neural network, wherein the environmental state information includes environmental information around the intelligent device in the simulation environment corresponding to the first task and the self-state information of the intelligent device; obtain control instructions through the skills selected by the first neural network to control the intelligent device to perform the first task; repeat the above steps until the number of times the first task is completed by the first neural network reaches a first number; count the number of times the result of completing the first task is successful in the first number to obtain a second number; and calculate the first success rate based on the first number and the second number.
[0308] In the embodiment of the present application, since the neural network acquisition device in the above method controls the intelligent device to repeatedly perform the first task through the first neural network in the simulator, that is, the first success rate is obtained by restoring the real scene to improve the accuracy of the first success rate.
[0309] In a possible design, the acquisition unit 1601 is further used to control the intelligent device to perform the first task by acquiring a control instruction through the skill selected by the first neural network, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second task, and the semantic information of the second task is similar to the semantic information of the first task;
[0310] The training unit 1602 is further configured to train the first neural network using a reinforcement learning algorithm based on a simulation environment corresponding to the first task when the loss function of the first neural network has not converged, until a convergence condition of the loss function of the first neural network is reached, thereby obtaining a mature first neural network;
[0311] The acquisition unit 1601 is specifically used to acquire a success rate of the mature first neural network for completing the first task as a first success rate.
[0312] In the embodiment of the present application, the pre-training method is adopted to increase the probability that the first success rate is greater than or equal to the preset threshold, thereby reducing the probability of generating a new second neural network and a new skill, and further avoiding the operation of training the second neural network and the new skill, thereby saving the resources of the neural network acquisition device and improving the generation efficiency of the neural network and the skill.
[0313] In one possible design, the acquisition unit 1601 is specifically used to: obtain semantic information of a first task, and obtain semantic information of a second task, wherein the semantic information of the second task is similar to the semantic information of the first task, and the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to the second task; and obtain a first success rate based on the similarity between the semantic information of the first task and the semantic information of the second task, wherein the higher the similarity, the higher the first success rate.
[0314] In an embodiment of the present application, the first success rate of the first neural network for completing the first task is determined by obtaining the similarity between the first task and the second task, which provides another implementation method for obtaining the first success rate and expands the application scenarios of the present solution. In this method, there is no need to repeatedly perform the first task through the first neural network, which improves the efficiency of obtaining the first success rate.
[0315] In a possible design, the skills in the skill library are driving skills; or, the skills in the skill library are carrying skills; or, the skills in the skill library are grasping skills.
[0316] In the embodiments of the present application, through the above-mentioned method, a variety of specific implementation methods of skills are provided, the application scenarios of the present solution are expanded, and the comprehensiveness of the present solution is improved.
[0317] In one possible design, the skill in the skill library is a driving skill, and the data obtained by the server when the smart device performs the first task includes any one or more of the driving speed, driving path, driving collision condition, or driving destination of the smart device; or, the skill in the skill library is a carrying skill, and the data obtained by the server when the smart device performs the first task includes any one or more of the carrying path, driving speed, or collision condition of the smart device; or, the skill in the skill library is a grasping skill, and the data obtained by the server when the smart device performs the first task includes any one or more of the grasping path, grasping speed, or grasping destination position of the smart device.
[0318] In the embodiment of the present application, the specific content of the operation behavior information is further provided through the above method, thereby further improving the executability of the present solution; and the specific content of the operation behavior information in different fields is provided, thereby improving the implementation flexibility of the present solution.
[0319] It should be noted that the information interaction, execution process, etc. between the modules / units in the neural network acquisition device 1600 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.
[0320] The present application also provides another neural network acquisition device, see Fig.18 , Fig.18 A structural schematic diagram of a neural network acquisition device provided in an embodiment of the present application. The neural network acquisition device 1800 may include an acquisition unit 1801, a training unit 1802, and a storage unit 1803. The acquisition unit 1801 is used to acquire a first success rate of a first neural network for completing a first driving task, and the first neural network is used to select a driving skill for completing the first driving task from a skill library; the acquisition unit 1801 is also used to acquire a second neural network and a new driving skill when the first success rate is less than a preset threshold, and add the new driving skill to the skill library to update the skill library, and the second neural network is used to select a driving skill for completing the first driving task from the updated skill library; the training unit 1802 is used to train the second neural network based on the simulation environment corresponding to the first driving task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first driving task is greater than or equal to the preset threshold; the storage unit 1803 is used to store the trained second neural network and the updated skill library.
[0321] In one possible design, the training unit 1802 is specifically used to: input environmental state information into the second neural network to obtain driving skills selected by the second neural network, the environmental state information including environmental information around the car in the simulation environment corresponding to the first driving task and the car's own state information; obtain control instructions through the driving skills selected by the second neural network to control the car to perform the first driving task, and obtain data on the car performing the first driving task; and update the parameters of the second neural network using a reinforcement learning algorithm based on the acquired data on the car performing the first driving task.
[0322] In one possible design, the training unit 1802 is also used to update the parameters of the new driving skill by using a reinforcement learning algorithm based on the acquired data of the car performing the first driving task when the driving skill selected by the second neural network is a new driving skill.
[0323] In one possible design, the training unit 1802 is specifically used to: update the parameters of the second neural network using a first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm, or a time difference TD algorithm.
[0324] In one possible design, the training unit 1802 is specifically used to: use a second reinforcement learning algorithm to update the parameters of the new driving skill, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm, or a flexible actuation evaluation SAC algorithm.
[0325] In one possible design, see Fig.19 , Fig.19 A structural schematic diagram of a neural network acquisition device provided in an embodiment of the present application, the neural network acquisition device 1800 also includes: an initialization unit 1804, used to initialize parameters of a second neural network using parameters of a first neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task.
[0326] In one possible design, see Fig.19 The first neural network and the skill library are obtained by training using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task; the neural network acquisition device 1800 also includes: a determination unit 1805, which is used to determine the first neural network as a neural network for completing the first driving task when the first success rate is greater than or equal to a preset threshold; the storage unit 1803 is also used to store the first neural network and the skill library.
[0327] In one possible design, the acquisition unit 1801 is specifically used to: input environmental state information into the first neural network to obtain driving skills selected by the first neural network, wherein the environmental state information includes environmental information around the car in the simulation environment corresponding to the first driving task and the car's own state information; obtain control instructions through the driving skills selected by the first neural network to control the car to perform the first driving task; repeat the above steps until the number of times the first driving task is completed by the first neural network reaches a first number; count the number of times the first driving task is successfully completed in the first number to obtain a second number; and calculate a first success rate based on the first number and the second number.
[0328] In a possible design, the acquisition unit 1801 is further used to acquire a control instruction through the driving skill selected by the first neural network to control the car to perform the first driving task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first driving task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task;
[0329] The training unit 1802 is further configured to train the first neural network by using a reinforcement learning algorithm based on a simulation environment corresponding to the first driving task when the loss function of the first neural network has not converged, until a convergence condition of the loss function of the first neural network is reached, thereby obtaining a mature first neural network;
[0330] The acquisition unit 1801 is specifically used to acquire a success rate of the mature first neural network for completing the first driving task as a first success rate.
[0331] In a possible design, the acquisition unit 1801 is specifically used to: obtain semantic information of a first driving task, and obtain semantic information of a second driving task, wherein the semantic information of the second driving task is similar to the semantic information of the first driving task, and the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task; and obtain a first success rate based on the similarity between the semantic information of the first driving task and the semantic information of the second driving task, wherein the higher the similarity, the higher the first success rate.
[0332] It should be noted that the information interaction, execution process, etc. between the modules / units in the neural network acquisition device 1800 are the same as those in the present application. Fig.12 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.
[0333] The present application also provides another neural network acquisition device, see Fig. 20 , Fig. 20 A structural schematic diagram of a neural network acquisition device provided in an embodiment of the present application. The neural network acquisition device 2000 may include an acquisition unit 2001, a determination unit 2002, and a storage unit 2003. The acquisition unit 2001 is used to obtain a first success rate of a first neural network for completing a first task, the first neural network is used to select a skill for completing the first task from a skill library, the first neural network and the skill library are obtained by training using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task; the determination unit 2002 is used to determine the first neural network as a neural network for completing the first task when the first success rate is greater than or equal to a preset threshold; the storage unit 2003 is used to store the first neural network and the skill library.
[0334] In one possible design, see Fig.21 , Fig.21 A structural diagram of a neural network acquisition device provided in an embodiment of the present application. The acquisition unit 2001 is also used to acquire a second neural network and a new skill when the first success rate is less than a preset threshold, and add the new skill to the skill library to update the skill library, and the second neural network is used to select skills for completing the first task from the updated skill library; the neural network acquisition device 2000 also includes: a training unit 2004, which is used to train the second neural network based on the simulation environment corresponding to the first task using a reinforcement learning algorithm until the second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, and store the trained second neural network and the updated skill library.
[0335] In one possible design, see Fig.21 The training unit 2004 is specifically used to: input the environmental state information into the second neural network to obtain the skills selected by the second neural network, the environmental state information includes the environmental information around the intelligent device in the simulation environment corresponding to the first task and the self-state information of the intelligent device; obtain the control instructions through the skills selected by the second neural network to control the intelligent device to perform the first task, and obtain the data of the intelligent device performing the first task, and update the parameters of the second neural network according to the obtained data of the intelligent device performing the first task by using the reinforcement learning algorithm.
[0336] In one possible design, see Fig.21 The training unit 2004 is also used to update the parameters of the new skill by using a reinforcement learning algorithm based on the data obtained from the smart device performing the first task when the skill selected by the second neural network is a new skill.
[0337] In one possible design, see Fig.21 The training unit 2004 is specifically used to update the parameters of the second neural network using the first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm or a time difference TD algorithm.
[0338] In one possible design, see Fig.21 The training unit 2004 is specifically used to update the parameters of the new skill using a second reinforcement learning algorithm, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm or a flexible actuation evaluation SAC algorithm.
[0339] In a possible implementation of the third aspect, see Fig.21 The neural network acquisition device 2000 also includes: an initialization unit 2005, which is used to initialize the parameters of the second neural network using the parameters of the first neural network.
[0340] In one possible design, the acquisition unit 2001 is specifically used to: input environmental state information into the first neural network to obtain skills selected by the first neural network, wherein the environmental state information includes environmental information around the intelligent device in the simulation environment corresponding to the first task and the self-state information of the intelligent device; obtain control instructions through the skills selected by the first neural network to control the intelligent device to perform the first task, and repeat the above steps until the number of times the first task is completed by the first neural network reaches a first number, and the number of times the result of completing the first task successfully in the first number is counted to obtain a second number, and the first success rate is calculated based on the first number and the second number.
[0341] In one possible design, see Fig.21 The acquisition unit 2001 is also used to acquire control instructions through the skill selected by the first neural network to control the intelligent device to perform the first task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first task; the training unit 2004 is also used to train the first neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first task when the loss function of the first neural network has not converged, until the convergence condition of the loss function of the first neural network is reached to obtain a mature first neural network; the acquisition unit 2001 is specifically used to obtain the success rate of the mature first neural network in completing the first task as the first success rate.
[0342] In one possible design, the acquisition unit 2001 is specifically used to: obtain semantic information of the first task, and obtain semantic information of the second task; obtain a first success rate based on the similarity between the semantic information of the first task and the semantic information of the second task, wherein the higher the similarity, the higher the first success rate.
[0343] In a possible design, the skills in the skill library are driving skills; or, the skills in the skill library are carrying skills; or, the skills in the skill library are grasping skills.
[0344] It should be noted that the information interaction, execution process, etc. between the modules / units in the neural network acquisition device 2000 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.
[0345] The present application also provides a server. Fig. 22 , Fig. 22 This is a schematic diagram of a server structure provided in an embodiment of the present application. The server 2200 may be deployed with Fig.16 and Fig.17 The neural network acquisition device 1600 described in the corresponding embodiment is used to implement Figures 3 to 12 Corresponding to the functions of the server in the embodiment, or, the server 2200 may be deployed with Fig.18 and Fig.19 The neural network acquisition device 1800 described in the corresponding embodiment is used to implement Fig.12 Corresponding to the functions of the server in the embodiment, or, the server 2200 may be deployed with Fig. 20 and Fig.21 The neural network acquisition device 2000 described in the corresponding embodiment is used to implement the Figures 3 to 12The functions of the server in the corresponding embodiment. Specifically, the server 2200 is implemented by one or more servers. The server 2200 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 2223 (for example, one or more processors) and memory 2232, and one or more storage media 2230 (for example, one or more massive storage devices) storing application programs 2242 or data 2244. Among them, the memory 2232 and the storage medium 2230 can be short-term storage or persistent storage. The program stored in the storage medium 2230 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 processing unit 2222 can be configured to communicate with the storage medium 2230 to execute a series of instruction operations in the storage medium 2230 on the server 2200. However, it should be understood that Fig. 22 The server shown in the figure is only an example of a server. The server 2200 may not include the memory 2232 and the storage medium 2230, but an external memory may be configured outside the server 2200. That is, the memory 2232 and the storage medium 2230 and the central processor 2222 may be independent devices. As an example, an external memory is used in a vehicle-mounted server.
[0346] The server 2200 may also include one or more power supplies 2226, one or more wired or wireless network interfaces 2250, one or more input and output interfaces 2258, and / or one or more operating systems 2241, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0347] In the embodiment of the present application, the central processor 2222 is used to execute Figure 3 The method for acquiring the neural network executed by the server in the corresponding embodiment, or for executing Fig.13 The method for obtaining the neural network executed by the server in the corresponding embodiment. It should be noted that the specific implementation of the method for obtaining the neural network executed by the central processor 2222 can refer to Figure 3 as well as Fig.13 The descriptions in the corresponding method embodiments will not be repeated here one by one.
[0348] 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 12 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 Fig.13 The illustrated embodiment describes the steps performed by the server in the method.
[0349] 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 12 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 Fig.13 The illustrated embodiment describes the steps performed by the server in the method.
[0350] 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 12 The method for obtaining the neural network described in the embodiment shown, or, to enable the chip in the server to execute the above Fig.13 The method for acquiring a neural network described in the illustrated embodiment. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc. The storage unit may also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0351] For details, please refer to Fig.23 , Fig.23 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 acquisition device NPU 230, NPU 230 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 230, and the controller 2304 controls the operation circuit 2303 to extract the matrix data in the memory and perform multiplication operations.
[0352] In some implementations, the operation circuit 2303 includes multiple processing units (Process Engine, PE) inside. In some implementations, the operation circuit 2303 is a two-dimensional systolic array. The operation circuit 2303 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 2303 is a general-purpose matrix processor.
[0353] 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 2302 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory 2301 and performs matrix operation with matrix B, and the partial result or final result of the matrix is stored in the accumulator 2308.
[0354] The unified memory 2306 is used to store input data and output data. The weight data is directly transferred to the weight memory 2302 through the storage unit access controller (Direct Memory Access Controller, DMAC) 2305. The input data is also transferred to the unified memory 2306 through the DMAC.
[0355] BIU stands for Bus Interface Unit, i.e., bus interface unit 2310 , which is used for the interaction between AXI bus and DMAC and instruction fetch buffer (IFB) 2309 .
[0356] The bus interface unit 2310 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 2309 to obtain instructions from the external memory, and is also used for the storage unit access controller 2305 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0357] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 2306 or to transfer weight data to the weight memory 2302 or to transfer input data to the input memory 2301.
[0358] The vector calculation unit 2307 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.
[0359] In some implementations, the vector calculation unit 2307 can store the processed output vector to the unified memory 2306. For example, the vector calculation unit 2307 can apply a linear function and / or a nonlinear function to the output of the operation circuit 2303, 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 2307 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 2303, for example, for use in a subsequent layer in a neural network.
[0360] An instruction fetch buffer 2309 connected to the controller 2304 is used to store instructions used by the controller 2304;
[0361] Unified memory 2306, input memory 2301, weight memory 2302 and instruction fetch memory 2309 are all On-Chip memories. External memories are private to the NPU hardware architecture.
[0362] Among them, when the first neural network, skill, new skill or skill selected by the second neural network is specifically expressed as a neural network, the operation of each layer in the neural network can be performed by the operation circuit 2303 or the vector calculation unit 2307.
[0363] 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.
[0364] 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.
[0365] 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.
[0366] 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.
[0367] 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 method for acquiring a neural network, characterized in that: The method comprises: Obtaining a first success rate of a first neural network for completing a first task, wherein the first neural network is used to select a skill from a skill library for completing the first task; When the first success rate is less than a preset threshold, obtaining a second neural network and a new skill, and adding the new skill to the skill library to update the skill library, wherein the parameters of the second neural network are initialized based on the parameters of the first neural network, and the second neural network is used to select a skill for completing the first task from the updated skill library; Based on the simulation environment corresponding to the first task, the second neural network is trained using a reinforcement learning algorithm until a second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, wherein, when the skill selected by the second neural network for completing the first task is a new skill, the parameters of the new skill are updated using the reinforcement learning algorithm according to the acquired data of executing the first task; The trained second neural network and the updated skill library are stored.
2. The method according to claim 1, characterized in that The training of the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first task includes: Inputting environmental state information into the second neural network to obtain a skill selected by the second neural network, wherein the environmental state information includes environmental information around the smart device in the simulation environment corresponding to the first task and state information of the smart device itself; Acquire control instructions through the skill selected by the second neural network to control the smart device to perform the first task, and acquire data of the smart device performing the first task; Based on the acquired data of the smart device executing the first task, the parameters of the second neural network are updated using a reinforcement learning algorithm.
3. The method according to claim 2, characterized in that After inputting the environmental state information into the second neural network and acquiring the skill selected by the second neural network, the method further includes: In the case where the skill selected by the second neural network is the new skill, the parameters of the new skill are updated using a reinforcement learning algorithm based on the acquired data of the smart device executing the first task.
4. The method according to claim 2, characterized in that: The step of updating the parameters of the second neural network by using a reinforcement learning algorithm includes: The parameters of the second neural network are updated by using a first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization (PPO) algorithm, a trust region policy optimization (TRPO) algorithm, or a temporal difference (TD) algorithm.
5. The method according to claim 3, characterized in that: The step of updating the parameters of the new skill by using a reinforcement learning algorithm includes: The parameters of the new skill are updated by using a second reinforcement learning algorithm, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm or a flexible actuation evaluation SAC algorithm.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The parameters of the second neural network are initialized using the parameters of the first neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task.
7. The method according to any one of claims 1 to 5, characterized in that: The first neural network and the skill library are obtained by training using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task. The method further includes: When the first success rate is greater than or equal to the preset threshold, determining the first neural network as a neural network for completing the first task; The first neural network and the skill library are stored.
8. The method according to any one of claims 1 to 5, characterized in that: The obtaining of a first success rate of the first neural network for completing the first task includes: Inputting environmental state information into the first neural network to obtain a skill selected by the first neural network, wherein the environmental state information includes environmental information around the smart device in the simulation environment corresponding to the first task and the state information of the smart device itself; Acquire control instructions through the skill selected by the first neural network to control the smart device to perform the first task; Repeat the above steps until the number of times the first task is completed by the first neural network reaches a first number; Counting the number of times the first task is completed successfully during the first number of times to obtain a second number; The first success rate is calculated according to the first number of times and the second number of times.
9. The method according to claim 8, characterized in that Before inputting the environmental state information into the first neural network, the method further includes: The skill acquisition control instruction selected by the first neural network is used to control the smart device to perform the first task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second task, and the semantic information of the second task is similar to the semantic information of the first task; In the case where the loss function of the first neural network has not converged, the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to the first task until a convergence condition of the loss function of the first neural network is reached, thereby obtaining a mature first neural network; The obtaining of a first success rate of the first neural network for completing the first task includes: The success rate of the mature first neural network in completing the first task is obtained as the first success rate.
10. The method according to any one of claims 1 to 5, characterized in that: The obtaining of a first success rate of the first neural network for completing the first task includes: Acquiring semantic information of the first task, and acquiring semantic information of a second task, wherein the semantic information of the second task is similar to the semantic information of the first task, and the first neural network is trained by using a reinforcement learning algorithm based on a simulation environment corresponding to the second task; The first success rate is obtained according to the similarity between the semantic information of the first task and the semantic information of the second task, wherein the higher the similarity is, the higher the first success rate is.
11. The method according to any one of claims 1 to 5, characterized in that: The skills in the skill library are driving skills; or, The skills in the skill library are handling skills; or, The skills in the skill library are grasping skills.
12. A method for acquiring a neural network, characterized in that: The method comprises: Obtaining a first success rate of a first neural network for completing a first driving task, wherein the first neural network is used to select a driving skill for completing the first driving task from a skill library; When the first success rate is less than a preset threshold, obtaining a second neural network and a new driving skill, and adding the new driving skill to the skill library to update the skill library, wherein the parameters of the second neural network are initialized based on the parameters of the first neural network, and the second neural network is used to select a driving skill for completing the first driving task from the updated skill library; Based on the simulation environment corresponding to the first driving task, the second neural network is trained using a reinforcement learning algorithm until a second success rate of the second neural network for completing the first driving task is greater than or equal to the preset threshold, wherein, when the skill selected by the second neural network for completing the first driving task is a new skill, the parameters of the new skill are updated using the reinforcement learning algorithm according to the acquired data of performing the first driving task; The trained second neural network and the updated skill library are stored.
13. The method according to claim 12, characterized in that The training of the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first driving task includes: Inputting environmental state information into the second neural network to obtain the driving skill selected by the second neural network, the environmental state information including environmental information around the car in the simulation environment corresponding to the first driving task and the car's own state information; Acquire control instructions through the driving skills selected by the second neural network to control the vehicle to perform the first driving task, and acquire data of the vehicle performing the first driving task; Based on the acquired data of the car performing the first driving task, the parameters of the second neural network are updated using a reinforcement learning algorithm.
14. The method according to claim 13, characterized in that After inputting the environmental state information into the second neural network and acquiring the driving skill selected by the second neural network, the method further includes: In the case where the driving skill selected by the second neural network is the new driving skill, the parameters of the new driving skill are updated using a reinforcement learning algorithm based on the acquired data of the car performing the first driving task.
15. The method according to claim 13, characterized in that The step of updating the parameters of the second neural network by using a reinforcement learning algorithm includes: The parameters of the second neural network are updated by using a first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization (PPO) algorithm, a trust region policy optimization (TRPO) algorithm, or a temporal difference (TD) algorithm.
16. The method according to claim 14, characterized in that The method of updating the parameters of the new driving skill by using a reinforcement learning algorithm includes: The parameters of the new driving skill are updated by using a second reinforcement learning algorithm, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm or a flexible actuation evaluation SAC algorithm.
17. The method according to any one of claims 12 to 16, characterized in that: The method further comprises: The parameters of the second neural network are initialized using the parameters of the first neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task.
18. The method according to any one of claims 12 to 16, characterized in that The first neural network and the skill library are obtained by training using a reinforcement learning algorithm based on a simulation environment corresponding to a second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task. The method further includes: When the first success rate is greater than or equal to the preset threshold, determining the first neural network as a neural network for completing the first driving task; The first neural network and the skill library are stored.
19. The method according to any one of claims 12 to 16, characterized in that: The obtaining of a first success rate of the first neural network for completing the first driving task includes: Inputting environmental state information into the first neural network to obtain driving skills selected by the first neural network, wherein the environmental state information includes environmental information around the car in the simulation environment corresponding to the first driving task and the car's own state information; Acquiring control instructions through the driving skills selected by the first neural network to control the vehicle to perform the first driving task; Repeat the above steps until the number of times the first driving task is completed by the first neural network reaches a first number; Counting the number of times the first driving task is successfully completed in the first number of times to obtain a second number; The first success rate is calculated according to the first number of times and the second number of times.
20. The method according to claim 19, characterized in that Before inputting the environmental state information into the first neural network, the method further includes: acquiring control instructions through the driving skill selected by the first neural network to control the automobile to perform the first driving task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first driving task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task; In the case where the loss function of the first neural network has not converged, the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to the first driving task until a convergence condition of the loss function of the first neural network is met, thereby obtaining a mature first neural network; The obtaining of a first success rate of the first neural network for completing the first driving task includes: The success rate of the mature first neural network in completing the first driving task is obtained as the first success rate.
21. The method according to any one of claims 12 to 16, characterized in that The obtaining of a first success rate of the first neural network for completing the first driving task includes: Acquiring semantic information of the first driving task, and acquiring semantic information of a second driving task, wherein the semantic information of the second driving task is similar to the semantic information of the first driving task, and the first neural network is trained by using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task; The first success rate is obtained according to the similarity between the semantic information of the first driving task and the semantic information of the second driving task, wherein the higher the similarity is, the higher the first success rate is.
22. A neural network acquisition device, characterized in that: The device comprises: an acquisition unit, configured to acquire a first success rate of a first neural network for completing a first task, wherein the first neural network is configured to select a skill from a skill library for completing the first task; The acquisition unit is further used to acquire a second neural network and a new skill when the first success rate is less than a preset threshold, and add the new skill to the skill library to update the skill library, wherein the parameters of the second neural network are initialized based on the parameters of the first neural network, and the second neural network is used to select a skill for completing the first task from the updated skill library; a training unit, configured to train the second neural network using a reinforcement learning algorithm based on the simulation environment corresponding to the first task, until a second success rate of the second neural network for completing the first task is greater than or equal to the preset threshold, wherein when the skill selected by the second neural network for completing the first task is a new skill, the parameters of the new skill are updated using the reinforcement learning algorithm according to the acquired data of executing the first task; A storage unit is used to store the trained second neural network and the updated skill library.
23. The device according to claim 22, characterized in that The training unit is specifically used for: Inputting environmental state information into the second neural network to obtain a skill selected by the second neural network, wherein the environmental state information includes environmental information around the smart device in the simulation environment corresponding to the first task and state information of the smart device itself; Acquire control instructions through the skill selected by the second neural network to control the smart device to perform the first task, and acquire data of the smart device performing the first task; Based on the acquired data of the smart device executing the first task, the parameters of the second neural network are updated using a reinforcement learning algorithm.
24. The device according to claim 23, characterized in that The training unit is also used to update the parameters of the new skill using a reinforcement learning algorithm based on the acquired data of the smart device performing the first task when the skill selected by the second neural network is the new skill.
25. The device according to claim 23, characterized in that The training unit is specifically used to update the parameters of the second neural network using a first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm or a time difference TD algorithm.
26. The device according to claim 24, characterized in that The training unit is specifically used to update the parameters of the new skill using a second reinforcement learning algorithm, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm or a flexible actuation evaluation SAC algorithm.
27. The device according to any one of claims 22 to 26, characterized in that The device also includes: an initialization unit, used to initialize the parameters of the second neural network using the parameters of the first neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task.
28. The device according to any one of claims 22 to 26, characterized in that The first neural network and the skill library are trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second task, and the semantic information of the second task is similar to the semantic information of the first task; The device further includes: a determination unit, configured to determine the first neural network as a neural network for completing the first task if the first success rate is greater than or equal to the preset threshold; The storage unit is also used to store the first neural network and the skill library.
29. The device according to any one of claims 22 to 26, characterized in that The acquisition unit is specifically used for: Inputting environmental state information into the first neural network to obtain a skill selected by the first neural network, wherein the environmental state information includes environmental information around the smart device in the simulation environment corresponding to the first task and the state information of the smart device itself; Acquire control instructions through the skill selected by the first neural network to control the smart device to perform the first task; Repeat the above steps until the number of times the first task is completed by the first neural network reaches a first number; Counting the number of times the first task is completed successfully during the first number of times to obtain a second number; The first success rate is calculated according to the first number of times and the second number of times.
30. The device according to claim 29, characterized in that The acquisition unit is further used to control the smart device to perform the first task through the skill acquisition control instruction selected by the first neural network, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second task, and the semantic information of the second task is similar to the semantic information of the first task; The training unit is further configured to train the first neural network using a reinforcement learning algorithm based on a simulation environment corresponding to the first task when the loss function of the first neural network has not converged, until a convergence condition of the loss function of the first neural network is reached, thereby obtaining a mature first neural network; The acquisition unit is specifically used to acquire a success rate of the mature first neural network in completing the first task as the first success rate.
31. The device according to any one of claims 22 to 26, characterized in that The acquisition unit is specifically used for: Acquiring semantic information of the first task, and acquiring semantic information of a second task, wherein the semantic information of the second task is similar to the semantic information of the first task, and the first neural network is trained by using a reinforcement learning algorithm based on a simulation environment corresponding to the second task; The first success rate is obtained according to the similarity between the semantic information of the first task and the semantic information of the second task, wherein the higher the similarity is, the higher the first success rate is.
32. The device according to any one of claims 22 to 26, characterized in that The skills in the skill library are driving skills; or, The skills in the skill library are handling skills; or, The skills in the skill library are grasping skills.
33. A neural network acquisition device, characterized in that: The device comprises: an acquisition unit, configured to acquire a first success rate of a first neural network for completing a first driving task, wherein the first neural network is used to select a driving skill for completing the first driving task from a skill library; The acquisition unit is further used for acquiring a second neural network and a new driving skill when the first success rate is less than a preset threshold, and adding the new driving skill to the skill library to update the skill library, wherein the parameters of the second neural network are initialized based on the parameters of the first neural network, and the second neural network is used for selecting a driving skill for completing the first driving task from the updated skill library; a training unit, configured to train the second neural network using a reinforcement learning algorithm based on a simulation environment corresponding to the first driving task, until a second success rate of the second neural network for completing the first driving task is greater than or equal to the preset threshold, wherein when the skill selected by the second neural network for completing the first driving task is a new skill, the reinforcement learning algorithm is used to update the parameters of the new skill according to the acquired data of executing the first driving task; A storage unit is used to store the trained second neural network and the updated skill library.
34. The device according to claim 33, characterized in that The training unit is specifically used for: Inputting environmental state information into the second neural network to obtain the driving skill selected by the second neural network, the environmental state information including environmental information around the smart device in the simulation environment corresponding to the first driving task and the state information of the smart device itself; Acquire control instructions through the driving skill selected by the second neural network to control the smart device to perform the first driving task, and acquire data of the smart device performing the first driving task; According to the acquired data of the smart device executing the first driving task, the parameters of the second neural network are updated using a reinforcement learning algorithm.
35. The device according to claim 34, characterized in that The training unit is also used to update the parameters of the new driving skill by using a reinforcement learning algorithm based on the data obtained from the smart device performing the first driving task when the driving skill selected by the second neural network is the new driving skill.
36. The device according to claim 34, characterized in that The training unit is specifically used to update the parameters of the second neural network using a first reinforcement learning algorithm, wherein the first reinforcement learning algorithm is a proximal policy optimization PPO algorithm, a trust region policy optimization TRPO algorithm or a time difference TD algorithm.
37. The device according to claim 35, characterized in that The training unit is specifically used to update the parameters of the new driving skill using a second reinforcement learning algorithm, wherein the second reinforcement learning algorithm is a deep deterministic policy gradient DDPG algorithm, a deep Q network DQN algorithm, a PPO algorithm or a flexible actuation evaluation SAC algorithm.
38. The device according to any one of claims 33 to 37, characterized in that The device also includes: an initialization unit, used to initialize the parameters of the second neural network using the parameters of the first neural network, wherein the first neural network is trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task.
39. The device according to any one of claims 33 to 37, characterized in that The first neural network and the skill library are trained using a reinforcement learning algorithm based on a simulation environment corresponding to a second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task; The device further includes: a determination unit, configured to determine the first neural network as a neural network for completing the first driving task if the first success rate is greater than or equal to the preset threshold; The storage unit is also used to store the first neural network and the skill library.
40. The device according to any one of claims 33 to 37, characterized in that The acquisition unit is specifically used for: Inputting environmental state information into the first neural network to obtain the driving skill selected by the first neural network, wherein the environmental state information includes environmental information around the smart device in the simulation environment corresponding to the first driving task and the state information of the smart device itself; Acquire control instructions through the driving skills selected by the first neural network to control the smart device to perform the first driving task; Repeat the above steps until the number of times the first driving task is completed by the first neural network reaches a first number; Counting the number of times the first driving task is successfully completed in the first number of times to obtain a second number; The first success rate is calculated according to the first number of times and the second number of times.
41. The device according to claim 40, characterized in that The acquisition unit is further used to acquire a control instruction through the driving skill selected by the first neural network to control the smart device to perform the first driving task, so as to determine whether the loss function of the first neural network converges in the simulation environment corresponding to the first driving task, wherein the first neural network is trained by using a reinforcement learning algorithm based on the simulation environment corresponding to the second driving task, and the semantic information of the second driving task is similar to the semantic information of the first driving task; The training unit is further configured to train the first neural network using a reinforcement learning algorithm based on a simulation environment corresponding to the first driving task when the loss function of the first neural network has not converged, until a convergence condition of the loss function of the first neural network is met, thereby obtaining a mature first neural network; The acquisition unit is specifically used to acquire a success rate of the mature first neural network in completing the first driving task as the first success rate.
42. The device according to any one of claims 33 to 37, characterized in that The acquisition unit is specifically used for: Acquiring semantic information of the first driving task, and acquiring semantic information of a second driving task, wherein the semantic information of the second driving task is similar to the semantic information of the first driving task, and the first neural network is trained by using a reinforcement learning algorithm based on a simulation environment corresponding to the second driving task; The first success rate is obtained according to the similarity between the semantic information of the first driving task and the semantic information of the second driving task, wherein the higher the similarity is, the higher the first success rate is.
43. A server, characterized in that: The invention comprises a processor, wherein the processor is coupled to a memory, wherein the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the method according to any one of claims 1 to 11 is implemented, or a computer is caused to execute the method according to any one of claims 12 to 21.
44. 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 11, or causes the computer to execute the method according to any one of claims 12 to 21.
45. A circuit system, characterized in that: The circuit system comprises a processing circuit, wherein the processing circuit is configured to perform the method according to any one of claims 1 to 11, or to enable a computer to perform the method according to any one of claims 12 to 21.
