Multi-agent value function decomposition method and device based on attention mechanism

By introducing the attention mechanism and the off-track policy learning algorithm DDPG in a multi-agent environment, combined with a variety of agent networks, the problem of poor performance of existing technologies in complex cooperation scenarios is solved, and it is realized under continuous action control. Efficient multi-agent value function decomposition improves policy evaluation performance.

CN112101564BActive Publication Date: 2024-09-06TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010824845.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-17
Publication Date
2024-09-06
Estimated Expiration
2040-08-17

AI Technical Summary

Technical Problem

Existing multi-agent value function learning algorithms have poor performance in complex cooperation scenarios, especially in continuous action control environments. It is difficult to effectively combine the Q value between multi-agent and the Q value of a single agent, and the existing algorithm For example, QMIX is only suitable for discrete action control.

Method used

A multi-agent value function decomposition method based on the attention mechanism under continuous action control is proposed. By constructing the Attention mechanism network and multiple agent networks, combined with the off-track policy learning algorithm DDPG, a continuous learning method is designed in the simulation environment. Value function decomposition algorithm for action control, updating policy model to adapt to multi-agent environment.

Benefits of technology

It significantly improves the performance of multi-agent learning in complex cooperation scenarios. It can effectively combine the Q value between multi-agents and the Q value of a single agent. It is suitable for continuous action control environments and improves the strategy evaluation score.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112101564B
    Figure CN112101564B
Patent Text Reader

Abstract

The present invention discloses a multi-agent value function decomposition method and device based on an attention mechanism under continuous action control, the method comprising: obtaining state trajectories under the decision of multiple agents; constructing an attention mechanism network, a main value network of each agent, a main strategy network of each agent, a QMIX main value network, a sub-value network of each agent, a sub-strategy network of each agent, and a QMIX sub-value network; based on the multi-agent value function decomposition learning process of the state trajectory and the off-track strategy algorithm, the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the sub-value network of each agent, the sub-strategy network of each agent, and the QMIX sub-value network are updated; an updated strategy model is generated according to the updated multiple networks, and the strategy model is tested. The method designs a multi-agent algorithm for learning value function decomposition based on an attention mechanism in a simulation environment of a continuous control quantity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a multi-agent value function decomposition method and device based on an attention mechanism under continuous action control. Background Art

[0002] In recent years, reinforcement learning has made significant breakthroughs in many fields, such as large-scale strategy optimization problems such as Go, StarCraft, and Dota2. Unlike most of the currently popular single-agent reinforcement learning algorithms, the real world often involves multiple agents competing or cooperating with each other in a dynamically changing environment. Therefore, agents need to learn to interact with other agents in the environment while adapting to the multi-agent environment. In multi-agent control algorithms, the value function design plays a very critical role. Since the value function is the sum of the rewards of a sample track, an effective value function design can accelerate multi-agent learning.

[0003] At present, there are three main types of multi-agent algorithms based on value functions: independent value functions, central value functions, and decomposed value functions. Among them, the independent value function learning algorithm trains multiple agents separately and maximizes their own value functions. It is the simplest value function learning algorithm. However, since the environment of a single agent is dynamically non-stationary, this method violates the basic assumptions of reinforcement learning. In comparison, the central value function takes into account the actions of other agents when calculating the state-action value function of a single agent, and surpasses the performance of other traditional multi-agent algorithms in continuous action control scenarios. This algorithm has stronger robustness. However, since the multi-agent cooperation environment is a multi-person game scenario, the design of the central value function ignores the properties of a single value function, and its performance is poor in complex cooperation scenarios.

[0004] Decomposing the central value functions of multiple agents is the mainstream algorithm for multi-agent value function learning. The representative algorithm is the QMIX algorithm, which fuses the value functions of each agent based on global state information and ensures that the overall value function is monotonic relative to the value function of a single agent. This algorithm has achieved outstanding results in complex discrete motion control scenarios. In the real world, multiple agents influence each other. In cooperative scenarios, the Q value between multiple agents should be monotonic relative to the overall value function. However, the QMIX algorithm only considers the monotonicity of the overall value function relative to the value function of a single agent, ignoring the Q value information between multiple agents, and lacks some exploration and cooperation. At the same time, the QMIX algorithm is only applicable to discrete motion control environments, while most multi-agent environments in reality are continuous motion control. Therefore, how to effectively combine the Q value between multiple agents with the Q value of a single agent and apply it in a multi-agent environment under continuous motion control is challenging. Summary of the invention

[0005] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0006] To this end, one purpose of the present invention is to propose a multi-agent value function decomposition method based on attention mechanism under continuous motion control. This method designs a value function decomposition algorithm for learning continuous motion control in a simulation environment using state trajectories under continuous control quantities of multi-agents.

[0007] Another object of the present invention is to propose a multi-agent value function decomposition device based on attention mechanism under continuous action control.

[0008] To achieve the above-mentioned purpose, an embodiment of the present invention proposes a multi-agent value function decomposition method based on an attention mechanism under continuous action control, comprising the following steps: Step S1: Obtain the state trajectory under the decision of multiple agents; Step S2: Construct an Attention mechanism network, a main value network of each agent, a main strategy network of each agent, a QMIX main value network, a secondary value network of each agent, a secondary strategy network of each agent, and a QMIX secondary value network; Step S3: Based on the multi-agent value function decomposition learning process of the state trajectory and the off-track strategy algorithm, the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the secondary value network of each agent, the secondary strategy network of each agent, and the QMIX secondary value network are updated; Step S4: Generate an updated strategy model based on the updated multiple networks, and test the strategy model.

[0009] The multi-agent value function decomposition method based on the attention mechanism under continuous motion control of an embodiment of the present invention studies the multi-agent value function decomposition method based on the attention mechanism based on the actual needs of industrial applications and algorithm research, and combines the off-track strategy learning algorithm DDPG to design a value function decomposition algorithm that uses the state trajectory under the continuous control quantity of the multi-agent to learn continuous motion control in a simulation environment.

[0010] In addition, the multi-agent value function decomposition method based on the attention mechanism under continuous action control according to the above embodiment of the present invention may also have the following additional technical features:

[0011] Furthermore, in one embodiment of the present invention, the step S1 includes: designing a partial observation simulator according to an application scenario, and obtaining an observation state of the application scenario at the next moment by interacting with the application scenario through the simulator.

[0012] Furthermore, in one embodiment of the present invention, step S3 includes:

[0013] Step S31, initializing the simulation environment env and the Attention mechanism network Attention ψ , the principal value network Q of each intelligent agent i , the main strategy network π of each intelligent agent i , the QMIX main value network QMIX, the each agent sub-value network Q′ i , the sub-strategy network π′ of each intelligent agent i , the QMIX secondary value network QMIX′;

[0014] Step S32, in the current state Select actions based on strategy and transfer to the next state And get the current reward value r t , according to the current state o t 、Current action a t , the current reward value r t and the next state o t+1 Composed of four groups (o t ,a t ,r t ,o t+1 ), and stores the quaternary group into the generated data buffer B π ;

[0015] Step S33, in the generating data buffer B π After the amount of data in reaches the preset data amount threshold, part of the data is taken out at each time step to update the Attention mechanism network, the principal value networks of each agent, and the QMIX principal value network;

[0016] Step S34, updating the main strategy network of each agent using the deterministic policy gradient at a preset time interval, and updating the secondary value network Q′ of each agent i , the sub-strategy network π′ of each intelligent agent i , the parameters of the QMIX sub-value network QMIX′ are soft updated.

[0017] Furthermore, in one embodiment of the present invention, step S33 includes:

[0018] S331, based on the strategy network π′ of each agent i And random perturbations select the action at the next moment:

[0019]

[0020] in, is the sub-strategy network of agent i, represents the introduced random disturbance;

[0021] S332, calculate the state-action value of each intelligent agent

[0022]

[0023] in, is the state-action value of agent i; is the principal value network Q of agent i i The two-layer fully connected network in is the principal value network Q of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i.

[0024] S333, calculate the target state-action value of each intelligent agent

[0025]

[0026] in, is the target state-action value of agent i; is the target principal value network Q′ of agent i i The two-layer fully connected network in is the target principal value network Q′ of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i.

[0027] S334, using QMIX principal value network to calculate mixed state-action value

[0028]

[0029] in, It is a two-layer fully connected network of the QMIX principal value network, and the absolute value of the weight of the network is taken, and s is the global observation of all intelligent agents.

[0030] S335, using QMIX sub-value network to calculate the target mixed state-action value

[0031]

[0032] in, It is a two-layer fully connected network of the QMIX sub-value network, and the absolute value of the weight of the network is taken, and s′ is the global observation of all agents at the next moment;

[0033] S336, using the gradient descent method to update the parameters θ of the principal value network of each agent i , QMIX main value network parameters Attention mechanism network parameters ψ:

[0034]

[0035]

[0036]

[0037] in, is a mixed state-action value, is the target mixed state-action value, N is the value from B π The number of samples collected.

[0038] Furthermore, in one embodiment of the present invention, in step S34, the updating method of the main strategy network of each agent is:

[0039]

[0040] Among them, k is the sample number used to calculate the gradient, is the action a selected by agent i i Find the gradient, is the value function of agent i, a i is the action chosen by agent i, a -i is the action chosen by other agents except agent i, is the derivative of the policy network of agent i, φ i is the policy network of agent i, o i is the observation of agent i.

[0041] Furthermore, in one embodiment of the present invention, the sub-value network Q′ of each agent i , the sub-strategy network π′ of each intelligent agent i , the updating method of the parameters of the QMIX secondary value network QMIX′ is:

[0042] φ′ ′ ←τφ i +(1-τ)φ′ i ,

[0043] θ′ i ←τθ i +(1-τ)θ′ i ,

[0044]

[0045] Among them, τ is a hyperparameter used to control the degree to which the secondary network parameters are updated from the primary network.

[0046] Furthermore, in one embodiment of the present invention, the step S332 further includes:

[0047]

[0048] in, is the input embedding vector, V is the linear transformation matrix, W q is the query matrix, W k is the key matrix, these three matrices are shared by all agents, and h is the nonlinear transfer function.

[0049] Furthermore, in one embodiment of the present invention, the method further includes: storing the state trajectory in a data buffer.

[0050] To achieve the above-mentioned purpose, on the other hand, an embodiment of the present invention proposes a multi-agent value function decomposition device based on an attention mechanism under continuous action control, including: an acquisition module, used to obtain the state trajectory under the decision of multiple agents; a construction module, used to construct an Attention mechanism network, a main value network of each agent, a main strategy network of each agent, a QMIX main value network, a secondary value network of each agent, a secondary strategy network of each agent, and a QMIX secondary value network; an update module, used to update the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the secondary value network of each agent, the secondary strategy network of each agent, and the QMIX secondary value network based on the multi-agent value function decomposition learning process of the state trajectory and the off-track strategy algorithm; a generation module, used to generate an updated strategy model according to the updated multiple networks, and test the strategy model.

[0051] The multi-agent value function decomposition device based on the attention mechanism under continuous motion control of an embodiment of the present invention studies the multi-agent value function decomposition method based on the attention mechanism based on the actual needs of industrial application and algorithm research, and combines the off-track strategy learning algorithm DDPG to design a value function decomposition algorithm that uses the state trajectory under the continuous control quantity of the multi-agent to learn continuous motion control in a simulation environment.

[0052] In addition, the multi-agent value function decomposition device based on the attention mechanism under the continuous action control according to the above embodiment of the present invention may also have the following additional technical features:

[0053] Furthermore, in one embodiment of the present invention, the acquisition module is further used to store the state trajectory into a data buffer.

[0054] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0056] Figure 1 It is a flow chart of a multi-agent value function decomposition method based on an attention mechanism under continuous action control according to an embodiment of the present invention;

[0057] Figure 2 It is a flowchart of a multi-agent value function decomposition method based on an attention mechanism under continuous action control according to an embodiment of the present invention;

[0058] Figure 3 A specific scene diagram of an environment according to an embodiment of the present invention;

[0059] Figure 4 An image of the training process according to an embodiment of the present invention;

[0060] Figure 5 Schematic diagram of the structure of a multi-agent value function decomposition device based on an attention mechanism under continuous action control according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0062] The following describes the multi-agent value function decomposition method and device based on the attention mechanism under continuous motion control proposed in an embodiment of the present invention with reference to the accompanying drawings. First, the multi-agent value function decomposition method based on the attention mechanism under continuous motion control proposed in an embodiment of the present invention will be described with reference to the accompanying drawings.

[0063] Figure 1 It is a flowchart of a multi-agent value function decomposition method based on an attention mechanism under continuous action control according to an embodiment of the present invention.

[0064] like Figure 1 As shown, the multi-agent value function decomposition method based on the attention mechanism under continuous action control includes the following steps:

[0065] Step S1: Obtain state trajectories under multiple agent decisions.

[0066] Specifically, Figure 2 As shown in the figure, the state trajectories under the decision-making of multiple agents are obtained and stored in the corresponding data buffer. A partial observation simulator is designed according to the application scenario, and the data required for training is obtained through the interaction between the simulator and the application scenario. The input of the simulator is the action of each agent at the current moment The output returns the observed state of the environment at the next moment

[0067] Step S2: Construct the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the sub-value network of each agent, the sub-strategy network of each agent, and the QMIX sub-value network.

[0068] Specifically, Figure 2 As shown, the construction parameter is θ i The principal value network Q of each agent i , the parameter is φ i The main strategy network π of each agent i , the parameters are The QMIX principal value network with parameter ψ and the Attention mechanism network with parameter θ′ i The sub-value network Q′ of each agent i , parameter is φ′ i The sub-strategy network π′ of each agent i , the parameters are QMIX vice value network.

[0069] Step S3: Based on the multi-agent value function decomposition learning process of the state trajectory and off-track strategy algorithm, the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the sub-value network of each agent, the sub-strategy network of each agent, and the QMIX sub-value network are updated.

[0070] It is understandable that if Figure 2 As shown in Figure 1, the multi-agent value function decomposition process based on the state trajectory and off-track strategy algorithm. Each agent uses the main strategy network π i Interact with the simulation environment and convert the quaternion (o t ,a t ,r t ,o t+1 ) is stored in buffer B πThrough the value function decomposition process, the parameters of the actor, critic network, QMIX hybrid network and Attention mechanism network of each agent in step S2 are continuously updated. When the training process converges, the QMIX hybrid network and Attention mechanism network can well decompose the overall value function of the multi-agent while making full use of the value function information of the agent itself and the value function information between agents.

[0071] The specific steps of the value function decomposition process are:

[0072] S31, initialize the simulation environment env, Attention mechanism network Attention ψ , each agent's principal value network Q i 、The main strategy network π of each agent i , QMIX main value network QMIX, each agent sub-value network Q′ i , each agent's sub-strategy network π′ i , QMIX sub-value network QMIX′;

[0073] S32, in the current state Select actions based on strategy and transfer to the next state And get the current reward value r t , according to the current state o t 、Current action a t , the current reward value r t and the next state o t+1 Composed of four groups (o t ,a t ,r t ,o t+1 ), and stores the quaternary group into the generated data buffer B π ;

[0074] S33, generating data buffer B π When the amount of data in reaches the preset data volume threshold buffer_size, part of the data is taken out at each time step to update the Attention mechanism network, each agent main value network, and QMIX main value network;

[0075] The principal value network Q of each agent i , QMIX hybrid network, the process of parameter update of Attention mechanism network is as follows:

[0076] S331, based on the strategy network π′ of each agent i And random perturbations select the action at the next moment:

[0077]

[0078] in, is the main strategy network of agent i, represents the introduced random disturbance;

[0079] S332, calculate the state-action value of each intelligent agent

[0080]

[0081] in, is the state-action value of agent i; is the principal value network Q of agent i i The two-layer fully connected network in is the principal value network Q of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i.

[0082] S333, calculate the target state-action value of each intelligent agent

[0083] First, calculate the weighted sum of the value functions of other agents except agent i:

[0084]

[0085] in, is the input embedding vector, V is the linear transformation matrix, W q is the query matrix, W k is the key matrix, these three matrices are shared by all agents, and h is the nonlinear transfer function.

[0086]

[0087] in, is the target state-action value of agent i; is the target principal value network Q′ of agent i i The two-layer fully connected network in is the target principal value network Q′ of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i.

[0088] S334, using QMIX principal value network to calculate mixed state-action value

[0089]

[0090] in, It is a two-layer fully connected network of the QMIX principal value network, and the absolute value of the weight of the network is taken, and s is the global observation of all intelligent agents.

[0091] S335, using QMIX sub-value network to calculate the target mixed state-action value

[0092]

[0093] in, It is a two-layer fully connected network of the QMIX sub-value network, and the absolute value of the weight of the network is taken. s′ is the global observation of all agents at the next moment.

[0094] S336, using the gradient descent method to update the parameters θ of the principal value network of each agent i , QMIX main value network parameters Attention mechanism network parameters ψ:

[0095]

[0096]

[0097]

[0098] in, is a mixed state-action value, is the target mixed state-action value, N is the value from B π The number of samples collected.

[0099] S34, every preset time T, the main strategy network of each agent is updated using the deterministic policy gradient, and the secondary value network Q′ of each agent is updated i , each agent's sub-strategy network π′ i , and soft update the parameters of the QMIX sub-value network QMIX′.

[0100] Updates to the main strategy network of each agent include:

[0101]

[0102] Among them, k is the sample number used to calculate the gradient, is the action a selected by agent i i Find the gradient, is the value function of agent i, a i is the action chosen by agent i, a -i is the action chosen by other agents except agent i, is the derivative of the policy network of agent i, φ i is the policy network of agent i, o i is the observation of agent i;

[0103] For each agent's secondary value network Q' i , each agent's sub-strategy network π′ i , the parameters of the QMIX secondary value network QMIX′ are soft updated:

[0104] φ′ i ←τφ i +(1-τ)φ′ i

[0105] θ′ i ←τθ i +(1-τ)θ′ i

[0106]

[0107] Among them, τ is a hyperparameter used to control the degree to which the secondary network parameters are updated from the primary network.

[0108] Step S4: Generate an updated policy model according to the updated multiple networks, and test the policy model.

[0109] Specifically, Figure 2 As shown, when the number of interactions with the environment reaches a preset number, the training process is terminated to generate an updated policy model. The preset number can be set according to actual conditions and is not specifically limited here, such as 2M times, where M is a positive integer.

[0110] The multi-agent value function decomposition learning method based on the state trajectory and off-track strategy algorithm of the invention is described in detail below through specific embodiments.

[0111] For a high-dimensional continuous control task, the purpose of the task is to control three agents to capture a random walking agent. The agent controlled by the algorithm is slow, and the random walking agent is fast. There are also two immovable obstacles in the environment. Figure 3is the specific scenario of the environment. For the agent to be controlled in this simulation environment, the input is a 16-dimensional state quantity, and the output action is a continuous 5-dimensional variable. In the proposed multi-agent value function decomposition algorithm based on state trajectory and off-track strategy algorithm, the strategy network of each agent contains three hidden layers, with 64, 64, 64 nodes, and the activation function is relu; the embedding layer of the value network of each agent contains one hidden layer, with 64 nodes, and the activation function is relu; the QMIX hybrid network contains two hidden layers, with 32, 32 nodes, and the activation function is relu; the Query, Key, and Value layers in the Attention mechanism network each contain one hidden layer, with 64 nodes, and the activation function is relu. The parameters of the above networks are optimized by the Adam optimizer.

[0112] Other hyperparameters used in the value function decomposition process are shown in the following table:

[0113]

[0114] In the Simple_tag environment, the centralized value function strategy MADDPG strategy evaluation score is 700, while the multi-agent value function decomposition algorithm strategy evaluation score based on the attention mechanism is 1200. The image drawn is as follows Figure 4 As shown. Figure 4 It can be seen that the performance of the multi-agent value function decomposition algorithm based on the attention mechanism has been greatly improved after 2000 episodes, and the strategy evaluation score quickly reaches more than 1100 points.

[0115] According to the multi-agent value function decomposition method based on the attention mechanism proposed in an embodiment of the present invention, by starting from the actual needs of industrial applications and algorithm research, the value function decomposition process based on state trajectory is studied, and combined with the off-track policy learning algorithm DDPG, a multi-agent value function decomposition algorithm based on the attention mechanism under continuous action control is designed.

[0116] Secondly, the multi-agent value function decomposition device based on attention mechanism under continuous action control proposed in an embodiment of the present invention is described with reference to the accompanying drawings.

[0117] Figure 5 Schematic diagram of the structure of a multi-agent value function decomposition device based on an attention mechanism under continuous action control according to an embodiment of the present invention.

[0118] like Figure 5 As shown, the multi-agent value function decomposition device 10 based on the attention mechanism under continuous action control includes: an acquisition module 100, a construction module 200, an update module 300 and a generation module 400.

[0119] The acquisition module 100 acquires state trajectories under the decisions of multiple agents and stores the state trajectories in an expert data buffer.

[0120] Construction module 200 is used to construct the Attention mechanism network, the main value network of each intelligent agent, the main strategy network of each intelligent agent, the QMIX main value network, the secondary value network of each intelligent agent, the secondary strategy network of each intelligent agent, and the QMIX secondary value network.

[0121] The update module 300 is used to update the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the sub-value network of each agent, the sub-strategy network of each agent, and the QMIX sub-value network in the multi-agent value function decomposition learning process based on the state trajectory and off-track strategy algorithm.

[0122] The generating module 400 is used to generate an updated policy model according to the updated multiple networks and test the policy model.

[0123] It should be noted that the aforementioned explanation of the embodiment of the multi-agent value function decomposition method based on the attention mechanism is also applicable to the multi-agent value function decomposition device based on the attention mechanism of this embodiment, and will not be repeated here.

[0124] According to the multi-agent value function decomposition device based on the attention mechanism proposed in an embodiment of the present invention, based on the actual needs of industrial applications and algorithm research, the value function decomposition process based on state trajectory is studied, and combined with the off-track strategy learning algorithm DDPG, a multi-agent value function decomposition algorithm based on the attention mechanism under continuous action control is designed.

[0125] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0126] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0127] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A multi-agent value function decomposition method based on attention mechanism under continuous action control, characterized in that: The following steps are involved: Step S1: Obtain state trajectories under the decisions of multiple agents; Step S2: Construct the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the secondary value network of each agent, the secondary strategy network of each agent, and the QMIX secondary value network; Step S3: Based on the multi-agent value function decomposition learning process of the state trajectory and off-track strategy algorithm, the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the secondary value network of each agent, the secondary strategy network of each agent, and the QMIX secondary value network are updated; as well as Step S4: generating an updated policy model according to the updated multiple networks, and testing the policy model; Wherein, the step S3 comprises: Step S31, initializing the simulation environment env, the Attention mechanism network Attention ψ , the principal value network Q of each intelligent agent i , the main strategy network π of each intelligent agent i , the QMIX main value network QMIX, the each agent sub-value network Q′ i , the sub-strategy network π′ of each intelligent agent i , the QMIX secondary value network QMIX′; Step S32, in the current state Select actions based on strategy and transfer to the next state And get the current reward value r t , according to the current state o t 、Current action a t , the current reward value r t and the next state o t+1 Composed of four groups (o t ,a t ,r t ,o t+1 ), and stores the quaternary group into the generated data buffer B π ; Step S33, in the generating data buffer B π After the amount of data in reaches the preset data amount threshold, part of the data is taken out at each time step to update the Attention mechanism network, the principal value networks of each agent, and the QMIX principal value network; Step S34, updating the main strategy network of each agent using the deterministic policy gradient at a preset time interval, and updating the secondary value network Q′ of each agent i , the sub-strategy network π of each intelligent agent i ', the parameters of the QMIX secondary value network QMIX' are soft updated; The step S33 comprises: S331, based on the strategy network π′ of each agent i And random perturbations select the action at the next moment: in, is the sub-strategy network of agent i, represents the introduced random disturbance; S332, calculate the state-action value of each intelligent agent in, is the state-action value of agent i; is the principal value network Q of agent i i The two-layer fully connected network in is the principal value network Q of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i; S333, calculate the target state-action value of each intelligent agent in, is the target state-action value of agent i; is the target principal value network Q of agent i i ′ in the two-layer fully connected network; is the target principal value network Q of agent i i ′ in the encoding network; is the weighted sum of the value functions of other agents except agent i; S334, using QMIX principal value network to calculate mixed state-action value in, is a two-layer fully connected network of the QMIX principal value network, and the absolute value of the weight of the network is taken, and s is the global observation of all agents; S335, using QMIX sub-value network to calculate the target mixed state-action value in, It is a two-layer fully connected network of the QMIX sub-value network, and the absolute value of the weight of the network is taken, and s′ is the global observation of all agents at the next moment; S336, using the gradient descent method to update the parameters θ of the principal value network of each agent i , QMIX main value network parameters Attention mechanism network parameters ψ: in, is the mixed state-action value, is the target mixed state-action value, N is the value from B π The number of samples collected in In step S34, the updating method of each agent main strategy network is: Among them, k is the sample number used to calculate the gradient, is the action a selected by agent i i Find the gradient, is the value function of agent i, a i is the action chosen by agent i, a -i is the action chosen by other agents except agent i, is the derivative of the policy network of agent i, φ i is the policy network of agent i, o i is the observation of agent i; The sub-value network Q′ for each agent i , the sub-strategy network π′ of each intelligent agent i , the updating method of the parameters of the QMIX secondary value network QMIX′ is: f′ i ←tf i +(1-τ)φ′ i , θ′ i ←tth i +(1-τ)θ′ i , Among them, τ is a hyperparameter used to control the degree to which the secondary network parameters are updated from the main network; The step S332 further includes: in, is the input embedding vector, V is the linear transformation matrix, W1 is the query matrix, W k is the key matrix, these three matrices are shared by all agents, and h is the nonlinear transfer function.

2. The method according to claim 1, characterized in that The step S1 comprises: A partial observation simulator is designed according to the application scenario, and the observation state of the application scenario at the next moment is obtained by interacting with the application scenario through the simulator.

3. The multi-agent value function decomposition method based on the attention mechanism according to any one of claims 1-2, characterized in that: Also includes: The state trace is stored in a data buffer.

4. A multi-agent value function decomposition device based on attention mechanism under continuous action control, characterized in that: include: The acquisition module is used to obtain the state trajectories under the decision-making of multiple agents; Construction module, used to build the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the secondary value network of each agent, the secondary strategy network of each agent, and the QMIX secondary value network; An update module is used for updating the Attention mechanism network, the main value network of each agent, the main strategy network of each agent, the QMIX main value network, the secondary value network of each agent, the secondary strategy network of each agent, and the QMIX secondary value network based on the multi-agent value function decomposition learning process of the state trajectory and off-track strategy algorithm; as well as A generation module, used for generating an updated policy model according to the updated multiple networks, and testing the policy model; Wherein, the update module is specifically used for: Step S31, initializing the simulation environment env, the Attention mechanism network Attention ψ , the principal value network Q of each intelligent agent i , the main strategy network π of each intelligent agent i , the QMIX main value network QMIX, the each agent sub-value network Q′ i , the sub-strategy network π′ of each intelligent agent i , the QMIX secondary value network QMIX′; Step S32, in the current state Select actions based on strategy and transfer to the next state And get the current reward value r t , according to the current state o t 、Current action a t , the current reward value r t and the next state o t+1 Composed of four groups (o t ,a t ,r t ,o t+1 ), and stores the quaternary group into the generated data buffer B π ; Step S33, in the generating data buffer B π After the amount of data in reaches the preset data amount threshold, part of the data is taken out at each time step to update the Attention mechanism network, the principal value networks of each agent, and the QMIX principal value network; Step S34, updating the main strategy network of each agent using the deterministic policy gradient at a preset time interval, and updating the secondary value network Q′ of each agent i , the sub-strategy network π′ of each intelligent agent i , soft updating of parameters of the QMIX secondary value network QMIX′; The step S33 comprises: S331, based on the strategy network π′ of each agent i And random perturbations select the action at the next moment: in, is the sub-strategy network of agent i, represents the introduced random disturbance; S332, calculate the state-action value of each intelligent agent in, is the state-action value of agent i; is the principal value network Q of agent i i The two-layer fully connected network in is the principal value network Q of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i; S333, calculate the target state-action value of each intelligent agent in, is the target state-action value of agent i; is the target principal value network Q′ of agent i i The two-layer fully connected network in is the target principal value network Q′ of agent i i The encoding network in ; is the weighted sum of the value functions of other agents except agent i; S334, using QMIX principal value network to calculate mixed state-action value in, is a two-layer fully connected network of the QMIX principal value network, and the absolute value of the weight of the network is taken, and s is the global observation of all agents; S335, using QMIX sub-value network to calculate the target mixed state-action value in, It is a two-layer fully connected network of the QMIX sub-value network, and the absolute value of the weight of the network is taken, and s′ is the global observation of all agents at the next moment; S336, using the gradient descent method to update the parameters θ of the principal value network of each agent i , QMIX main value network parameters Attention mechanism network parameters ψ: in, is the mixed state-action value, is the target mixed state-action value, N is the value from B π The number of samples collected in In step S34, the updating method of each agent main strategy network is: Among them, k is the sample number used to calculate the gradient, is the action a selected by agent i i Find the gradient, is the value function of agent i, a i is the action chosen by agent i, a -i is the action chosen by other agents except agent i, is the derivative of the policy network of agent i, φ i is the policy network of agent i, o i is the observation of agent i; The sub-value network Q′ for each agent i , the sub-strategy network π′ of each intelligent agent i , the updating method of the parameters of the QMIX secondary value network QMIX′ is: f′ i ←Tφ i +(1-τ)φ′ i , θ′ i ←tth i +(1-r)θ′ i , Among them, τ is a hyperparameter used to control the degree to which the secondary network parameters are updated from the main network; The step S332 further includes: in, is the input embedding vector, V is the linear transformation matrix, W q is the query matrix, W k is the key matrix, these three matrices are shared by all agents, and h is the nonlinear transfer function.

5. The multi-agent value function decomposition device based on the attention mechanism according to claim 4 is characterized in that: The acquisition module is further used to store the state trajectory into a data buffer.