Reward shaping method and device for sparse continuous control task, medium and terminal

By constructing a potential energy function network model and using the advantage value difference between states to calculate intrinsic reward signals, the problem of human cognitive bias and exploration-exploitation balance in sparse continuous control tasks is solved, and the efficiency and performance of reinforcement learning are improved.

CN118586282APending Publication Date: 2024-09-03CHONGQING UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410729427.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

In sparse continuous control tasks, existing reward shaping methods are difficult to avoid human cognitive biases and achieve a balance between the exploration and utilization of agents, resulting in inefficient reinforcement learning.

Method used

By constructing a potential energy function network model of a fully connected neural network, the difference in advantage values ​​between the old and new strategies between states is used to calculate the intrinsic reward signal and merge it with the simulated external reward signal to adjust the action strategy of the agent to maximize the cumulative reward and ensure Policy invariance and efficient exploration.

Benefits of technology

It achieves efficient exploration and utilization balance of agents in sparse continuous control tasks, improves reinforcement learning performance, reduces computational costs, and ensures the invariance of the strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586282A
    Figure CN118586282A
Patent Text Reader

Abstract

The invention discloses a sparse continuous control task-oriented reward shaping method and device, a medium and a terminal, and the method comprises the steps: collecting empirical data generated by the interaction of an intelligent agent and a simulation environment, including the action executed by the intelligent agent, the current state information and the next state information of the simulation environment, and a simulation external reward signal; constructing a potential energy function network model by using a full-connection neural network, and obtaining potential energy values of the intelligent agent in the simulation environment in the current state and the next state; according to the potential energy value difference, calculating an internal reward signal through a reward shaping function, and combining the internal reward signal with the simulated external reward signal to obtain a final reward signal; updating the potential energy function network model by using a loss function, and adjusting the strategy of the intelligent agent for executing the action, so that the intelligent agent obtains the maximum accumulated reward in the interaction with the environment; according to the method, the advantage value difference between the new strategy and the old strategy between the states is used as an internal reward, the intelligent agent performance in the sparse continuous control task is improved, and the calculation cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of reinforcement learning technology, and more specifically to a reward shaping method, device, medium and terminal for sparse continuous control tasks. Background Art

[0002] Deep reinforcement learning mimics how humans learn when faced with simulated environments to maximize long-term rewards, but sparse environment rewards are prevalent in most continuous control tasks, making these methods inefficient.

[0003] At present, by designing a suitable reward function, the sparse rewards in a specific environment can be converted into more informative signals, helping the intelligent agent to better understand and learn the characteristics of the environment, so as to be better applied to game design, robotics and other fields.

[0004] Existing reward shaping methods can be divided into two categories: one is curiosity-driven exploration, which encourages agents to actively explore based on their intrinsic curiosity and desire to explore; the other is potential-based reward shaping, which exploits the difference in potential energy functions when the agent transitions between different states.

[0005] However, curiosity-driven exploration becomes ineffective when the state of the environment is unique and uncountable; potential-based reward shaping has been shown to ensure policy invariance, but using human prior knowledge to guide agent learning may lead to subjective judgment.

[0006] Therefore, how to shape rewards in sparse continuous control tasks to avoid introducing human cognitive biases and achieve a balance between the agent's exploration and utilization in order to improve the efficiency of reinforcement learning is an urgent problem that technicians in this field need to solve. Summary of the invention

[0007] In view of this, the present invention provides a reward shaping method, device, medium and terminal for sparse continuous control tasks to solve some of the technical problems mentioned in the background technology.

[0008] In order to achieve the above object, the present invention adopts the following technical solution:

[0009] A reward shaping method for sparse continuous control tasks, comprising the following steps:

[0010] S1. Interaction between the simulation environment and the agent for sparse continuous control tasks;

[0011] S2. Collecting experience data generated by the interaction between the agent and the simulation environment, the experience data includes the actions performed by the agent, the current state information and the next state information of the simulation environment, and the simulation external reward signal;

[0012] S3. Use a fully connected neural network to build a potential energy function network model to obtain the potential energy value corresponding to the simulation environment of the agent in the current state and the next state;

[0013] S4. according to the potential energy value corresponding to the simulation environment of the agent in the current state and the next state, the intrinsic reward signal is calculated by the reward shaping function, and the intrinsic reward signal and the simulated external reward signal are combined to obtain the final reward signal;

[0014] S4. Use the loss function to update the potential function network model and adjust the strategy of the agent to perform actions so that the agent can obtain the maximum cumulative reward in the interaction with the environment.

[0015] Preferably, before step S1, the following steps are also included:

[0016] Construct a sparse continuous control task simulation environment and agent, define the state space S that the agent can reach and the action space A that can be taken, and use a deep reinforcement learning algorithm to simulate the action execution strategy π of the agent ω .

[0017] Preferably, in step S1, the specific content of the interaction between the sparse continuous control task simulation environment and the agent is:

[0018] The agent obtains the current state information of the simulation environment and takes corresponding execution actions through the action execution strategy;

[0019] When the simulation environment changes, the next state information of the simulation environment and the simulation external reward signal are fed back to the agent;

[0020] The state information of the current state information of the simulation environment, the execution action taken, the next state information of the simulation environment, and the simulation external reward signal are stored in the experience pool.

[0021] Preferably, the potential energy function network model constructed using the fully connected neural network in step S3 is specifically:

[0022]

[0023] in, is the potential energy value of the agent in the current state simulation environment, θ is the network parameter, are the value functions corresponding to the new and old execution action strategies in the current state simulation environment, is the prediction of future rewards, and α is the proportion of the value function.

[0024] Preferably, in step S4, the method for calculating the intrinsic reward signal by the reward shaping function is: the intrinsic reward is calculated according to the difference between the potential energy values ​​of the current state and the next state; if the potential energy value of the next state is higher than the potential energy value of the current state, it indicates that the transfer may be beneficial to the agent, and a positive intrinsic reward is given; if the potential energy value of the next state is lower than the potential energy value of the current state, a negative intrinsic reward is given;

[0025] The intrinsic rewards are:

[0026]

[0027] Where F(·) is the reward shaping function, γ is the decay factor, and Respectively represent the TD error of the current state corresponding to the new and old strategies, and They represent the advantage functions of the current state corresponding to the new and old strategies, respectively, and are used to measure the additional benefit of the agent taking a specific action relative to the average reward obtained by random actions in a given state;

[0028] The final reward signal is:

[0029]

[0030] Among them, R t is the final reward signal obtained, For intrinsic rewards, To simulate external rewards.

[0031] Preferably, in step S5, the specific content of updating the potential energy function network model using the loss function is:

[0032] The loss function is calculated using mean square error, and the gradient of the loss function to the network parameters is calculated using the back propagation algorithm, and the network parameters are updated using gradient descent;

[0033] The loss function is:

[0034]

[0035] Among them, θ is the parameter of the potential energy function network, and J(θ) is the loss function;

[0036] The strategy for adjusting the agent's actions is as follows:

[0037] The ratio of new and old strategies is trimmed to limit the magnitude of strategy changes and ensure convergence;

[0038] The specific objective function is:

[0039]

[0040] Among them, ω is the policy network parameter adopted by the agent, E is the expected value operation, c t (ω) is the ratio of the probability of the new and old strategies, clip(·) is the truncation function, ∈ is the truncation hyperparameter, and L(ω) is the strategy π ω The objective function of

[0041] The calculation method that maximizes the cumulative reward of the agent in its interaction with the environment is as follows:

[0042]

[0043] Among them, π ω is the strategy adopted by the agent, H(π ω ) is the strategy π ω The expected value of the long-term reward obtained by the agent.

[0044] A reward shaping device for sparse continuous control tasks, based on the reward shaping method for sparse continuous control tasks, comprising an experience data acquisition module, a potential energy value acquisition module, an intrinsic reward shaping module, a final reward acquisition module and a maximum cumulative reward acquisition module;

[0045] The experience data acquisition module is used to collect the experience data generated by the interaction between the intelligent agent and the simulation environment. The experience data includes the actions performed by the intelligent agent, the current state information and the next state information of the simulation environment, and the simulation external reward signal;

[0046] A potential energy value acquisition module is used to obtain the potential energy values ​​corresponding to the simulation environment of the agent in the current state and the next state by using a potential energy function network model constructed by a fully connected neural network;

[0047] The intrinsic reward shaping module is used to calculate the intrinsic reward signal through the reward shaping function according to the potential energy value corresponding to the simulation environment of the agent in the current state and the next state;

[0048] The final reward acquisition module is used to combine the intrinsic reward signal and the simulated external reward signal to obtain the final reward signal;

[0049] The maximum cumulative reward acquisition module is used to update the potential function network model using the loss function, adjust the strategy of the agent to perform actions, and enable the agent to obtain the maximum cumulative reward in the interaction with the environment.

[0050] Preferably, the reward shaping device for sparse continuous control tasks also includes an initialization module for constructing a sparse continuous control task simulation environment and an intelligent agent, defining the state space that the intelligent agent can reach and the action space that can be taken, and using a deep reinforcement learning algorithm to simulate the action execution strategy of the intelligent agent.

[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a reward shaping method for sparse continuous control tasks.

[0052] A processing terminal includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the reward shaping method for sparse continuous control tasks is implemented.

[0053] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a reward shaping method, device, medium and terminal for sparse continuous control tasks, which utilizes the difference in advantage values ​​between new and old strategies between states as an intrinsic reward, which helps the intelligent agent to maintain a balance between exploration and utilization, so that it is rewarded when exploring unknown areas, while maintaining efficient behavior in known areas. This improves the performance of the intelligent agent in sparse continuous control tasks, reduces computational costs, and ensures the invariance of the strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0055] Figure 1 A schematic flow chart of a reward shaping method for sparse continuous control tasks provided by the present invention;

[0056] Figure 2 Schematic diagram of the interaction between the intelligent agent and the simulation environment provided by the present invention. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] The embodiment of the present invention discloses a reward shaping method for sparse continuous control tasks, such as Figure 1 , including the following steps:

[0059] S1. Interaction between the simulation environment and the agent for sparse continuous control tasks;

[0060] S2. Collect the experience data generated by the interaction between the intelligent agent and the simulation environment. The experience data includes the actions performed by the intelligent agent. t , the current status information of the simulation environment t and the next state information s t+1 , and simulated external reward signals

[0061] S3. Use a fully connected neural network to build a potential energy function network model to obtain the potential energy value corresponding to the simulation environment of the agent in the current state and the next state;

[0062] S4. According to the potential energy value corresponding to the simulation environment of the agent in the current state and the next state, the intrinsic reward signal is calculated through the reward shaping function The intrinsic reward signal and the simulated external reward signal are combined to obtain the final reward signal R t ;

[0063] S4. Use the loss function to update the potential function network model and adjust the strategy of the agent to perform actions so that the agent can obtain the maximum cumulative reward in the interaction with the environment.

[0064] In order to further implement the above technical solution, before step S1, the following steps are also included:

[0065] Construct a sparse continuous control task simulation environment and agent, define the state space S that the agent can reach and the action space A that can be taken, and use a deep reinforcement learning algorithm to simulate the agent's action execution strategy π.

[0066] In order to further implement the above technical solution, in step S1, the specific content of the interaction between the sparse continuous control task simulation environment and the intelligent agent is:

[0067] The agent obtains the current state information of the simulation environment and takes corresponding execution actions through the action execution strategy;

[0068] When the simulation environment changes, the next state information of the simulation environment and the simulation external reward signal are fed back to the agent;

[0069] The state information of the current state information of the simulation environment, the execution action taken, the next state information of the simulation environment, and the simulation external reward signal are stored in the experience pool.

[0070] In order to further implement the above technical solution, in step S3, the potential energy function network model constructed by the fully connected neural network is used to map the state space to the real number space, specifically:

[0071]

[0072] in, is the potential energy value of the agent in the current state simulation environment, θ is the network parameter, are the value functions corresponding to the new and old execution action strategies in the current state simulation environment, is the prediction of future rewards, and α is the proportion of the value function.

[0073] In order to further implement the above technical solution, in step S4, the method for calculating the intrinsic reward signal through the reward shaping function is: the intrinsic reward is calculated according to the difference between the potential energy values ​​of the current state and the next state. If the potential energy value of the next state is higher than the potential energy value of the current state, it means that this transfer may be beneficial to the intelligent agent, and a positive intrinsic reward is given; if the potential energy value of the next state is lower than the potential energy value of the current state, a negative intrinsic reward is given;

[0074] The intrinsic rewards are:

[0075]

[0076] Where F(·) is the reward shaping function, γ is the decay factor, and Respectively represent the TD error of the current state corresponding to the new and old strategies, and They represent the advantage functions of the current state corresponding to the new and old strategies, respectively, and are used to measure the additional benefit of the agent taking a specific action relative to the average reward obtained by random actions in a given state;

[0077] The final reward signal is:

[0078]

[0079] Among them, R t is the final reward signal obtained, For intrinsic rewards, To simulate external rewards.

[0080] In order to further implement the above technical solution, in step S5, the specific content of updating the potential energy function network model using the loss function is:

[0081] The loss function is calculated using mean square error, and the gradient of the loss function to the network parameters is calculated using the back propagation algorithm, and the network parameters are updated using gradient descent;

[0082] The loss function is:

[0083]

[0084] Among them, θ is the parameter of the potential energy function network, and J(θ) is the loss function;

[0085] The strategy for adjusting the agent's actions is as follows:

[0086] The ratio of new and old strategies is trimmed to limit the magnitude of strategy changes and ensure convergence;

[0087] The specific objective function is:

[0088]

[0089] Among them, ω is the policy network parameter adopted by the agent, E is the expected value operation, c t (ω) is the ratio of the probability of the new and old strategies, clip(·) is the truncation function, ∈ is the truncation hyperparameter, and L(ω) is the strategy π ω The objective function of

[0090] The calculation method that maximizes the cumulative reward of the agent in its interaction with the environment is as follows:

[0091]

[0092] Among them, π ω is the strategy adopted by the agent, H(π ω ) is the strategy π ω The expected value of the long-term reward obtained by the agent.

[0093] A reward shaping device for sparse continuous control tasks, based on a reward shaping method for sparse continuous control tasks, includes an experience data acquisition module, a potential value acquisition module, an intrinsic reward shaping module, a final reward acquisition module and a maximum cumulative reward acquisition module;

[0094] The experience data acquisition module is used to collect the experience data generated by the interaction between the intelligent agent and the simulation environment. The experience data includes the actions performed by the intelligent agent, the current state information and the next state information of the simulation environment, and the simulation external reward signal;

[0095] A potential energy value acquisition module is used to obtain the potential energy values ​​corresponding to the simulation environment of the agent in the current state and the next state by using a potential energy function network model constructed by a fully connected neural network;

[0096] The intrinsic reward shaping module is used to calculate the intrinsic reward signal through the reward shaping function according to the potential energy value corresponding to the simulation environment of the agent in the current state and the next state;

[0097] The final reward acquisition module is used to combine the intrinsic reward signal and the simulated external reward signal to obtain the final reward signal;

[0098] The maximum cumulative reward acquisition module is used to update the potential function network model using the loss function, adjust the strategy of the agent to perform actions, and enable the agent to obtain the maximum cumulative reward in the interaction with the environment.

[0099] In order to further implement the above technical solution, a reward shaping device for sparse continuous control tasks also includes an initialization module for constructing a sparse continuous control task simulation environment and an intelligent agent, defining the state space that the intelligent agent can reach and the action space that can be taken, and using a deep reinforcement learning algorithm to simulate the action execution strategy of the intelligent agent.

[0100] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a reward shaping method for sparse continuous control tasks.

[0101] A processing terminal includes a memory and a processor. The memory stores a computer program that can be run on the processor. When the processor executes the computer program, a reward shaping method for sparse continuous control tasks is implemented.

[0102] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0103] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A reward shaping method for sparse continuous control tasks, characterized in that: The following steps are involved: S1. Interaction between the simulation environment and the agent for sparse continuous control tasks; S2. Collecting experience data generated by the interaction between the agent and the simulation environment, the experience data includes the actions performed by the agent, the current state information and the next state information of the simulation environment, and the simulation external reward signal; S3. Use a fully connected neural network to build a potential energy function network model to obtain the potential energy value corresponding to the simulation environment of the agent in the current state and the next state; S4. according to the potential energy value corresponding to the simulation environment of the agent in the current state and the next state, the intrinsic reward signal is calculated by the reward shaping function, and the intrinsic reward signal and the simulated external reward signal are combined to obtain the final reward signal; S4. Use the loss function to update the potential function network model and adjust the strategy of the agent to perform actions so that the agent can obtain the maximum cumulative reward in the interaction with the environment.

2. A reward shaping method for sparse continuous control tasks according to claim 1, characterized in that: Before step S1, the method further includes: Construct a sparse continuous control task simulation environment and agent, define the state space S that the agent can reach and the action space A that can be taken, and use a deep reinforcement learning algorithm to simulate the action execution strategy π of the agent ω .

3. A reward shaping method for sparse continuous control tasks according to claim 1, characterized in that: In step S1, the specific content of the interaction between the sparse continuous control task simulation environment and the agent is: The agent obtains the current state information of the simulation environment and takes corresponding execution actions through the action execution strategy; When the simulation environment changes, the next state information of the simulation environment and the simulation external reward signal are fed back to the agent; The state information of the current state information of the simulation environment, the execution action taken, the next state information of the simulation environment, and the simulation external reward signal are stored in the experience pool.

4. A reward shaping method for sparse continuous control tasks according to claim 1, characterized in that: The potential energy function network model constructed by using the fully connected neural network in step S3 is specifically: in, is the potential energy value of the agent in the current state simulation environment, θ is the network parameter, are the value functions corresponding to the new and old execution action strategies in the current state simulation environment, is the prediction of future rewards, and α is the proportion of the value function.

5. A reward shaping method for sparse continuous control tasks according to claim 4, characterized in that: In step S4, the method of calculating the intrinsic reward signal through the reward shaping function is: the intrinsic reward is calculated according to the difference between the potential energy values ​​of the current state and the next state. If the potential energy value of the next state is higher than the potential energy value of the current state, it means that this transfer may be beneficial to the agent, and a positive intrinsic reward is given; if the potential energy value of the next state is lower than the potential energy value of the current state, a negative intrinsic reward is given; The intrinsic rewards are: Where F(·) is the reward shaping function, γ is the decay factor, and Respectively represent the TD error of the current state corresponding to the new and old strategies, and They represent the advantage functions of the current state corresponding to the new and old strategies, respectively, and are used to measure the additional benefit of the agent taking a specific action relative to the average reward obtained by random actions in a given state; The final reward signal is: Among them, R t is the final reward signal obtained, For intrinsic rewards, To simulate external rewards.

6. A reward shaping method for sparse continuous control tasks according to claim 5, characterized in that: In step S5, the specific content of updating the potential energy function network model using the loss function is: The loss function is calculated using mean square error, and the gradient of the loss function to the network parameters is calculated using the back propagation algorithm, and the network parameters are updated using gradient descent; The loss function is: Among them, θ is the parameter of the potential energy function network, and J(θ) is the loss function; The strategy for adjusting the agent's actions is as follows: The ratio of new and old strategies is trimmed to limit the magnitude of strategy changes and ensure convergence; The specific objective function is: Among them, ω is the policy network parameter adopted by the agent, E is the expected value operation, c t (ω) is the ratio of the probability of the new and old strategies, clip(·) is the truncation function, ∈ is the truncation hyperparameter, and L(ω) is the strategy π ω The objective function of The calculation method that maximizes the cumulative reward of the agent in its interaction with the environment is as follows: Among them, π ω is the strategy adopted by the agent, H(π ω ) is the strategy π ω The expected value of the long-term reward obtained by the agent.

7. A reward shaping device for sparse continuous control tasks, characterized in that: A reward shaping method for sparse continuous control tasks based on any one of claims 1 to 6, comprising an experience data acquisition module, a potential energy value acquisition module, an intrinsic reward shaping module, a final reward acquisition module and a maximum cumulative reward acquisition module; The experience data acquisition module is used to collect the experience data generated by the interaction between the intelligent agent and the simulation environment. The experience data includes the actions performed by the intelligent agent, the current state information and the next state information of the simulation environment, and the simulation external reward signal; A potential energy value acquisition module is used to obtain the potential energy values ​​corresponding to the simulation environment of the agent in the current state and the next state by using a potential energy function network model constructed by a fully connected neural network; The intrinsic reward shaping module is used to calculate the intrinsic reward signal through the reward shaping function according to the potential energy value corresponding to the simulation environment of the agent in the current state and the next state; The final reward acquisition module is used to combine the intrinsic reward signal and the simulated external reward signal to obtain the final reward signal; The maximum cumulative reward acquisition module is used to update the potential function network model using the loss function, adjust the strategy of the agent to perform actions, and enable the agent to obtain the maximum cumulative reward in the interaction with the environment.

8. The reward shaping device for sparse continuous control tasks according to claim 7, characterized in that: It also includes an initialization module for building a sparse continuous control task simulation environment and agent, defining the state space that the agent can reach and the action space that can be taken, and using a deep reinforcement learning algorithm to simulate the action execution strategy of the agent.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a reward shaping method for sparse continuous control tasks as described in any one of claims 1-6.

10. A processing terminal, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, it implements a reward shaping method for sparse continuous control tasks as described in any one of claims 1-6.

Citation Information

Cited By

  • Intelligent factory multi-device cooperative control method based on mutual information driven sparse reward

    CN120652939A

  • Mobile robot navigation control method and system based on reinforcement learning and storage medium

    CN121277190A

  • Reinforcement learning-based mobile robot navigation control method and system, and storage medium

    CN121277190B