A control method for fluid-structure interaction system based on multi-task reinforcement learning
The multi-task reinforcement learning method is used to train a universal controller, which solves the problem of limited application of fluid-structure coupling system control methods in high-precision fluid simulation, realizes the transferability of control algorithms and multi-task control efficiency, and improves the flexibility of fluid control. properties and application scope.
Patent Information
- Application Number
- CN202210905709.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Existing fluid-structure interaction system control methods have limited application in high-precision fluid simulations. They have low sampling efficiency, long training time, and poor generalization. They are difficult to migrate between different simulators, limiting data-driven fluid control. application of the method.
A fluid-structure coupling system control method based on multi-task reinforcement learning is adopted, a universal controller is trained through meta-reinforcement learning, and a low-dimensional representation and post-experience replay mechanism are used to realize the migration of the controller between different simulators and task targets, and combine new Task representation method to achieve multi-task learning.
It realizes the migration of control algorithms between different simulators, avoids the computational consumption of repeated training, improves the efficiency and sample efficiency of multi-task control, and achieves portability in simulation environments and task goals, and users can quickly adjust Simulator parameters and apply the trained controller.
Smart Images

Figure CN115202210B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics fluid dynamics simulation, and in particular to a fluid-solid coupling system control method based on multi-task reinforcement learning. Background Art
[0002] Fluid control algorithms allow artists to control the motion of fluids as they wish. There are keyframe-based control methods, where the user provides a few keyframes and the fluid moves in physically similar shapes; methods that use low-resolution simulators to assist high-resolution simulators for large-scale simulations; methods that use data-driven methods to interpolate and synthesize new animations from animation datasets; and methods that generate super-resolution fluid animations by interpolating from low-resolution simulations. These methods can control the shape or motion of fluids in uncoupled systems, but not the motion of solids at the same time.
[0003] Reinforcement learning has made great progress in the fields of robot control and game AI in recent years. Using end-to-end neural network methods, reinforcement learning has been used in the field of computer graphics to control the movement of complex animated characters, manipulate granular materials, or drive fluids to control rigid objects. Pingchuan Ma has controlled high-degree-of-freedom fluid-solid coupling systems in "Fluid directed rigid body control using deep reinforcement learning", but this method has low sampling efficiency and does not have good generalization. The training time is long and the trained controller cannot be flexibly transferred to other similar simulators. Therefore, this method can only be used for low-precision two-dimensional fluid-solid coupling control, which greatly limits the application of data-driven fluid control methods in high-precision fluid simulation.
[0004] Therefore, designing a fluid-solid coupling system control method based on multi-task reinforcement learning to solve the above problems has become a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the deficiencies existing in the prior art and provide a fluid-solid coupling system control method based on multi-task reinforcement learning. This is a generalizable fluid control method, and the generalization of this method is mainly reflected in the generalization of the controller between different simulators and the generalization of the controller between different task objectives. Using the meta-reinforcement learning method, the controller is trained in a series of different fluid-solid coupling simulators, and the trained controller can be migrated to a new simulator for use at a very low computational cost. This method can also be trained using data collected under a low-precision simulator and applied to a high-precision simulator to achieve the control goal. In addition, a new task representation method is proposed, which can be integrated into the algorithm framework. This method can be used to efficiently perform multi-task learning, that is, a single controller can be used to complete different given goals.
[0006] The present invention is implemented by the following technical solution: a fluid-solid coupling system control method based on multi-task reinforcement learning, comprising the following steps:
[0007] S1: Based on the meta-reinforcement learning method, a general controller is trained, including:
[0008] S11: Randomly initialize the physical parameters of the simulator and generate multiple simulators;
[0009] S12: Use the simulator in S11 to train the encoder of the fluid to obtain a low-dimensional representation of the fluid velocity field;
[0010] S13: Initialize the parameters of the reinforcement learning Value network, Q network and policy network;
[0011] S14: Generate controller actions using the policy network, execute simulation steps to collect data, and store them in the experience pool; if it is a multi-task control scenario, generate new data trajectories based on the task representation and post-experience replay mechanism, and store them in the experience pool;
[0012] S15: Using the data collected in S14, calculate the network loss function and the task reward function, and update the simulator encoding network and the actor-critic network;
[0013] S16: Return to S14 until the reward function value obtained by each complete sampling no longer increases significantly;
[0014] S17: Specify the parameters and control subtasks of a target simulator and sample a small amount of data to make the output of the encoder converge;
[0015] S18: Based on the output of the encoder, use the policy network to output actions and perform control tasks in the new simulator;
[0016] S2: Generate animation under the specified simulation environment and target.
[0017] According to the above technical solution, preferably, S11 specifically includes:
[0018] The physical parameters of the simulator include gravity, grid accuracy, solid-liquid density ratio and solid shape, so as to generate simulators with different physical quantities according to the physical parameters of the simulator.
[0019] According to the above technical solution, preferably, the low-dimensional state in S12 is expressed as: Among them, u is the fluid velocity field, ψ(u) is the low-dimensional feature space of the fluid velocity field, q is the position information, and c is the velocity information.
[0020] According to the above technical solution, preferably, S15 specifically includes: first outputting a low-dimensional vector through the simulator encoding network to map the parameter information of the current simulator, and inputting it into the actor-critic network as part of the State to update the network parameters.
[0021] According to the above technical solution, preferably, the actor-critic network combines the Q network and the Value network to calculate the advantage function and updates the policy network by minimizing the KL divergence between the policy network and the Q network.
[0022] According to the above technical solution, preferably, S18 specifically includes:
[0023] Use an offline reinforcement learning algorithm to train the policy network, including:
[0024] Combining the optimization objective with the maximum entropy term, the optimization problem is transformed into finding an optimal strategy π(a|s) to optimize the following formula:
[0025]
[0026] Among them, π is the strategy, s t represents the state vector at time t, a t represents the action vector at time t, p(s0) represents the probability distribution of the initial state, r t is the reward function obtained at time t, is the maximum entropy, and α is used to adjust the maximum entropy term The weight coefficient, E represents the mathematical expectation, combines the offline reinforcement learning algorithm with the latent variable z, trains an execution network to execute a strategy, and trains an evaluation network to evaluate the performance of this strategy. The evaluation network consists of a Q network and a Value network, and uses the extended Q function Q θ(s,a,z) is used as an evaluation network to determine the expected reward of action a in state s,z, and the extended Value function V(s t+1 ,z) represents the expected reward of the state at time t+1, and the probability of executing an action under the current strategy is expressed as
[0027] The evaluation network is updated by the TD-λ method and is written as:
[0028]
[0029] Where γ is the attenuation factor, and D is the variable s stored at each step. t and a t The experience pool, z is the latent variable, q φ is the environment encoding network, and the latent variable z is passed through the environment encoding network q φ Tuples of transitions from all states at time steps t Obtained from the collection;
[0030] The loss of the execution network can be written as the KL divergence between the policy and the Q-value term:
[0031]
[0032] Among them, Z θ (s t ) is the coefficient that normalizes the Q function, D KL represents the KL divergence.
[0033] According to the above technical solution, preferably, the multi-task control scenario in S14 specifically includes:
[0034] Multi-body tasks involve the joint control of multiple targets, where the target is a discrete set of multiple entities. The target vector is always combined with the state vector (s, g) to handle multi-target problems, where g is a vector representing the current target combination.
[0035] Set the combination of task objectives to be fixed, pre-label each type of subtask, and rearrange the order of the solid object state vector to reflect its subtask label, thereby eliminating the explicit representation of the vector g and implicitly representing it in the corresponding order in s. Using this representation method can greatly reduce the training complexity of multi-task control;
[0036] Control problems for multiple objects and tasks often have sparse reward signals, where trajectories of positive rewards are few and far between and almost never sampled, and hindsight experience replay is employed to increase the number of positive samples.
[0037] The beneficial effects of the present invention are as follows: the present invention proposes a unified reinforcement learning framework to realize transferable multi-task fluid control, encodes simulator information through a meta-learning method, realizes the migration of control algorithms between different simulators, and avoids the large consumption caused by repeated training. At the same time, combined with a new task representation, multi-task control is realized, and transferability in both simulation environment and task objectives is realized. Users can easily adjust simulator parameters or specify targets at will, and can quickly migrate trained controllers for use without repeated training. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 The overall framework of multi-task reinforcement learning is shown;
[0039] Figure 2 It shows that a spoon is controlled to pick up a plurality of small balls from water using the method of the present invention;
[0040] Figure 3 The result of multi-task control for scooping a ball of a specific color out of water is shown;
[0041] Figure 4 The method of the present invention is shown to control the balance of a small ball in the air by spraying water in a high-precision three-dimensional simulator;
[0042] Figure 5 A schematic diagram of a first-person perspective of an acrobatic performance in which a ball in the air is controlled by spraying water to complete the position exchange of the ball according to the method of the present invention;
[0043] Figure 6 A schematic diagram from a second perspective showing a method of the present invention for performing an acrobatic performance in which a ball in the air is controlled by spraying water to exchange positions;
[0044] Figure 7 A third-angle perspective schematic diagram of an acrobatic performance in which a ball in the air is controlled by spraying water to complete the position exchange of the ball is shown;
[0045] Figure 8 A schematic diagram from the fourth perspective of the acrobatic performance of controlling the air balls to exchange positions by spraying water according to the method of the present invention is shown;
[0046] Fig. 9 A first-person perspective schematic diagram is shown of playing a user-specified music melody by controlling a ball to hit a piano key by spraying water;
[0047] Fig.10 A second perspective schematic diagram is shown of playing a user-specified music melody by spraying water to control a small ball to hit piano keys. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and the best embodiments.
[0049] As shown in the figure, the present invention provides a fluid-solid coupling system control method based on multi-task reinforcement learning, comprising the following steps:
[0050] S1: Based on the meta-reinforcement learning method, a general controller is trained, including:
[0051] S11: Randomly initialize the physical parameters of the simulator and generate multiple simulators;
[0052] S12: Use the simulator in S11 to train the encoder of the fluid to obtain a low-dimensional representation of the fluid velocity field;
[0053] S13: Initialize the parameters of the reinforcement learning Value network, Q network, and policy network; in the actor-critic reinforcement learning framework, the Value network receives the state of the scene as input and outputs a real value to predict the expected reward value in the future under the current state; the Q network receives the state and action value as input and outputs a real value to predict the expected reward brought by executing the action under the current state; the policy network maps the current scene state to an action as a control signal.
[0054] S14: Generate controller actions using the policy network, execute simulation steps to collect data, and store them in the experience pool; if it is a multi-task control scenario, generate new data trajectories based on the task representation and post-experience replay mechanism, and store them in the experience pool;
[0055] S15: Using the data collected in S14, calculate the network loss function and the task reward function, update the simulator encoding network and the actor-critic network; the reward function is designed according to different tasks and should be positively correlated with the completion of the task. The ultimate goal of reinforcement learning is to maximize the reward function.
[0056] S16: Return to S14 until the reward function value obtained by each complete sampling no longer increases significantly;
[0057] S17: Specify the parameters and control subtasks of a target simulator and sample a small amount of data to make the output of the encoder converge;
[0058] S18: Based on the output of the encoder, use the policy network to output actions and perform control tasks in the new simulator;
[0059] S2: Generate animation under the specified simulation environment and target.
[0060] According to the above embodiment, preferably, S11 specifically includes:
[0061] The physical parameters of the simulator include gravity, grid accuracy, solid-liquid density ratio and solid shape, so as to generate simulators with different physical quantities according to the physical parameters of the simulator.
[0062] According to the above embodiment, preferably, the low-dimensional state in S12 is expressed as: Among them, u is the fluid velocity field, ψ(u) is the low-dimensional feature space of the fluid velocity field, q is the position information, and c is the velocity information.
[0063] Fluids are special in that they are extremely high-dimensional. Even when training control skills on very low-resolution grids, the fluid dimensionality is still a huge input to the policy network. Since the fluid velocity field is highly smooth and correlated, dimensionality reduction techniques can be used to obtain an effective low-dimensional representation. In fact, the difference in resolution mainly affects the details of the fluid surface and small vortices, which do not play an important role in the fluid-solid interaction compared to the bulk motion, which can be well captured in the downsampled velocity field.
[0064] Therefore, a velocity encoder is pre-trained to map the fluid velocity field u to a low-dimensional feature space ψ(u). To train the velocity encoder, a series of simulators with different parameters are first run using randomly sampled actions and the velocity field is recorded. The fully convolutional network (FCN) can better encode fluid features and bring better performance in downstream tasks. In previous convolutional velocity encoders, the last convolution layer was flattened and the encoded features were calculated by an additional fully connected layer. However, the computational domain size of the present invention is anisotropic. In order to make the number of learnable parameters in FCN roughly the same, anisotropic convolution kernels with a size proportional to the computational domain size are used. The position and velocity information of the controlled and uncontrolled objects are defined as q and c, respectively, and the low-dimensional state is represented as: That is, the observation space consists of the fluid velocity field, the position and velocity information of the controlled and uncontrolled objects. This vector is used as the input of the control network as a representation of the current scene state.
[0065] According to the above embodiment, preferably, S15 specifically includes: first outputting a low-dimensional vector through the simulator encoding network to map the parameter information of the current simulator, and inputting it into the actor-critic network as part of the State to update the network parameters.
[0066] According to the above embodiment, preferably, the actor-critic network combines the Q network and the Value network to calculate the advantage function and updates the policy network by minimizing the KL divergence between the policy network and the Q network.
[0067] Using the actor-critic network as the control module, the policy function Indicates that Mapped to a, where z represents the state of the environment, represents the extended state, and a represents the low-dimensional action.
[0068] The critic network consists of a double Q network and a value function network, which are used to approximate the state-action and state-value functions respectively. These two networks are used to guide the update of the actor network. Both the critic network and the actor network are composed of a 3-layer fully connected network (MLP). After simulating the complete trajectory, the state transition tuples from each time step t to t+1 are collected. And use the parameter encoder to infer the simulator parameters from it.
[0069] If one wants to learn the representation of the environment from the current trajectory, considering the technical problem to be solved by the present invention, the diversity of simulation parameters, such as simulation solver or resolution, essentially affects the conversion process p(s t+1 |s t ,a t ) distribution. Among them, s t and a t Represent the state and action executed at time t respectively. Collect tuple b t =(s t ,a t ,s t+1 ), and from b 1:N The environment variables z associated with the environment are learned in , where N represents the length of the tuple used for inference.
[0070] When the fluid is undergoing complex topological changes, its state space is very large. In these complex state transitions, it is difficult to get useful representations from them because there are a lot of perturbations in the data, making it difficult for the network to converge. Instead, only the initial T tuples of each trajectory are selected to generate the task variables. Typically in these tuples, the fluid and solid start moving from a stationary state and then deform a small amount due to contact, which illustrates the characteristics of the current simulator. The physical parameters can be inferred from the movement of the material and the boundary conditions can be inferred from the deformation at the time of contact, where these boundary conditions are affected by the surface shape of the material and the solver tools. At the same time, the amount of computation used to infer the task variables is reduced, making the encoding process faster. Since we want to infer probabilistic variables from the collected samples, we can use a framework similar to the variational autoencoder to infer the distribution q φ (z|b 1:N ) to estimate the posterior distribution p(z|b 1:N ). We can write a variational lower bound
[0071]
[0072] in, To evaluate the network, it is an important indicator to measure the current state evaluation. p(z) is the unit Gaussian prior value of z, β is the coefficient, D KL represents the KL divergence. The KL divergence term measures the mutual information between the potential task variables and the input tuple in the variational inference result, which is adjusted by the coefficient β. b is the state transition tuple from all time steps t to t+1 under the current trajectory. A collection of .
[0073] According to the above embodiment, preferably, S18 specifically includes:
[0074] Use an offline reinforcement learning algorithm to train the policy network, including:
[0075] The policy network of the present invention is trained using an offline reinforcement learning algorithm called SoftActor-Critic (SAC). Research on policy reinforcement learning has been used in previous work, but the trajectories collected with the current policy must be used for improvement, which limits sample efficiency. Compared to on-policy algorithms, SAC is based on an actor-critic approach that uses an experience replay buffer to learn a value network based on which the policy is improved. Since the collected data can be reused, this method is more effective in expensive high-resolution 2D or 3D simulators.
[0076] Combining the optimization objective with the maximum entropy term, the optimization problem is transformed into finding an optimal strategy π(a|s) to optimize the following formula:
[0077]
[0078] Among them, π is the strategy, s t represents the state vector at time t, a t represents the action vector at time t, p(s0) represents the probability distribution of the initial state. After the initial state is determined, the subsequent state is generated by strategy π, r t is the reward function obtained at time t, is the maximum entropy, and α is used to adjust the maximum entropy term The weight coefficient, E represents the mathematical expectation, combines the offline reinforcement learning algorithm with the latent variable z, trains an execution network to execute a strategy, and trains an evaluation network to evaluate the performance of this strategy. The evaluation network consists of a Q network and a Value network, and uses the extended Q function Q θ (s,a,z) is used as an evaluation network to determine the expected reward of action a in state s,z, and the extended Value function V(s t+1,z) represents the expected reward of the state at time t+1, and the probability of executing an action under the current strategy is expressed as
[0079] The evaluation network is updated by the TD-λ method and is written as:
[0080]
[0081] Where γ is the attenuation factor, and D is the variable s stored at each step. t and a t The experience pool, z is the latent variable, q φ is the environment encoding network, and the latent variable z is passed through the environment encoding network q φ Tuples of transitions from all states at time steps t Obtained from the collection;
[0082] The loss of the execution network can be written as the KL divergence between the policy and the Q-value term:
[0083]
[0084] Among them, Z θ (s t ) is the coefficient that normalizes the Q function, D KL represents the KL divergence.
[0085] According to the above embodiment, preferably, the multi-task control scenario in S14 specifically includes:
[0086] The simulator controller implemented by the meta-reinforcement learning method solves the generalization problem caused by simulator differences to a large extent, but a trained controller still cannot handle all the task goals that an artist may require. The present invention extends the transfer learning method to a task goal-related part and learns a general multi-task strategy that can adapt to different environments and different specified goals at the same time.
[0087] Multi-body tasks involve multiple goals to be controlled together. The goals are a discrete set of entities. The goal vector is always combined with the state vector (s, g) to handle multi-goal problems, where g is a vector representing the current goal combination. However, since the goals may be a large discrete set, it is difficult to train a general controller for all these tasks through previous methods, even with a lot of sampling and training.
[0088] Therefore, the present invention sets the combination of task goal sets to be fixed, pre-labels each type of subtask, and rearranges the order of the solid object state vector to reflect its subtask label, thereby eliminating the explicit representation of the vector g and implicitly representing it in the corresponding order in s. Using this representation method can greatly reduce the training complexity of multi-task control.
[0089] Control problems for multiple objects and tasks often have sparse reward signals, where trajectories of positive rewards are few and almost never sampled. Hindsight Experience Replay (HER) is employed to increase the number of positive samples.
[0090] This approach is based on the fact that failure cases (negative samples) of a given task can be considered as positive samples of another task by matching the goal of one given task. In the present invention, when a negative sample is observed, that is, an object is expected to reach a certain target location, but another object eventually reaches that location, the sample is represented as a potential sample. Then, the task of the potential sample is reassigned, the state vector is remapped using the task representation, and the tuple is inserted into the replay buffer. Another case of a potential sample is that an object performs the wrong subtask. Although not all negative samples can become positive, this technique significantly improves the ratio of positive samples in the replay buffer and increases the chance of perceiving sparse reward signals. The performance of HER can be improved by considering the entire trajectory instead of a single time step. Specifically, if the cumulative reward of the entire trajectory increases after the task is reassigned, all tuples of the trajectory are inserted into the replay buffer. Otherwise, the reassigned trajectory is discarded. The hindsight experience replay (HER) mechanism is combined to solve discrete combined multi-objective tasks. The number of discrete combinations increases rapidly with the growth of the number of solid objects. With the help of this method, the task scale can be reduced and the efficiency of multi-task learning can be improved. At the same time, the playback mechanism is used to increase the proportion of positive samples, which greatly improves the sample efficiency and training speed of multi-task control.
[0091] like Figure 1 The overall algorithm framework is shown in Figure 1. The high-dimensional fluid data is reduced to a compact state representation through a fluid encoder, and the corresponding mapping is represented as s based on the task goal g. The encoding network with simulated parameters infers the environment vector z from the tuple b, and is fed into the actor-critic network together with the state vector s to calculate the loss function, and iterates the steps of data collection and network parameter update.
[0092] like Figure 2 As shown, it is demonstrated that the method of the present invention is used to control a spoon to pick up multiple small balls from water in different simulated environments. What is controlled is the translation and rotation acceleration of the spoon on the plane. In these simulators, the density ratio, gravity, solution accuracy and the shape of the controlled object are all different. Generate a random parameter simulator with low grid accuracy as a training sample, the same as the following figures. In a high-precision simulator, use the trained simulator, execute a small number of time steps to obtain interaction data, input it into the environment encoding network to obtain environmental variables, and generate actions for each time step based on the variables to drive the spoon to move, and generate a simulation animation of scooping out multiple small balls.
[0093] like Figure 3 The figure shows the multi-task control result of fishing out a ball of a specific color from water using the method of the present invention. In the control stage, the user specifies two numbered balls as red online. The algorithm generates a task representation based on the user-specified number and inputs it into the policy network, outputs the action of each step under the current task, and completes the animation of fishing out a specific ball. In the upper and lower trajectories, the user specifies different distributions of balls, and the controller can fish out the balls of the correct color from them, while avoiding taking out other non-specified balls.
[0094] like Figure 4 As shown, the present invention is used to control the balance of a ball in the air by spraying water in a high-precision three-dimensional simulator. What is controlled is the force on the bottom water pipe in the horizontal direction and the rate of change of the water output. Such a selection of control variables can make the fluid simulation smooth and continuous, ensuring the realism of the simulation. By controlling two water pipes, three balls can be controlled to maintain balance in the air.
[0095] like Figure 5-Figure 8 As shown, by controlling two water pipes, the three small balls in the air are kept balanced and the acrobatic performance of exchanging positions is completed.
[0096] Assume that the balls are numbered 1, 2, and 3 from left to right. Swap the positions of balls 1 and 2, 1 and 3, and 2 and 3 in turn, and make sure that the balls do not fall in the air during the process. The ball status information is represented and input into the control network in turn according to the direction of the ball's movement (left, right, fixed). In the specific implementation, the time step required for each exchange is fixed, that is, the direction of the ball's movement is changed at fixed intervals, and a new task representation is obtained as input.
[0097] like Figure 9-10 As shown in the figure, water is sprayed to control the ball to hit the keys to play the music melody specified by the user. The keys represent the notes Do, Re, Mi, Fa, Sol, La, and Ti from left to right. During the training phase, a sequence of notes is randomly generated, and the controller is trained until the reward is maximized. During the animation generation phase, the user specifies the order of notes to be hit online. For each note input, the algorithm selects the nearest ball and controls the water pipe to spray water to push the ball to hit the target note.
[0098] The beneficial effects of the present invention are as follows: the present invention proposes a unified reinforcement learning framework to realize transferable multi-task fluid control, encodes simulator information through a meta-learning method, realizes the migration of control algorithms between different simulators, and avoids the large consumption caused by repeated training. At the same time, combined with a new task representation, multi-task control is realized, and transferability in both simulation environment and task objectives is realized. Users can easily adjust simulator parameters or specify targets at will, and can quickly migrate trained controllers for use without repeated training.
[0099] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A fluid-solid coupling system control method based on multi-task reinforcement learning, characterized in that: The following steps are involved: S1: Based on the meta-reinforcement learning method, a general controller is trained, including: S11: Randomly initialize the physical parameters of the simulator and generate multiple simulators; S12: Use the simulator in S11 to train the encoder of the fluid to obtain a low-dimensional representation of the fluid velocity field; S13: Initialize the parameters of the reinforcement learning Value network, Q network and policy network; S14: Generate controller actions using the policy network, execute simulation steps to collect data, and store them in the experience pool; if it is a multi-task control scenario, generate new data trajectories based on the task representation and post-experience replay mechanism, and store them in the experience pool; S15: Using the data collected in S14, calculate the network loss function and the task reward function, and update the simulator encoding network and the actor-critic network; S16: Return to S14 until the reward function value obtained by each complete sampling no longer increases significantly; S17: Specify the parameters and control subtasks of a target simulator and sample a small amount of data to make the output of the encoder converge; S18: Based on the output of the encoder, use the policy network to output actions and perform control tasks in the new simulator; S2: Generate animation under the specified simulation environment and target.
2. The fluid-solid coupling system control method based on multi-task reinforcement learning according to claim 1 is characterized in that: Specifically in S11: The physical parameters of the simulator include gravity, grid accuracy, solid-liquid density ratio and solid shape, so as to generate simulators with different physical quantities according to the physical parameters of the simulator.
3. The fluid-solid coupling system control method based on multi-task reinforcement learning according to claim 1 is characterized in that: The low-dimensional state in S12 is represented as: Among them, u is the fluid velocity field, ψ(u) is the low-dimensional feature space of the fluid velocity field, q is the position information, and c is the velocity information.
4. The fluid-solid coupling system control method based on multi-task reinforcement learning according to claim 3 is characterized in that: S15 specifically includes: first outputting a low-dimensional vector through the simulator encoding network to map the parameter information of the current simulator, and inputting it into the actor-critic network as part of the State to update the network parameters.
5. The method for controlling a fluid-solid coupling system based on multi-task reinforcement learning according to claim 4, characterized in that: The actor-critic network combines the Q network and the Value network to calculate the advantage function and updates the policy network by minimizing the KL divergence between the policy network and the Q network.
6. The fluid-solid coupling system control method based on multi-task reinforcement learning according to claim 1 is characterized in that: The S18 specifically includes: Use an offline reinforcement learning algorithm to train the policy network, including: Combining the optimization objective with the maximum entropy term, the optimization problem is transformed into finding an optimal strategy π(a|s) to optimize the following formula: Among them, π is the strategy, st represents the state vector at time t, and a t represents the action vector at time t, p(s0) represents the probability distribution of the initial state, rt is the reward function obtained at time t, is the maximum entropy, and α is used to adjust the maximum entropy term The weight coefficient, E represents the mathematical expectation, combines the offline reinforcement learning algorithm with the latent variable z, trains an execution network to execute a strategy, and trains an evaluation network to evaluate the performance of this strategy. The evaluation network consists of a Q network and a Value network, and uses the extended Q function Q θ (s,a,z) is used as an evaluation network to determine the expected reward of action a in state s,z, and the extended Value function V(s t+1 ,z) represents the expected reward of the state at time t+1, and the probability of executing an action under the current strategy is expressed as The evaluation network is updated by the TD-λ method and is written as: Where γ is the attenuation factor, and D is the variable s stored at each step. t and a t The experience pool, z is the latent variable, q φ is the environment encoding network, and the latent variable z is passed through the environment encoding network q φ Tuples of transitions from all states at time steps t Obtained from the collection; The loss of the execution network can be written as the KL divergence between the policy and the Q-value term: Among them, Z θ (s t ) is the coefficient that normalizes the Q function, D KL represents the KL divergence.
7. The fluid-solid coupling system control method based on multi-task reinforcement learning according to claim 1 is characterized in that: The multi-task control scenario in S14 specifically includes: Multi-body tasks involve the joint control of multiple targets, where the target is a discrete set of multiple entities. The target vector is always combined with the state vector (s, g) to handle multi-target problems, where g is a vector representing the current target combination. Set the combination of task objectives to be fixed, pre-label each type of subtask, and rearrange the order of the solid object state vector to reflect its subtask label, thereby eliminating the explicit representation of the vector g and implicitly representing it in the corresponding order in s. Using this representation method can greatly reduce the training complexity of multi-task control; Control problems for multiple objects and tasks often have sparse reward signals, where trajectories of positive rewards are few and far between and almost never sampled, and hindsight experience replay is employed to increase the number of positive samples.
Citation Information
Patent Citations
Rigid body control method for fluid guide based on deep reinforcement learning
CN108983605A
Unmanned aerial vehicle maneuvering target tracking method based on DDPG transfer learning
CN111667513A
Cited By
Hydrodynamic force rapid prediction method based on space-time intelligent calculation
CN121919497A
