Near-end strategy optimization method based on hard attention enhancement, terminal and storage medium

Through the method of hard attention module and alternating iterative training, the problem of explosion of state dimensions and limited observation of multi-agent systems is solved, the learning efficiency and strategy performance are improved, and large-scale group confrontation tasks in complex environments are realized.

CN118690778APending Publication Date: 2024-09-24BEIJING INST OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410803426.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

There is a lack of multi-agent reinforcement learning methods suitable for large-scale scenarios in the existing technology, and it is difficult to cope with the explosion of state space dimensions of large-scale agent systems and the limited observation of single agents.

Method used

A proximal policy optimization method based on hard attention enhancement is used to generate encoding features of the agent, friendly and enemy through the hard attention module, calculate attention scores, filter and aggregate features, and train the decision-making network through alternating iterations and evaluation network to reduce system state space complexity and irrelevant information interference.

Benefits of technology

It improves the learning efficiency and strategy performance of large-scale multi-agent collaborative tasks, enhances robustness, and can perform large-scale group confrontation tasks in complex interference environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690778A
    Figure CN118690778A
Patent Text Reader

Abstract

The invention discloses a near-end strategy optimization method based on hard attention enhancement, a terminal and a storage medium, and relates to the technical field of artificial intelligence and control. According to the invention, the observation data of the intelligent agent is sorted, arranged and screened through the hard attention module, so that the system state space complexity and the interference of irrelevant redundant information are effectively reduced. In addition, a near-end strategy optimization method is adopted, alternate iteration training is carried out through an evaluation network and a decision network based on global information, and the evaluation network can accurately and reasonably evaluate a learning strategy of the decision network. And the learning efficiency, the strategy performance and the robustness of the reinforcement learning method applied to a large-scale multi-agent cooperative task in a complex interference environment are improved. Therefore, the problems of state dimension explosion and single agent observation limitation of a large-scale multi-agent system in the prior art are solved, and a large-scale group confrontation task is executed in a complex interference environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence and control technology, and in particular to a proximal strategy optimization method, a terminal and a storage medium based on hard attention enhancement. Background Art

[0002] In the past few years, multi-agent reinforcement learning has demonstrated significant progress in coordinating the collective behavior of artificial intelligence agents, reflecting the significant potential of multi-agent reinforcement learning in facilitating complex intelligent interactions among autonomous agents, and has therefore attracted a lot of research interest.

[0003] The current research path of multi-agent reinforcement learning is mainly concentrated on methods based on evaluation functions. These methods focus on training an evaluation network that can accurately evaluate the value of a single agent's behavior, and use the evaluation given by the evaluation network as a reference for the agent's action decision. Most evaluation function-based methods adopt a paradigm of centralized training and decentralized execution, that is, using a centralized state-action evaluation function to evaluate the collective performance of the agent team. The centralized evaluation function takes global state information that exceeds the observation range of a single agent as input and plays a vital role in guiding the strategy of individual agents. However, in the strategy execution stage, the global evaluation function is abandoned, ensuring that the action strategy can be executed when the agent lacks global information. An important focus of these value-based strategies is to solve the credit allocation problem. The current mainstream research results achieve this through the decomposition mechanism of the evaluation function. This method has shown the best performance in various benchmarks.

[0004] In contrast to the predominantly value-based approaches, policy gradient methods have been relatively less studied. While proximal policy optimization is widely considered to be an effective approach in single-agent reinforcement learning tasks, it has been understudied in the context of multi-agent reinforcement learning. Historical literature suggests that policy-based algorithms can be comparable to value-based algorithms with tailored modifications such as value normalization, input representation adjustments, and optimization of the training epoch. Furthermore, even when a properly modified proximal policy optimization algorithm is deployed without a centralized evaluation function, it still maintains a comparable level of performance to multi-agent proximal policy optimization algorithms. This finding suggests that it is possible to achieve good results in multi-agent tasks even when proximal policy optimization algorithms are applied directly to each agent.

[0005] However, in multi-agent reinforcement learning, as the number of agents increases, the complexity of the global state and the local observation of the agents will also increase rapidly, which will have an adverse effect on the learning process of the strategy and evaluation function. At present, there is a lack of a multi-agent reinforcement learning method suitable for large-scale scenarios that can effectively deal with the problem of the dimensionality explosion of the state space of large-scale agent systems and the limited observation of individual agents.

[0006] Therefore, the existing technology still needs to be improved and developed. Summary of the invention

[0007] The technical problem to be solved by the present invention is that, in view of the above-mentioned defects of the prior art, a proximal strategy optimization method, a terminal and a storage medium based on hard attention enhancement are provided, aiming to solve the problem that the prior art lacks a multi-agent reinforcement learning method suitable for large-scale scenarios, which can effectively deal with the problems of dimensionality explosion of the state space of large-scale intelligent agent systems and limited observation of single agents.

[0008] The technical solution adopted by the present invention to solve the problem is as follows:

[0009] In a first aspect, an embodiment of the present invention provides a proximal strategy optimization method based on hard attention enhancement, the method comprising:

[0010] Input the acquired observation data of each agent into the hard attention module;

[0011] Generate coding features corresponding to the agent, the friendly agent, and the enemy agent respectively according to the observation data of the agent through the hard attention module, and calculate the attention score of the observation data of each individual in the coding features of the friendly agent and the enemy agent according to the coding features of the agent;

[0012] Arranging and filtering the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score to obtain updated coding features corresponding to the friendly party and the enemy respectively;

[0013] Generate an aggregate feature according to the own coding feature, the updated coding feature of the friendly party, and the updated coding feature of the enemy party;

[0014] The aggregated features are input into a trained decision network to obtain action decision information corresponding to the agent; wherein, during training, the decision network is alternately iteratively trained with a preset evaluation network through a proximal strategy optimization method; the evaluation network is used to output decision evaluation information corresponding to the decision network according to the global information of the multi-agent system.

[0015] In one embodiment, the generating of coding features corresponding to the agent, the friendly agent, and the enemy agent respectively according to the observation data of the agent by the hard attention module includes:

[0016] Decomposing the observation data of the agent into feature data corresponding to the agent, the friendly agent and the enemy agent respectively through the hard attention module;

[0017] The characteristic data of the self, the friendly party and the enemy are input into the corresponding coding networks respectively to obtain the coding characteristics corresponding to the self, the friendly party and the enemy respectively.

[0018] In one embodiment, the calculating the attention score of the observation data of each individual in the encoding features of the friendly party and the enemy party according to the encoding features of the self includes:

[0019] For each of the self, the friendly party, and the enemy party, a nonlinear transformation is performed on the encoding features of the party according to the weight matrix corresponding to the party;

[0020] Taking the own coding feature as the main perspective, the attention score of the observation data of each individual in the coding features of the friendly party and the enemy is calculated respectively.

[0021] In one embodiment, the arranging and filtering the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score to obtain the updated coding features corresponding to the friendly party and the enemy respectively includes:

[0022] For each of the friendly party and the enemy party, arranging the observation data of each individual in the encoding feature of the party according to the descending order of the attention score;

[0023] According to the arrangement result, the individual observation data whose attention scores are in the top several positions are selected to obtain the updated coding features of the party.

[0024] In one implementation, generating an aggregate feature according to the own coding feature, the updated coding feature of the friendly party, and the updated coding feature of the enemy party includes:

[0025] Rearranging the updated coding features of the friendly party and the updated coding features of the enemy party into row vectors;

[0026] Concatenate and aggregate the rearranged row vector with the encoding feature of the self;

[0027] The aggregate feature is generated according to the concatenated and summarized row vectors.

[0028] In one implementation, generating the aggregate feature according to the concatenated and summarized row vectors includes:

[0029] Inputting the concatenated and summarized row vector into a preset aggregation network;

[0030] Aggregating the concatenated and summarized row vectors into a low-dimensional vector through the aggregation network, wherein the dimension of the low-dimensional vector is smaller than a preset dimension;

[0031] The low-dimensional vector is used as the aggregated feature.

[0032] In one implementation, inputting the aggregated features into a trained decision network to obtain action decision information corresponding to the agent includes:

[0033] Inputting the aggregated features into a trained decision network to obtain probability distribution vectors corresponding to several actions taken by the agent;

[0034] Sampling is performed according to the probability distribution vector of each action, the execution action of the agent is determined according to the sampling result, and the execution action is used as the action decision information.

[0035] In one embodiment, the method of alternating iterative training includes:

[0036] In each round of training, the parameters of the evaluation network are updated first, and then the parameters of the decision network are updated. In addition, the parameters of the hard attention module are updated while training the decision network.

[0037] In a second aspect, an embodiment of the present invention further provides a terminal, comprising a memory and one or more processors; the memory stores one or more programs; the program comprises instructions for executing any of the proximal strategy optimization methods based on hard attention enhancement as described above; and the processor is used to execute the program.

[0038] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are suitable for being loaded and executed by a processor to implement any of the steps of the above-mentioned proximal strategy optimization method based on hard attention enhancement.

[0039] Beneficial effects of the present invention: The embodiment of the present invention organizes, arranges and filters the observation data of the intelligent agent through the hard attention module, effectively reducing the complexity of the system state space and the interference of irrelevant redundant information. In addition, a proximal strategy optimization method is also adopted. By alternately iteratively training the evaluation network and the decision network based on global information, the evaluation network can accurately and reasonably evaluate the learned strategy of the decision network, thereby improving the learning efficiency, strategy performance and robustness of the reinforcement learning method when applied to large-scale multi-agent collaborative tasks in complex interference environments. Thereby solving the problems of state dimensional explosion and limited observation of a single agent in the prior art of large-scale multi-agent systems, and realizing the execution of large-scale group confrontation tasks in complex interference environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] 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 some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a schematic diagram of the step flow of the proximal strategy optimization method based on hard attention enhancement provided in an embodiment of the present invention.

[0042] Figure 2 It is a functional and structural schematic diagram of the hard attention module provided in an embodiment of the present invention.

[0043] Figure 3 It is a schematic diagram of the operating effect of the proximal strategy optimization method based on hard attention enhancement provided in an embodiment of the present invention.

[0044] Figure 4 It is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The present invention discloses a proximal strategy optimization method, a terminal and a storage medium based on hard attention enhancement. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0047] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the field to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0048] In view of the above-mentioned defects of the prior art, the present invention provides a proximal strategy optimization method based on hard attention enhancement, the method inputs the observation data of each intelligent agent into the hard attention module; generates the coding features corresponding to the agent, the friendly party and the enemy respectively according to the observation data of the agent through the hard attention module, calculates the attention score of the observation data of each individual in the coding features of the friendly party and the enemy according to the coding features of the agent; arranges and screens the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score, and obtains the updated coding features corresponding to the friendly party and the enemy respectively; generates aggregate features according to the coding features of the agent, the updated coding features of the friendly party and the updated coding features of the enemy; inputs the aggregate features into the trained decision network to obtain the action decision information corresponding to the agent; wherein, the decision network is alternately iterated with the preset evaluation network through the proximal strategy optimization method during training; the evaluation network is used to output the decision evaluation information corresponding to the decision network according to the global information of the multi-agent system. The present invention organizes, arranges and screens the observation data of the agent through the hard attention module, effectively reducing the complexity of the system state space and the interference of irrelevant redundant information. In addition, the proximal strategy optimization method is adopted. Through the alternating iterative training of the evaluation network and the decision network based on global information, the evaluation network can accurately and reasonably evaluate the learning strategy of the decision network, and improve the learning efficiency, strategy performance and robustness of the reinforcement learning method when applied to large-scale multi-agent collaborative tasks in complex interference environments. This solves the problems of state dimension explosion and limited observation of a single agent in the existing technology of large-scale multi-agent systems, and realizes the execution of large-scale group confrontation tasks in complex interference environments.

[0049] like Figure 1 As shown, the method includes:

[0050] Step S100: input the acquired observation data of each agent into the hard attention module.

[0051] Specifically, a multi-agent system is a system composed of multiple agents, and the agents can be software programs, robots, or other autonomous entities. The application scenario can be a collaborative security / area detection / target capture scenario of multiple drones / unmanned vehicles. Each agent has the ability of perception and action, and can interact and collaborate with other agents to achieve common goals or tasks. In a large-scale multi-agent confrontation environment, it is necessary to quickly and accurately decide the behavior of each agent. For this purpose, this embodiment constructs a hard attention module. In actual application, the observation data of the agent is input into the hard attention module, which can realize the organization, arrangement and screening of the observation data, thereby effectively improving the decision-making efficiency and accuracy.

[0052] For example, the intelligent agent in this embodiment can be a robot, then the observation data of the intelligent agent is the robot observation data, and the application scenario can be a multi-robot cooperation scenario. Multiple robots perform their respective duties and cooperate to complete the given tasks. It can effectively reduce the practical risks and maintenance costs of humans in specific affairs and improve production efficiency. Taking modern manufacturing as an example, the industry has widely used unmanned workshops. In the absence of manual operation, the various equipment on the production line can operate autonomously and collaboratively for production, thereby better protecting the personal safety of workers in the production process and reducing work intensity.

[0053] Step S200: Generate coding features corresponding to the agent itself, the friendly party and the enemy respectively according to the observation data of the agent through the hard attention module, and calculate the attention score of the observation data of each individual in the coding features of the friendly party and the enemy according to the coding features of the agent itself.

[0054] Specifically, the hard attention module can analyze the source of the observation data, decompose and encode it, and thus obtain the encoding features of the agent, the friendly party, and the enemy party, so that the dimensions of the observation vectors of all individuals in the environment become the same. Then, through the encoding features of the agent itself, the importance of the observation data of each individual in the encoding features of the friendly party and the enemy party is analyzed, and a higher attention score is given to the important observation data, and a lower attention score is given to the irrelevant and redundant observation data. Through the attention mechanism, the subsequent decision-making can be focused on the important observation data.

[0055] In one implementation, the generating of coding features corresponding to the agent, the friendly agent, and the enemy agent respectively according to the observation data of the agent by the hard attention module includes:

[0056] Decomposing the observation data of the agent into feature data corresponding to the agent, the friendly agent and the enemy agent respectively through the hard attention module;

[0057] The characteristic data of the self, the friendly party and the enemy are input into the corresponding coding networks respectively to obtain the coding characteristics corresponding to the self, the friendly party and the enemy respectively.

[0058] Specifically, this embodiment pre-constructs the corresponding encoding networks for the observation features from different sources, the input data of the encoding network is the feature data, and the output data is the encoding features of uniform dimension mapped to the high-dimensional hidden space. In practical applications, after the observation data of a single agent is obtained, feature extraction and feature decomposition are performed on it to obtain the feature data of itself, the friendly party and the enemy. For example, the feature data of the enemy is identified through sensors such as vision, radar and target recognition modules; the feature data of the friendly party is received through the communication network of the party; and the feature data of the party itself is obtained by measuring and perceiving its own state. In short, the feature data of itself, the friendly party and the enemy can be identified through the data source. Then the feature data of the three parties are input into their respective encoding networks one by one to obtain the encoding features of the three parties. It should be noted that usually the visibility of an agent to the friendly party and the enemy is not the same, so the number of features observed is also different. Through the encoding operation, the dimension of the observation vector of the agent for all individuals in the environment can be made the same.

[0059] For example, in a large-scale multi-agent confrontation environment, the encoding network corresponding to the agent itself, the encoding network corresponding to the friendly party, and the encoding network corresponding to the enemy are pre-designed. The observation data of a single agent O is decomposed into its own features O s Friendly Features O a 、Enemy Features O e , and then input their corresponding encoding networks f s 、f a 、f e For O s , O a , O e Encode and obtain the encoding feature Z corresponding to the agent itself s 、The encoding feature Z corresponding to the friendly side a , the corresponding encoding feature Z of the enemy e , mapping the observed features from different low-dimensional spaces to the same high-dimensional latent space.

[0060] In one implementation, the encoding feature may be in vector form, and the specific encoding process is as follows:

[0061] Z s =f s (O s );

[0062] Z e =f e (O e );

[0063] Z a =f a (O a );

[0064] Among them, Z s is the observation vector of the agent to itself, which is a row vector; Z a , Z e They are the observation matrices of the agent for all friendly agents and all enemy agents, respectively, and each row corresponds to a friendly agent / enemy agent.

[0065] In one implementation, the calculating, based on the encoding feature of the self, the attention score of the observation data of each individual in the encoding features of the friendly party and the enemy party includes:

[0066] For each of the self, the friendly party, and the enemy party, a nonlinear transformation is performed on the encoding features of the party according to the weight matrix corresponding to the party;

[0067] Taking the own coding feature as the main perspective, the attention score of the observation data of each individual in the coding features of the friendly party and the enemy is calculated respectively.

[0068] Specifically, this embodiment pre-constructs corresponding weight matrices for coding features from different sources, and the weight matrices are used to perform nonlinear transformations on the coding features. In decision analysis, the weight matrix can reflect the importance of different features, and the nonlinear transformation can convert the original features into new features, thereby performing linear classification in the new feature space. After the nonlinear transformation, the intelligent agent itself is used as the main perspective, and the attention score of the observation data of each individual in the coding features of both the friendly and enemy parties is calculated through its own coding features.

[0069] For example, using the weight matrix M corresponding to the agent itself s The encoding feature Z corresponding to itself s Perform nonlinear transformation and use the weight matrix M corresponding to the friendly party a The encoding feature Z corresponding to the friendly party a Perform nonlinear transformation and use the enemy's corresponding weight matrix M e The encoding feature Z corresponding to the enemy e Perform nonlinear transformation. And use the encoding feature Z corresponding to the agent itself s From the main perspective, calculate the encoding features Z corresponding to the friendly side respectively a , the corresponding encoding feature Z of the enemy e The attention score of the observation data related to each individual in .

[0070] The attention score is calculated as follows:

[0071]

[0072] Where m represents the length / dimension of the observation data related to a single individual; T represents the matrix transpose; y a Represents the attention score of each individual observation data in the friendly encoding feature; y e Represents the attention score of each individual observation related to the enemy's encoded features.

[0073] Step S300: Arrange and filter the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score to obtain updated coding features corresponding to the friendly party and the enemy respectively.

[0074] Specifically, the main function of the attention score is to eliminate irrelevant and redundant observation data and improve decision-making efficiency. After the attention score is calculated, the observation data of the friendly and enemy coding features are first rearranged by the attention score, and then the data is filtered according to the arrangement result to eliminate irrelevant and redundant observation data. The new coding features generated after arrangement and screening are the updated coding features.

[0075] In one implementation, the step of arranging and filtering the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score to obtain updated coding features corresponding to the friendly party and the enemy, respectively, includes:

[0076] For each of the friendly party and the enemy party, arranging the observation data of each individual in the encoding feature of the party according to the descending order of the attention score;

[0077] According to the arrangement result, the individual observation data whose attention scores are in the top several positions are selected to obtain the updated coding features of the party.

[0078] In short, the hard attention module in this embodiment takes the individual observation data of the intelligent agent as input, rearranges the observation data by importance through the hard attention mechanism, and performs cropping and aggregation, so as to achieve the purpose of aggregating important decision information and filtering interference. Specifically, after the attention score is calculated, the observation data related to each individual in the coding features of each friendly and enemy party is rearranged according to the size of the attention score. The arrangement order of each observation data can reflect its own importance, so multiple observation data with a higher order are selected to regenerate new coding features, that is, to obtain updated coding features, thereby eliminating irrelevant redundant information.

[0079] For example, according to the order of attention scores from high to low, the encoding feature Z corresponding to the friendly party is a, the corresponding encoding feature Z of the enemy e The observation data related to each individual in the game are rearranged to obtain the encoding feature Z' corresponding to the rearranged friendly party. a , the encoding feature Z' corresponding to the rearranged enemy e . Remove Z' a , Z' e The top five individual observation data in the attention score are retained, and all other data are discarded. The individual observation data retained at the end constitutes the updated coding feature. This embodiment organizes and arranges the observation data of the intelligent agent through the hard attention module, and reorganizes the observation results with similar content and different order into a similar form, which can effectively reduce the complexity of the system state space. The reorganized intelligent agent observation data is trimmed, the important parts with higher attention scores are retained, and the inefficient data with lower attention scores are discarded, so as to get rid of the interference of irrelevant redundant information.

[0080] Step S400: Generate an aggregate feature according to the own coding feature, the updated coding feature of the friendly party, and the updated coding feature of the enemy party.

[0081] Specifically, since the updated coding features are the coding features pruned by hard attention enhancement, the coding features of the agent itself are aggregated with the updated coding features of the friendly and enemy agents to obtain aggregated features containing important decision-making information.

[0082] In one implementation, generating an aggregate feature according to the own coding feature, the updated coding feature of the friendly party, and the updated coding feature of the enemy party includes:

[0083] Rearranging the updated coding features of the friendly party and the updated coding features of the enemy party into row vectors;

[0084] Concatenate and aggregate the rearranged row vector with the encoding feature of the self;

[0085] The aggregate feature is generated according to the concatenated and summarized row vectors.

[0086] Specifically, the updated encoding features of the friendly and enemy parties after removing redundant information through the attention score are rearranged into row vectors, and the row vectors obtained after rearrangement are concatenated and aggregated with the encoding features of the agent itself. Since the row vector obtained by concatenation and aggregation contains the simplified observation features of the three parties, the concatenated and aggregated row vectors are used to generate aggregate features for the action decision of the agent.

[0087] In one implementation, generating the aggregate feature according to the concatenated and summarized row vectors includes:

[0088] Inputting the concatenated and summarized row vector into a preset aggregation network;

[0089] Aggregating the concatenated and summarized row vectors into a low-dimensional vector through the aggregation network, wherein the dimension of the low-dimensional vector is smaller than a preset dimension;

[0090] The low-dimensional vector is used as the aggregated feature.

[0091] Specifically, in order to improve the efficiency of feature aggregation, this embodiment pre-constructs an aggregation network for feature aggregation. In practical applications, the row vector obtained after concatenation and aggregation is used as input data of the aggregation network, and the row vector is aggregated into a low-dimensional vector through the aggregation network, that is, the aggregated feature is obtained.

[0092] For example, the updated encoding feature Z' of the friendly party after data arrangement and data screening is a , the enemy's updated encoding feature Z' e Rearranged into a row vector, together with the agent's own encoding feature Z s Concatenate and summarize into a row vector. Design aggregation network f o Aggregate the summarized row vectors into low-dimensional vectors to obtain the aggregated feature Z o , and use it as the input data of the decision network.

[0093] In one implementation, Figure 2 As shown in the figure, the hard attention module generates aggregated features through feature mapping, normalization, feature rearrangement and clipping, feature splicing and other steps. Its specific structure is constructed with hard attention layer and splicing layer. The splicing layer is connected with linear layer and recurrent layer. The recurrent layer is constructed with gated recurrent layer and random sampling layer.

[0094] Step S500, input the aggregated features into a trained decision network to obtain action decision information corresponding to the agent; wherein, during training, the decision network is alternately iteratively trained with a preset evaluation network through a proximal strategy optimization method; the evaluation network is used to output decision evaluation information corresponding to the decision network according to the global information of the multi-agent system.

[0095] Specifically, this embodiment can use a recurrent neural network as the structure of the decision network and the evaluation network. The decision network uses aggregated features as input data and outputs the actions that the agent needs to perform; the evaluation network uses the complete, unprocessed global information of the multi-agent system as input data and outputs evaluation information used to provide reference for the agent's action decision. During training, the decision network and the evaluation network are iteratively trained through the proximal strategy optimization method, thereby effectively improving the decision accuracy of the decision network.

[0096] For example, this embodiment can use a recurrent neural network fp As a decision network, through the agent's own corresponding encoding network f s , the encoding network f corresponding to the friendly party a , the enemy's corresponding encoding network f e , the weight matrix M corresponding to the agent itself s , the weight matrix M corresponding to the friendly side a , the enemy's corresponding weight matrix M e , Aggregation Network o The observation data of the intelligent agent is trimmed and aggregated to obtain the aggregated feature Z o . Aggregate feature Z o Inputting the decision network to make agent action decisions can reduce the complexity of the state space and improve the efficiency of strategy training.

[0097] In one implementation, the evaluation network can adopt a centralized evaluation network. The input part of the centralized evaluation network adopts a hybrid structure that combines global information and local information of a single agent. It contains the complete situation while incorporating the unique local observations of a single agent, and can accurately evaluate the action strategy based on the local specific situation of a single agent. During the strategy evaluation and actual execution stage, the decision network makes decisions independently based on the agent observation information and does not rely on the centralized evaluation network. Therefore, the input part of the centralized evaluation network is specially designed so as not to undermine the executability of the strategy, thereby effectively ensuring the quality of strategy training.

[0098] In one implementation, inputting the aggregated features into a trained decision network to obtain action decision information corresponding to the agent includes:

[0099] Inputting the aggregated features into a trained decision network to obtain probability distribution vectors corresponding to several actions taken by the agent;

[0100] Sampling is performed according to the probability distribution vector of each action, the execution action of the agent is determined according to the sampling result, and the execution action is used as the action decision information.

[0101] Specifically, the decision network in this embodiment uses aggregated features as input data, with a hard attention module as the front end, outputs the probability distribution vector of each possible action taken by the agent, and samples the probability distribution vector to obtain the action that the agent needs to perform.

[0102] In one implementation, the method of alternating iterative training includes:

[0103] In each round of training, the parameters of the evaluation network are updated first, and then the parameters of the decision network are updated. In addition, the parameters of the hard attention module are updated while training the decision network.

[0104] Specifically, in this embodiment, the parameters of the decision network and the evaluation network are updated in each round of training, but the update order of the two is different. The evaluation network updates its parameters first, and then it is the decision network's turn to update its parameters, while the hard attention module updates its parameters synchronously with the decision network.

[0105] For example, sufficient data samples are collected in the task environment in advance, and the collected data samples are used to train the evaluation network and the decision network;

[0106] The evaluation network is trained using gradient backpropagation, and the loss function of the training is:

[0107]

[0108] Among them, φ k+1 represents the updated parameters in the k+1th round, represents the database of the kth round of sampling, T represents the length of time of the kth round of sampling, V φ (s t ) represents the output value of the policy network, Represents the reward value given by the actual environment, and t represents the time mark of a certain step in the sampling;

[0109] The decision network is trained by gradient backpropagation, and the loss function of the training is:

[0110]

[0111] Among them, O represents the agent observation data, Indicates system status data, represents the action decision of the agent, u - represents the action decisions of all agents except this agent, θ k represents the agent strategy parameters after the kth round update, θ represents the agent initial strategy parameters, and π θ represents a strategy with initial strategy parameters, represents the strategy with the k-th round strategy parameters, represents the advantage function of the policy of the k-th round policy parameters, ∈ represents the policy gradient clipping coefficient of the proximal policy optimization algorithm, and clip represents the clipping function.

[0112] Since the hard attention module is a module connected to the front end of the decision network, the gradient of the decision network can be fully propagated to the hard attention module, so the parameters of the hard attention module are updated while training the decision network. After data sampling is completed, in each round of training, the parameters of the evaluation network are updated first, and then the parameters of the decision network are updated, which is regarded as alternating training.

[0113] In order to prove the technical effect of the present invention, Figure 3 As shown in FIG. 1 , this figure is an effect diagram of reducing the complexity of the state space by using the present invention. i , o j The observation information of two similar agents is obtained by making different arrangement of observation inputs. The observable environment around the agents they represent is very similar. i , o j Inputting the decision network may easily lead to different action decisions, thus affecting the effectiveness of the agent's behavior strategy. i , o j Two observations that are rearranged into similar structures according to their attention scores Using them as input data of the decision network can make the decision network output similar actions, which can greatly reduce the complexity of the state space of the multi-agent system.

[0114] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Figure 4 As shown. The terminal includes a processor, a memory, a network interface, and a display screen connected through a system bus. Among them, the processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a proximal strategy optimization method based on hard attention enhancement is implemented. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen.

[0115] Those skilled in the art will understand that Figure 4 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0116] In one implementation, one or more programs are stored in the memory of the terminal, and are configured to be executed by one or more processors. The one or more programs include instructions for performing a proximal strategy optimization method based on hard attention enhancement.

[0117] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0118] In summary, the present invention discloses a proximal strategy optimization method, terminal and storage medium based on hard attention enhancement. The method is as follows: the observation data of each intelligent agent is input into a hard attention module; the hard attention module generates coding features corresponding to the agent, the friendly agent and the enemy agent respectively according to the observation data of the agent; the attention score of the observation data of each individual in the coding features of the friendly agent and the enemy agent is calculated according to the coding features of the agent; the observation data of each individual in the coding features of the friendly agent and the enemy agent is arranged and screened according to the attention score to obtain the updated coding features corresponding to the friendly agent and the enemy agent respectively; the aggregated features are generated according to the coding features of the agent, the updated coding features of the friendly agent and the updated coding features of the enemy agent; the aggregated features are input into the trained decision network to obtain the action decision information corresponding to the agent; wherein, the decision network is alternately iterated with the preset evaluation network through the proximal strategy optimization method during training; the evaluation network is used to output the decision evaluation information corresponding to the decision network according to the global information of the multi-agent system. The present invention organizes, arranges and filters the observation data of the intelligent agent through the hard attention module, effectively reducing the complexity of the system state space and the interference of irrelevant redundant information. In addition, a proximal strategy optimization method is adopted. Through alternating iterative training of the evaluation network and the decision network based on global information, the evaluation network can accurately and reasonably evaluate the learning strategy of the decision network, thereby improving the learning efficiency, strategy performance and robustness of the reinforcement learning method when applied to large-scale multi-agent collaborative tasks in complex interference environments. This solves the problems of state dimensional explosion and limited observation of a single agent in the prior art of large-scale multi-agent systems, and realizes the execution of large-scale group confrontation tasks in complex interference environments.

[0119] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A proximal strategy optimization method based on hard attention enhancement, characterized in that: The method comprises: Input the acquired observation data of each agent into the hard attention module; Generate coding features corresponding to the agent, the friendly agent, and the enemy agent respectively according to the observation data of the agent through the hard attention module, and calculate the attention score of the observation data of each individual in the coding features of the friendly agent and the enemy agent according to the coding features of the agent; Arranging and filtering the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score to obtain updated coding features corresponding to the friendly party and the enemy respectively; Generate an aggregate feature according to the own coding feature, the updated coding feature of the friendly party, and the updated coding feature of the enemy party; The aggregated features are input into a trained decision network to obtain action decision information corresponding to the agent; wherein, during training, the decision network is alternately iteratively trained with a preset evaluation network through a proximal strategy optimization method; the evaluation network is used to output decision evaluation information corresponding to the decision network according to the global information of the multi-agent system.

2. The proximal strategy optimization method based on hard attention enhancement according to claim 1 is characterized in that: The hard attention module generates coding features corresponding to the agent, the friendly agent, and the enemy agent according to the observation data of the agent, including: Decomposing the observation data of the agent into feature data corresponding to the agent, the friendly agent and the enemy agent respectively through the hard attention module; The characteristic data of the self, the friendly party and the enemy are input into the corresponding coding networks respectively to obtain the coding characteristics corresponding to the self, the friendly party and the enemy respectively.

3. The proximal strategy optimization method based on hard attention enhancement according to claim 1 is characterized in that: The calculating, based on the encoding feature of the self, the attention score of the observation data of each individual in the encoding features of the friendly party and the enemy party comprises: For each of the self, the friendly party, and the enemy party, a nonlinear transformation is performed on the encoding features of the party according to the weight matrix corresponding to the party; Taking the own coding feature as the main perspective, the attention score of the observation data of each individual in the coding features of the friendly party and the enemy is calculated respectively.

4. The proximal strategy optimization method based on hard attention enhancement according to claim 3 is characterized in that: The step of arranging and filtering the observation data of each individual in the coding features of the friendly party and the enemy according to the attention score to obtain updated coding features corresponding to the friendly party and the enemy, respectively, includes: For each of the friendly party and the enemy party, arranging the observation data of each individual in the encoding feature of the party according to the descending order of the attention score; According to the arrangement result, the individual observation data whose attention scores are in the top several positions are selected to obtain the updated coding features of the party.

5. The proximal strategy optimization method based on hard attention enhancement according to claim 1 is characterized in that: The generating of aggregate features according to the own coding features, the updated coding features of the friendly party, and the updated coding features of the enemy party includes: Rearranging the updated coding features of the friendly party and the updated coding features of the enemy party into row vectors; Concatenate and aggregate the rearranged row vector with the encoding feature of the self; The aggregate feature is generated according to the concatenated and summarized row vectors.

6. The proximal strategy optimization method based on hard attention enhancement according to claim 5 is characterized in that: The generating the aggregate feature according to the concatenated and summarized row vectors includes: Inputting the concatenated and summarized row vector into a preset aggregation network; Aggregating the concatenated and summarized row vectors into a low-dimensional vector through the aggregation network, wherein the dimension of the low-dimensional vector is smaller than a preset dimension; The low-dimensional vector is used as the aggregated feature.

7. The proximal strategy optimization method based on hard attention enhancement according to claim 1 is characterized in that: The step of inputting the aggregated features into a trained decision network to obtain action decision information corresponding to the agent includes: Inputting the aggregated features into a trained decision network to obtain probability distribution vectors corresponding to several actions taken by the agent; Sampling is performed according to the probability distribution vector of each action, the execution action of the agent is determined according to the sampling result, and the execution action is used as the action decision information.

8. The proximal strategy optimization method based on hard attention enhancement according to claim 1 is characterized in that: The method of alternating iterative training comprises: In each round of training, the parameters of the evaluation network are updated first, and then the parameters of the decision network are updated. In addition, the parameters of the hard attention module are updated while training the decision network.

9. A terminal, characterized in that: The terminal includes a memory and one or more processors; the memory stores one or more programs; the program contains instructions for executing the proximal strategy optimization method based on hard attention enhancement as described in any one of claims 1-8; and the processor is used to execute the program.

10. A computer-readable storage medium having a plurality of instructions stored thereon, characterized in that: The instructions are suitable for being loaded and executed by a processor to implement the steps of the proximal strategy optimization method based on hard attention enhancement as described in any of claims 1-8 above.

Citation Information

Patent Citations

  • Group intelligence collaboration method for communication mechanism optimization

    CN113642233A

  • Unmanned aerial vehicle group cooperative combat method based on multi-agent reinforcement learning

    CN117055623A

  • Multi-agent collaborative confrontation decision-making method and device based on reinforcement learning

    CN117273057A