Robot path planning method and system based on priority experience replay mechanism
By introducing a priority experience replay mechanism into the DDPG algorithm, combined with TD-error, Actor network loss function and immediate reward, the priority of experience samples is dynamically adjusted, which solves the problems of poor environmental adaptability and slow convergence speed of the DDPG algorithm in path planning. A more efficient training process and a more stable path planning effect are achieved.
Patent Information
- Application Number
- CN202211199553.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The DDPG algorithm has problems with poor environmental adaptability, low success rate, and slow convergence speed in robot path planning. This is mainly because the random experience playback mechanism cannot fully utilize important experience samples, which affects the training efficiency of the neural network.
Adopting a priority-based experience replay mechanism, by comprehensively considering TD-error, the loss function of the Actor network, and immediate rewards, the experience samples are dynamically prioritized, giving positive experiences a higher priority, and indexing them in the next round of training. Attenuation ensures diversity and efficient utilization of experience samples.
It improves the success rate and convergence speed of robot path planning, significantly accelerates the network training process, and improves the utilization of experience samples and training stability.
Smart Images

Figure CN115509233B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot path planning, and in particular to a robot path planning method and system based on a priority experience playback mechanism. Background Art
[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.
[0003] With the in-depth research on robots and artificial intelligence technology, the types of intelligent robots are becoming increasingly diverse, and they are playing an increasingly important role in various industries. Path planning enables intelligent robots to find a collision-free and safe path from the starting point to the end point in a specified area. It is the basis of intelligent robot movement and a hot topic of current research. The process is to perceive the surrounding environment information of the intelligent robot through sensors, determine its own position, and then find an optimal path from the current position to the specified position in the environment.
[0004] In recent years, deep reinforcement learning (DRL) has been widely used in many fields, and the path planning algorithm combined with deep reinforcement learning has gradually become a research focus. Deep reinforcement learning does not require the robot to understand the environment in advance, but predicts the next action by perceiving the state of the surrounding environment, obtains rewards from environmental feedback after executing the action, and enables the robot to migrate from the current state to the next state. Repeat the cycle until the robot reaches the target point or reaches the set maximum number of steps. DeepMind proposed the DDPG (Deep Deterministic Policy Gradient) algorithm, which uses a deterministic policy gradient algorithm, combines the Actor-critic framework with DQN, and uses a convolutional neural network to simulate the policy function and Q function, so that the output result is a determined action value, which solves the problem that deep reinforcement learning cannot be applied or performs poorly in high-dimensional or continuous action tasks. It is currently an effective path planning algorithm. However, due to the insufficient utilization of experience samples, the DDPG algorithm has poor environmental adaptability to robot path planning, and has problems such as low success rate and slow convergence speed.
[0005] Traditional DDPG uses a random experience replay mechanism, where the experience generated by the robot t ,a t ,r t ,s t+1 ] are stored in the experience pool, and experience samples are randomly selected to train the neural network. By breaking the temporal correlation between experiences, the problem of experience not being reusable is solved, and the robot's learning process is accelerated. However, ER uses a unified random sampling strategy, which does not consider the different importance of different experiences to robot learning, and cannot make full use of high-importance experiences, affecting the training efficiency of the neural network. Summary of the invention
[0006] In order to address the deficiencies of the prior art, the present invention provides a robot path planning method and system based on a priority experience replay mechanism; the present invention proposes a priority experience replay mechanism with dynamic sample priority, which comprehensively considers TD-error, the loss function of the Actor network and the immediate reward of the experience, and sets the priority of the experience by weighted summation of the three. When sampling experience, a higher priority is given to experience with a reward greater than zero (positive experience), and these experiences are used to update network parameters. After the positive experience samples are selected for training, in the next round of training, the priority of these experience samples is exponentially decayed until it drops to the average value of the priority sequence. Increasing the diversity of experience samples and improving the utilization rate of experience samples solves the problems of low success rate and slow convergence speed of path planning of the DDPG algorithm.
[0007] In a first aspect, the present invention provides a robot path planning method based on a priority experience replay mechanism;
[0008] The robot path planning method based on the priority experience replay mechanism includes:
[0009] Obtain the current state and target position of the path planning robot; input the current state and target position of the path planning robot into the trained deep deterministic policy gradient network to obtain the robot action; the path planning robot completes the robot's path planning based on the obtained robot action;
[0010] Among them, after training, the deep deterministic policy gradient network, during the training process, the experience generated by the robot is stored in the experience pool, and the storage method adopts the experience sample priority sequence;
[0011] Among them, the construction process of the experience sample priority sequence is:
[0012] Calculate the priority of the time difference error, the priority of the current Actor network loss function, and the priority of the immediate reward; use information entropy to determine the weights of the three, use weighted summation to calculate the experience sample priority, and construct the experience sample priority sequence;
[0013] When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters.
[0014] Furthermore, the method further comprises:
[0015] After the experience is selected to participate in the training, in the next round of training, the priority of the experience that has participated in the training will be decayed, and it will be determined whether the average value of all priorities after decay is less than the set threshold. If so, the priority of the experience sample will be increased. If not, the priority decay will continue until it is reduced to the average value of the priority sequence.
[0016] In a second aspect, the present invention provides a robot path planning system based on a priority experience playback mechanism;
[0017] The robot path planning system based on the priority experience playback mechanism includes:
[0018] An acquisition module is configured to: acquire the current state and target position of the path planning robot;
[0019] The path planning module is configured to: input the current state and target position of the path planning robot into the trained deep deterministic policy gradient network to obtain the robot action; the path planning robot completes the path planning of the robot according to the obtained robot action;
[0020] Among them, after training, the deep deterministic policy gradient network, during the training process, the experience generated by the robot is stored in the experience pool, and the storage method adopts the experience sample priority sequence;
[0021] Among them, the construction process of the experience sample priority sequence is as follows: calculate the priority of the time difference error, the priority of the current Actor network loss function, and the priority of the immediate reward; use information entropy to determine the weights of the three, use weighted summation to calculate the experience sample priority, and construct the experience sample priority sequence;
[0022] When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters.
[0023] In a third aspect, the present invention further provides an electronic device, comprising:
[0024] a memory for non-transitory storage of computer-readable instructions; and
[0025] a processor for executing the computer readable instructions,
[0026] When the computer-readable instructions are executed by the processor, the method described in the first aspect is executed.
[0027] In a fourth aspect, the present invention further provides a storage medium that non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, the instructions of the method described in the first aspect are executed.
[0028] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, wherein the computer program is used to implement the method described in the first aspect when running on one or more processors.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] In view of the problems of single sample and low sample utilization in the experience replay mechanism based on the DDPG algorithm, the present invention proposes a priority experience replay mechanism of dynamic sample priority sequence, which combines TD-error, Actor network loss function and immediate reward, uses information entropy to determine the weights of the three, calculates the priority of experience samples by weighted sum, and constructs the experience sample priority sequence; gives positive experience a higher priority so that it is sampled first to accelerate network convergence; fully considers the diversity of experience samples, and when positive experience is trained, its priority decays exponentially in each subsequent round until it reaches the average value of the priority sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0032] Figure 1 This is a schematic diagram of a process for adjusting the priority of experience samples according to the first embodiment of the present invention;
[0033] Figure 2 This is a flowchart of the priority experience playback of the first embodiment of the present invention. DETAILED DESCRIPTION
[0034] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0037] In this embodiment, all data is obtained in compliance with laws and regulations and based on the user's consent, and is used legally.
[0038] Terminology explanation:
[0039] Robot path planning: allows the intelligent robot to find a collision-free and safe path from the starting point to the end point in a specified area.
[0040] Deep reinforcement learning (DRL): Combining the perception ability of deep learning with the decision-making ability of reinforcement learning is an artificial intelligence method that is closer to the way humans think.
[0041] DDPG: An algorithm for robot path planning
[0042] Experience Replay (ER): Part of the robot path planning training process, a technique that stabilizes the probability distribution of experience, which can improve the stability of training.
[0043] Prioritized Experience Replay (PER): Improved on experience replay, using non-uniform sampling instead of uniform sampling to extract experience.
[0044] Information entropy: describes the uncertainty of the occurrence of various possible events in information.
[0045] DeepMind proposed the concept of Prioritized Experience Replay (PER), which measures the priority of experience by the absolute value of the temporal difference error (TD-error). The larger the TD-error, the more important the experience is to the robot's learning. Conversely, the smaller the TD-error, the less important the experience is. This allows the robot to focus on highly important experiences, further improve the utilization of experience, and speed up the robot's learning process. However, the PER learning process often ignores the role of immediate rewards and experiences with smaller TD-errors, leading to the problem of single samples.
[0046] Embodiment 1
[0047] This embodiment provides a robot path planning method based on a priority experience playback mechanism;
[0048] like Figure 1 As shown, the robot path planning method based on the priority experience replay mechanism includes:
[0049] S101: Obtain the current state and target position of the path planning robot;
[0050] S102: inputting the current state and target position of the path planning robot into the trained deep deterministic policy gradient network to obtain the robot action; the path planning robot completes the path planning of the robot according to the obtained robot action;
[0051] Among them, after training, the deep deterministic policy gradient network, during the training process, the experience generated by the robot is stored in the experience pool, and the storage method adopts the experience sample priority sequence;
[0052] Among them, the construction process of the experience sample priority sequence is:
[0053] Calculate the priority of the time difference error, the priority of the current Actor network loss function, and the priority of the immediate reward; use information entropy to determine the weights of the three, use weighted summation to calculate the experience sample priority, and construct the experience sample priority sequence;
[0054] When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters.
[0055] Furthermore, the method further comprises:
[0056] After the experience is selected to participate in the training, in the next round of training, the priority of the experience that has participated in the training will be decayed, and it will be determined whether the average value of all priorities after decay is less than the set threshold. If so, the priority of the experience sample will be increased. If not, the priority decay will continue until it is reduced to the average value of the priority sequence.
[0057] Furthermore, the network structure of the trained deep deterministic policy gradient network includes:
[0058] The Actor module, experience pool and Critic module are connected in sequence;
[0059] The Actor module includes: a current Actor network and a target Actor network connected in sequence;
[0060] The Critic module includes: a current Critic network and a target Critic network connected in sequence;
[0061] The current Actor network and the current Critic network are connected to each other.
[0062] Furthermore, during the training of the trained deep deterministic policy gradient network, the interaction process between the robot and the environment is as follows:
[0063] At each time t, the robot's current Actor network is based on the environment state s t Get action a t , acting on the environment to obtain an immediate reward r t and the next moment environment state s t+1 , the current Critic network is based on the environment state s t and action a t Get the Q value Q(s t ,a t ), for action a t Conduct evaluation;
[0064] Sample the i-th experience [s i ,a i ,r i ,s i+1 ], the current Actor network is based on the Q value Q(s t ,a t )Adjust the action strategy. The loss function of the current Actor network is Q represents the Q value generated by the current Critic network, s i represents the state sampled from the experience pool, a i represents the action sampled from the experience pool, θ Q Represents the parameters of the current Actor network, Q(s t ,a t ) indicates state s t and action a t value.
[0065] The target Actor network is based on the next moment environment state s t+1 Get the estimated action a';
[0066] The target critic network is based on the next moment environment state s t+1 And estimate the action a' to get the Q' value Q'(s t+1 ,a');Q'(s t+1 ,a') represents the state s t+1 and the value of action a';
[0067] The difference between the Q value and the Q' value is calculated to obtain the time difference error TD-error.
[0068] It should be understood that information entropy represents the probability of occurrence of discrete random events, and measures the amount of information in order to eliminate the uncertainty of events. The more information introduced to eliminate the uncertainty of events, the higher the information entropy, and vice versa.
[0069] The calculation of information entropy H(X) is shown in formula (1):
[0070]
[0071] Among them, X represents an unknown event, p i Represents the probability of an unknown event occurring.
[0072] The effects of immediate reward, TD-error and Actor network loss function on the robot training process are comprehensively considered and introduced into the construction process of the priority sequence of experience samples. However, simply accumulating and summing the three factors cannot determine the extent of their influence on training, which may cause one factor to account for too much, resulting in inaccurate calculated experience sample priorities. In order to eliminate the uncertainty of the three types of information, information entropy is introduced to calculate their weight factors.
[0073] Furthermore, the priority of calculating the time difference error, the priority of the current Actor network loss function and the priority of the immediate reward specifically include:
[0074] p im-reward =|r i | (2)
[0075] p TD-error =|δ i | (3)
[0076]
[0077] Among them, ò represents a minimum constant, with a value of 0.05, r i represents the immediate reward, δ i Indicates TD-error, represents the Actor network loss function, Q represents the Q value generated by the current Critic network, and s i represents the state sampled from the experience pool, a i represents the action sampled from the experience pool, θ Q Represents the parameters of the current Actor network, p im-reward represents the priority of immediate reward, p TD-error Indicates the priority of TD-error, p Actor-lossIndicates the priority of the current Actor network loss function.
[0078] Furthermore, the information entropy is used to determine the weights of the three, and the experience sample priority is calculated by weighted summation to construct the experience sample priority sequence, which specifically includes:
[0079]
[0080]
[0081] H(r i )=-p reward>Ravg log2(p reward>Ravg )-p reward<Ravg log2(p reward<Ravg ) (7)
[0082] In a training process of the network model, if the reward obtained by the robot is greater than 0, this training is called active training and the experience samples obtained are called active experience samples. Otherwise, it is called passive training. In formulas (5)-(7), H(TD) represents the TD-error information entropy, H(TA) represents the information entropy of the current Actor network loss function, and H(r i ) represents the immediate reward information entropy, is the probability of TD-error in positive experience training, is the probability of TD-error in negative experience training; is the probability of the Actor network loss function in positive experience training, is the probability of the Actor network loss function in passive training; p reward>Ravg is the probability that the immediate reward is greater than the average reward, p reward<Ravg is the probability that the immediate reward is less than the average reward.
[0083] Calculate the information entropy to determine the weight a of the immediate reward priority, the weight β of the time difference error priority, and the weight υ of the Actor network loss function priority:
[0084]
[0085]
[0086] υ=1-a-β (10)
[0087] In formulas (8)-(10), H(TD) represents the TD-error information entropy, H(TA) represents the information entropy of the current Actor network loss function, and H(r i ) represents the immediate reward information entropy.
[0088] Finally, according to the calculated weight coefficient and p im-reward 、p TD-error and p Actor-loss , use formula (11) to calculate the priority of each experience sample, where ò represents a very small constant. As shown in formula (11):
[0089] p i =(a×p im-reward +β×p TD-error +υ×p Actor-loss )+ò (11)
[0090] Furthermore, if Figure 2 As shown in the figure, when sampling experience, it is determined whether the reward is greater than zero. If so, the priority of the experience sample is increased. If not, the priority of the experience sample is kept unchanged. Experience is sampled in descending order of priority, and then the network parameters are updated. Specifically, it includes:
[0091] When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. In the process of increasing the priority of the experience sample, set the parameter As positive experience (experience with reward greater than zero), the priority weight at the beginning of each round of training is calculated based on the experience sample priority p i , adjust the priority of the experience samples, and make the priority of positive experience samples (experience samples with rewards greater than zero) as follows:
[0092]
[0093] where p′ i >p i ,
[0094] The priority of experience samples with rewards less than or equal to zero is not adjusted and remains p i ;
[0095] According to the priority of the experience sample, calculate the sampling probability P i , according to the sampling probability P i Sampling experience samples from the experience pool for training;
[0096] The sampling probability calculation process is shown in formula (12):
[0097]
[0098] Among them, α is a constant with a value range of [0,1]. When α=0, it means uniform sampling, and n is the total number of empirical samples.
[0099] It should be understood that in the experience pool, experience samples with high absolute values of TD-error usually mean that the Q value of the current Critic network is very different from the Q value of the target Critic network, and have high learning potential. Giving priority to experience playback of such experience samples may lead to a significant improvement in the robot's learning ability.
[0100] However, if we only consider the TD-error factor and ignore the importance of rewards in the training process, it is easy to overuse marginal experience, resulting in network overfitting.
[0101] Positive experiences such as successful experiences or high-reward experiences are also the most important experiences that robots need to learn. Sampling more positive experiences can not only accelerate the convergence of the algorithm, but also effectively alleviate overfitting. Therefore, positive experience samples will be given higher priority for experience playback.
[0102] Furthermore, after the experience is selected to participate in the training, in the next round of training, the priority of the experience that has participated in the training is decayed, and it is determined whether the average value of all priorities after decay is less than the set threshold. If so, the priority of the experience sample is increased, if not, the priority decay continues until it is reduced to the average value of the priority sequence, specifically including:
[0103] Assume that the positive experience sample is j and the priority is p j , the priority sequence of batch sampling of empirical samples is p = (p1, p2, ···p j ···,p n ).
[0104] Then, the priority of j in the next round is p j Exponential decay according to the decay factor σ:
[0105]
[0106] When the priority of the experience sample is greater than the set threshold Z, the priority is allowed to decay, otherwise the decay is stopped;
[0107] The calculation formula of threshold Z is:
[0108]
[0109] In order to quickly learn the latest experience of the robot's interaction with the environment in a limited capacity experience pool, the priority of experience samples needs to be updated in a timely manner.
[0110] The method proposed in the present invention is a DDPG algorithm based on priority sequence sampling. The actor-critic framework of the DDPG algorithm is fully utilized, combined with the actor network loss function, TD-error and immediate reward, and the weighting coefficient is determined according to the information entropy to construct the priority sequence of experience samples. The robot's immediate reward is reasonably called, and the experience samples with immediate rewards greater than zero are regarded as positive experience, and the rest are negative experience. Positive experience is given a higher priority so that it is sampled more frequently, accelerating the training process of the DDPG algorithm. At the same time, in order to take into account the diversity of experience samples, experience samples with low priority can also be sampled. Whenever a positive experience is sampled, its priority will decay exponentially in the next round of training until it is less than or equal to the set threshold. The specific process of the algorithm is as follows Figure 2 shown.
[0111] The present invention conducts experiments to evaluate the DDPG algorithm based on priority sequence sampling. The experiment uses Gazebo physical simulation software for simulation experiments, selects python language and pytorch framework, and uses Ros operating system for information transmission. An important indicator for evaluating the quality of an algorithm is the size of the reward obtained by the robot through interaction with the environment in a round of training according to the algorithm. If the reward value obtained is high and relatively stable, we believe that this algorithm has excellent performance in this environment in this round.
[0112] The robot was trained in four different environments, the first of which had no obstacles, and the other environments had obstacles of different sizes and arrangements. The robot training results showed that in the obstacle-free environment, the PER method was not stable enough, the average reward value was low, and it mainly fluctuated between 0 and 0.5. The method proposed in this invention improved the convergence speed and stabilized after about 50 rounds. The average reward value was high, and it mainly fluctuated between 0.75 and 1.75.
[0113] In an environment with obstacles, the PER method training curve has a large oscillation amplitude, poor risk resistance, and the average reward value mainly fluctuates in the range of -1.0 to 1.0; the average reward value of the method proposed in the present invention rises steadily, mainly fluctuating in the range of 0.5 to 1.0, achieving good results.
[0114] In order to verify the success rate and effectiveness of the proposed method for robot path planning in an unknown environment, after the robot training is completed, it is tested for 200 tasks in a new simulation environment. The test results show that in terms of success rate, the PER method has a success rate of 86%, while the success rate of the algorithm proposed in the present invention can reach 90.5%, which is significantly higher than the PER method; in terms of time consumption, the algorithm of the present invention is 13% faster than the PER algorithm, and the robot reaches the target point more quickly. The algorithm proposed in the present invention has a low trial and error rate in path planning and fewer collisions with obstacles.
[0115] The above experimental results show that in the task of robot path planning, the average reward value of the PER method fluctuates greatly and the training process is unstable, because the method for evaluating the priority of experience samples has only one TD-error indicator, ignoring the role of immediate rewards in network training, resulting in excessive use of marginal experience samples and prone to local optimality. The present invention proposes to construct a composite priority to comprehensively consider the immediate reward, TD-error and feedback of the Actor network, use information entropy to determine the dynamic weighting coefficient, give the experience sample a reasonable priority, the training process gradually stabilizes, and the average reward value is improved compared with PER, indicating that the dynamically adjusted priority guarantees the demand for experience sample diversity in the robot training process. On this basis, the priority sequence sampling mechanism is superimposed, positive experience samples and negative experience samples are distinguished, the priority of positive experience samples is adjusted, and after sampling training, the priority is decayed. The purpose is to quickly train the robot in a limited experience pool. In the comparative experiments with different numbers of training rounds, a higher average reward value is obtained, which proves the effectiveness of the improved algorithm of the present invention.
[0116] Embodiment 2
[0117] This embodiment provides a robot path planning system based on a priority experience playback mechanism;
[0118] The robot path planning system based on the priority experience playback mechanism includes:
[0119] An acquisition module is configured to: acquire the current state and target position of the path planning robot;
[0120] The path planning module is configured to: input the current state and target position of the path planning robot into the trained deep deterministic policy gradient network to obtain the robot action; the path planning robot completes the path planning of the robot according to the obtained robot action;
[0121] Among them, after training, the deep deterministic policy gradient network, during the training process, the experience generated by the robot is stored in the experience pool, and the storage method adopts the experience sample priority sequence;
[0122] Among them, the construction process of the experience sample priority sequence is as follows: calculate the priority of the time difference error, the priority of the current Actor network loss function, and the priority of the immediate reward; use information entropy to determine the weights of the three, use weighted summation to calculate the experience sample priority, and construct the experience sample priority sequence;
[0123] When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters.
[0124] It should be noted that the acquisition module and the path planning module correspond to steps S101 to S102 in Embodiment 1, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0125] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0126] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0127] Embodiment 3
[0128] This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory so that the electronic device executes the method described in the above embodiment one.
[0129] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0130] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0131] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
[0132] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0133] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0134] Embodiment 4
[0135] This embodiment further provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first embodiment is completed.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A robot path planning method based on a priority experience replay mechanism, characterized by: include: Get the current state and target position of the path planning robot; The current state and target position of the path planning robot are input into the trained deep deterministic policy gradient network to obtain the robot action; the path planning robot completes the robot's path planning based on the obtained robot action; Among them, after training, the deep deterministic policy gradient network, during the training process, the experience generated by the robot is stored in the experience pool, and the storage method adopts the experience sample priority sequence; Among them, the construction process of the experience sample priority sequence is: Calculate the priority of the time difference error, the priority of the current Actor network loss function, and the priority of the immediate reward; use information entropy to determine the weights of the three, use weighted summation to calculate the experience sample priority, and construct the experience sample priority sequence; When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters.
2. The robot path planning method based on the priority experience playback mechanism as claimed in claim 1 is characterized in that: The experience is sampled in order of priority from high to low, and then the network parameters are updated, and then the following is also included: After the experience is selected to participate in the training, in the next round of training, the priority of the experience that has participated in the training will be decayed, and it will be determined whether the average value of all priorities after decay is less than the set threshold. If so, the priority of the experience sample will be increased. If not, the priority decay will continue until it is reduced to the average value of the priority sequence.
3. The robot path planning method based on the priority experience playback mechanism as claimed in claim 1 is characterized in that: The interaction process between the robot and the environment during the training of the trained deep deterministic policy gradient network is as follows: At each time t, the robot's current Actor network is based on the environment state s t Get action a t , acting on the environment to obtain an immediate reward r t and the next moment environment state s t+1 , the current Critic network is based on the environment state s t and action a t Get the Q value Q(s t ,a t ), for action a t Conduct evaluation; Sample the i-th experience [s i ,a i ,r i ,s i+1 ], the current Actor network is based on the Q value Q(s t ,a t )Adjust the action strategy. The loss function of the current Actor network is ▽ a Q(s i ,a i |θ Q ); Q represents the Q value generated by the current Critic network, s i represents the state sampled from the experience pool, a i represents the action sampled from the experience pool, θ Q Represents the parameters of the current Actor network, Q(s t ,a t ) indicates state s t and action a t the value of The target Actor network is based on the next moment environment state s t+1 Get the estimated action a'; The target critic network is based on the next moment environment state s t+1 And estimate the action a' to get the Q' value Q'(s t+1 ,a');Q'(s t+1 ,a') represents the state s t+1 and the value of action a'; The difference between the Q value and the Q' value is calculated to obtain the time difference error TD-error.
4. The robot path planning method based on the priority experience playback mechanism as claimed in claim 1 is characterized in that: The priority of calculating the time difference error, the priority of the current Actor network loss function and the priority of the immediate reward specifically include: p im-reward =|r i | (2) p TD-error =|δ i | (3) p Actor-loss =|▽ a Q(s i ,a i |θ Q )| (4) Among them, r i represents the immediate reward, δ i Indicates TD-error, ▽ a Q(s i ,a i |θ Q ) represents the Actor network loss function, Q represents the Q value generated by the current Critic network, s i represents the state sampled from the experience pool, a i represents the action sampled from the experience pool, θ Q Represents the parameters of the current Actor network, p im-reward represents the priority of immediate reward, p TD-error Indicates the priority of TD-error, p Actor-loss Indicates the priority of the current Actor network loss function.
5. The robot path planning method based on the priority experience playback mechanism as claimed in claim 4 is characterized in that: The method of using information entropy to determine the weights of the three, using a weighted sum method to calculate the experience sample priority, and constructing an experience sample priority sequence specifically includes: H(r i )=-p reward>Ravg log2(p reward>Ravg )-p reward<Ravg log2(p reward<Ravg ) (7) In a training process of the network model, if the reward obtained by the robot is greater than 0, this training is called active training and the experience samples obtained are called active experience samples. Otherwise, it is called passive training. In formulas (5)-(7), H(TD) represents the TD-error information entropy, H(TA) represents the information entropy of the current Actor network loss function, and H(r i ) represents the immediate reward information entropy, is the probability of TD-error in positive experience training, is the probability of TD-error in negative experience training; is the probability of the Actor network loss function in positive experience training, is the probability of the Actor network loss function in passive training; p reward>Ravg is the probability that the immediate reward is greater than the average reward, p reward<Ravg is the probability that the immediate reward is less than the average reward; Calculate the information entropy to determine the weight a of the immediate reward priority, the weight β of the time difference error priority, and the weight υ of the Actor network loss function priority: υ=1-a-β (10) In formulas (8)-(10), H(TD) represents the TD-error information entropy, H(TA) represents the information entropy of the current Actor network loss function, and H(r i ) represents the immediate reward information entropy; Finally, according to the calculated weight coefficient and p im-reward 、p TD-error and p Actor-loss , use formula (11) to calculate the priority of each experience sample, where ∈ represents a very small constant; as shown in formula (11): p i =(a×p im-reward +β×p TD-error +υ×p Actor-loss )+∈ (11)。 6. The robot path planning method based on the priority experience playback mechanism as claimed in claim 1 is characterized in that: When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters; Specifically include: When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. In the process of increasing the priority of the experience sample, set the parameter As the priority weight of the experience with a reward greater than zero at the beginning of each round of training, according to the experience sample priority p i , adjust the priority of the experience samples, so that the priority of the experience samples with rewards greater than zero is: where p i 'Indicates the adjusted priority; The priority of experience samples with rewards less than or equal to zero is not adjusted and remains p i ; According to the priority of the experience sample, calculate the sampling probability P i , according to the sampling probability P i Sampling experience samples from the experience pool for training; The sampling probability calculation process is shown in formula (12): Among them, α is a constant with a value range of [0,1]. When α=0, it means uniform sampling, and n is the total number of empirical samples.
7. The robot path planning method based on the priority experience playback mechanism as claimed in claim 2 is characterized in that: After the experience is selected to participate in the training, in the next round of training, the priority of the experience that has participated in the training is decayed, and it is determined whether the average value of all priorities after decay is less than the set threshold. If so, the priority of the experience sample is increased, if not, the priority decay continues until it is reduced to the average value of the priority sequence, including: Assume that the positive experience sample is j and the priority is p j , the priority sequence of batch sampling of empirical samples is p = (p1, p2, ... p j …,p n ); Then, the priority of j in the next round is p j Exponential decay according to the decay factor σ: When the priority of the experience sample is greater than the set threshold Z, the priority is allowed to decay, otherwise the decay is stopped; The calculation formula of threshold Z is:
8. Robot path planning system based on priority experience playback mechanism, including: An acquisition module is configured to: acquire the current state and target position of the path planning robot; The path planning module is configured to: input the current state and target position of the path planning robot into the trained deep deterministic policy gradient network to obtain the robot action; the path planning robot completes the path planning of the robot according to the obtained robot action; Among them, after training, the deep deterministic policy gradient network, during the training process, the experience generated by the robot is stored in the experience pool, and the storage method adopts the experience sample priority sequence; Among them, the construction process of the experience sample priority sequence is as follows: calculate the priority of the time difference error, the priority of the current Actor network loss function, and the priority of the immediate reward; use information entropy to determine the weights of the three, use weighted summation to calculate the experience sample priority, and construct the experience sample priority sequence; When sampling experience, determine whether the reward is greater than zero. If so, increase the priority of the experience sample. If not, keep the priority of the experience sample unchanged. Sample the experience in descending order of priority, and then update the network parameters.
9. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, When the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 7 is executed.
10. A storage medium that non-transitorily stores computer-readable instructions, wherein: When the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Experience playback sampling reinforcement learning method and system based on confidence upper bound thought
CN112734014A
Robot path navigation method and system based on sampling optimization DDPG algorithm
CN113503885A
Decision-making method based on deep reinforcement learning
WO2022083029A1
