The present disclosure belongs to the technical field of calibrating parameters for hydrology forecasting models, and in particular to a method for calibrating parameters of a hydrology forecasting model based on a deep reinforcement learning.
Hydrology forecasting models are widely applied in the fields, such as rainfall simulation forecasting, flood forecasting and early warning, hydrology process analysis, and play an important role in improving the efficiency of hydrology research. Since the structures of hydrology forecasting models are generally complex, the determination of the model parameters after the model is established has become a core problem to be solved urgently. Parameter calibration is to find a group of optimal parameter solutions in the hydrology forecasting model, so that the simulated and forecasted results are as close as possible to the measured data. For hydrology forecasting models, the accuracy of forecasting is directly affected by parameter calibration. Therefore, it is of great scientific significance and application value to study how to improve the speed and accuracy of parameter calibration.
The traditional manual trial and error method, gradient descent method, etc. are mostly adopted in the early methods for calibrating parameters of the hydrology forecasting models. Although these methods are intuitive, they require high experience of the staff and are easily affected by personal subjectivity, and the efficiency and accuracy for calibrating parameters are relatively low. With the development of computer technology, modern intelligent algorithms such as genetic algorithm and particle swarm algorithm are widely applied in the field of automatic parameter calibration of the hydrology forecasting models, which eliminates the deficiencies of the traditional methods. However, modern intelligent algorithms can retrieve a wide range of solutions, but there are problems of premature and being prone to falling into the local optimal solutions, which affects the selection of the global optimal solutions.
The objectives of the present disclosure are to overcome the defects of the prior art and provide a method for calibrating parameters of a hydrology forecasting model based on a deep reinforcement learning. In the present disclosure, the accuracy finally optimized by the calibration parameters can be freely controlled by setting the stride length of the action value for the deep reinforcement learning model, and a DQN algorithm is adopted to search the entire space for the calibration parameters so as to ensure optimality for optimizing the calibration parameters, so as to avoid the problem that the modern intelligent algorithms are premature and prone to falling into the local optimal solutions.
In order to solve the above technical problems, the following technical solutions are adopted in the present disclosure.
Provided is a method for calibrating parameters of a hydrology forecasting model based on a deep reinforcement learning. The method includes the following steps.
In Step 1, a hydrology forecasting model is selected and parameters that need to be calibrated are determined; the hydrology forecasting model takes a rainfall time sequence and an evaporation time sequence as inputs, and takes a time sequence of a forecasted flow as an output.
In Step 2, a reinforcement learning model for calibrating the parameters of the hydrology forecasting model is established; the reinforcement learning refers to a process of an interactive learning between an intelligent agent Agent and environment, and three key elements for the reinforcement learning are a state space, an action space and a reward value function.
In Step 3, a deep reinforcement learning method DQN is applied to optimize the parameters to be calibrated by the hydrology forecasting model.
Furthermore, a process of selecting a hydrology forecasting model and determining the plurality of parameters to be calibrated in Step 1 includes the followings.
A different hydrology forecasting model is selected according to basin characteristics, and the parameters that need to be calibrated by the hydrology forecasting model are determined, where N is a number of parameters that need to be calibrated by the hydrology forecasting model;
The values for each parameter are in a range of:
Moreover, the process of establishing the reinforcement learning model for calibrating the parameters of the hydrology forecasting model in Step S2 includes the following steps.
2-1) Determining the State Space for the Reinforcement Learning:
A state value for the reinforcement learning at a time t is defined as a one-dimensional vector st composed of the plurality of parameters to be calibrated in the hydrology forecasting model;
s
t=(wt1,wt2, . . . ,wtN)
Changes for the values for the parameters wti at the time t have two possibilities: increase or decrease; when a magnitude of increasing or decreasing the parameters wti is Δi, and then a value wt+1i for parameters at a time t+1 may be wti+Δi or wti−Δi.
2-2) Determining the Action Space for the Reinforcement Learning:
The action space A for the reinforcement learning is defined as all possibilities for changes of each of the parameters to be calibrated:
where 2N is a number of actions in the action space for the reinforcement learning; each row of matrix A is a selected action, that is, the possible values for an action value at at the time t.
2-3), Determining the Reward Value Function for the Reinforcement Learning:
Qr=[qr1, qr2, qr3, . . . , qri, . . . , qrM] is set as flow values actually measured during M time periods, where qri, i=1, 2, 3, . . . , M is a flow value actually measured during an i-th time period;
The predicted flow sequences are acquired through the hydrology forecasting model according to a state st=(wt1, wt2, . . . , wtN) at the time t and a state st+1=wt+11, wt+11, wt+11, . . . , wt+1N) at the time t+1 respectively as
Q
t
=[q
t
1
,q
t
2
,q
t
3
, . . . ,q
t
i
, . . . ,q
t
M] and
Q
t+1
=[q
t+1
1
,q
t+1
2
,q
t+1
3
, . . . ,q
t+1
i
, . . . ,q
t+1
M],
where qti, qt+1ii=1, 2, 3, . . . , M are flow values forecasted at the time t and the time t+1 during the i-th time period, respectively.
A root mean square error at the time t is defined as RMSt, and a root mean square error at the time t+1 is defined as RMSt+1, where
A reward value rt(st, at, st+1) obtained by executing an action at in a state st at the time t to reach a state st+1 at the time t+1 is defined as follows:
where C1 is a constant greater than 0; C2 is a constant less than 0; and 3 is a constant greater than 0.
Furthermore, the process of applying a deep reinforcement learning method DQN to optimize the parameters to be calibrated by the hydrology forecasting model in Step 3 includes the followings.
The following DQN algorithm for the reinforcement learning is performed according to the determined key elements of the reinforcement learning:
Input: a capacity of an experience pool D is initialized as N;
Furthermore, when an optimization curve of the DQN algorithm reaches a state of convergence, a reward value in total is in a state of slight jitter at this time, and parameter values optimally calibrated are s*=(w*1, w*2, w*3, . . . , w*N).
Compared with the prior art, the present disclosure has the following advantages and beneficial effects.
1. In the present disclosure, by setting a stride length of the action value for the deep reinforcement learning model, an accuracy optimized by the calibration parameters can be freely controlled with respect to the calibration parameters for different properties to ensure the accuracy and rationality for optimizing the calibration parameters, and to avoid investing too much calculation resources into non-important parameters.
2. In the present disclosure, a DQN algorithm is adopted to search the entire space for the calibration parameters to ensure the optimality for optimizing the calibration parameters through self-decision-making and corrective abilities of the reinforcement learning, so as to avoid the problem that modern intelligent algorithms are premature and prone to falling into local optimal solutions.
The present disclosure provides a method for calibrating parameters of a hydrology forecasting model based on a deep reinforcement learning. The method includes the following steps. An appropriate hydrology forecasting model is selected according to basin characteristics, and the parameters and parameter value ranges calibrated by the model are determined; three elements of the reinforcement learning, that is, a state space, an action space and a reward function are constructed; a deep reinforcement learning method DQN is applied to optimize the parameters calibrated by the hydrology forecasting model. In the present disclosure, by setting a stride length of the action value for the deep reinforcement learning model, an accuracy finally optimized by the calibration parameters can be freely controlled, and a DQN algorithm is adopted to search the entire space for the calibration parameters to ensure the optimality for optimizing the calibrated parameters, so as to avoid the problem that modern intelligent algorithms are premature and prone to falling into local optimal solutions.
The present disclosure will be further described in detail below in combination with the accompanying drawings.
In Step 1, a hydrology forecasting model is selected and parameters that need to be calibrated are determined.
As illustrated in
The value for each of the parameters is in a range of
where wmini and wmaxi are a minimum value and a maximum value for an i-th parameter to be calibrated, respectively.
In Step 2, a reinforcement learning model for calibrating the parameters of the hydrology forecasting model is established.
As illustrated in
(1) Determining the state space for the reinforcement learning:
The state value for the reinforcement learning at a time t is defined as a one-dimensional vector st composed of the plurality of parameters to be calibrated by the hydrology forecasting model;
s
t=(wt1,wt2, . . . ,wtN)
where wti, i=1, 2, . . . , N are values for the parameters to be calibrated by the hydrology forecasting model at the current time t.
Changes for the values wti for the parameters at the time t have two possibilities: increase or decrease; when a magnitude of increasing or decreasing the parameters wti is both Δi, then the values wt+1i for the parameters at a time t+1 may be wti+Δi or wti−Δi).
(2) Determining the action space for the reinforcement learning is determined:
The action space A for the reinforcement learning is defined as all possibilities where each of the parameters to be calibrated changes:
where 2N is a number of actions in the action space for the reinforcement learning; each row of matrix A is a selected action, that is, the possible values for an action value at at the time t. For example, when N=2 and Δ1=Δ2=0.1, then
The possible values for at at this time are [0.1, 0.1], [−0.1, 0.1], [0.1, −0.1], [−0.1, −0.1].
(3) Determining the reward value function for the reinforcement learning:
Qr=[qr1, qr2, qr3, . . . , qri, . . . , qrM] is set as flow values actually measured during M time periods, where qri, i=1, 2, 3, . . . , M is a flow value actually measured during an i-th time period.
The predicted flow sequences acquired through the hydrology forecasting model according to a states st=(wt1, wt2, . . . , wtN) at the t time and a state st+1=(wt+11, wt+12, . . . , wt+1N) at the t+1 time, are respectively as
Q
t
=[q
t
1
,q
t
2
,q
t
3
, . . . ,q
t
i
, . . . ,q
t
M] and
Q
t
=[q
t+1
1
,q
t+1
2
,q
t+1
3
, . . . ,q
t+1
i
, . . . ,q
t+1
M],
where qti, qt+1ii=1, 2, 3, . . . , M are flow values forecasted at the time t and the time t+1 during the i-th time period, respectively.
A root mean square error at the time t is defined as RAI st, and a root mean square error at the time t+1 is defined as RMSt+1 where
A reward value rt(st, at, st+1) obtained by executing an action at in a state st at the time t to reach a state st+1 at the time t+1 is defined as follows:
where C1 is a constant greater than 0; C2 is a constant less than 0; and C3 is a constant greater than 0.
In Step 3, a deep reinforcement learning method DQN is applied to optimize the parameters to be calibrated by the hydrology forecasting model.
As illustrated in
As illustrated in
Input: a capacity of an experience pool D is initialized as N;
It is obtained in the target action value network as:
if a curtain ends in a j+1-th step, else;
When an optimization curve of the algorithm of DQN reaches a state of convergence, a total reward value is in a state of slight jitter at this time, and parameter values optimally calibrated are s*=(w*1, w*2, w*3, . . . , w*N).
| Number | Date | Country | Kind |
|---|---|---|---|
| 202110361225.X | Apr 2021 | CN | national |
| Filing Document | Filing Date | Country | Kind |
|---|---|---|---|
| PCT/CN2022/078763 | 3/2/2022 | WO |