A tree attention-based wave long-term prediction method
Patent Information
- Application Number
- CN202311312072.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-10-11
AI Technical Summary
[0003]传统的波浪预测方法针对于短时预测具有较大优势,但对于长时预测来说,传统的波浪预测方法所采用的长短期记忆网络等循环神经网络会随着输入序列的不断增加从而引发梯度消失和梯度爆炸等问题,使得预测效率大打折扣
[0053] (1) This invention proposes a tree generation module and introduces an attention mechanism. Multiple scales are constructed using a convolution module, and the scales are mapped to durations, so that the tree attention mechanism can effectively capture the long-term correlation of wave sequences between different scales and the same scale.
Smart Images

Figure CN117370895B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of marine engineering technology, specifically relating to a long-term wave prediction method based on tree attention. Background Technology
[0002] In recent years, with increasing global attention to resource supply and growing environmental awareness, the world urgently needs a new environmentally friendly energy source to solve various energy problems. The ocean, covering 71% of the Earth's surface, contains abundant and diverse marine resources. Wave energy refers to the kinetic and potential energy of ocean surface waves. Its power generation principle is to convert the kinetic and potential energy of water into mechanical energy to drive a generator. Its green and renewable characteristics make it a mainstream direction for future energy development. The intensity of wave energy is positively correlated with wave height and wave cycle, so wave height prediction plays an important role in improving wave energy conversion efficiency. Traditional wave height prediction uses a "decomposition plus prediction" approach, that is, decomposing the wave sequence into more stable signals through methods such as empirical mode decomposition, and then using networks such as long short-term memory networks for prediction. Summary of the Invention
[0003] Traditional wave prediction methods have significant advantages for short-term forecasting, but for long-term forecasting, the recurrent neural networks such as Long Short-Term Memory (LSTM) used in these methods suffer from vanishing and exploding gradients as the input sequence increases, greatly reducing prediction efficiency. This invention provides a tree-attention-based long-term wave prediction method that predicts future wave heights based on observed ocean environmental parameters, effectively improving long-term wave prediction performance.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] A long-term wave prediction method based on tree attention, with the following specific steps:
[0006] Step (1) involves preprocessing the original wave sequence data by removing outliers and performing correlation statistics to identify several variables that are strongly correlated with the wave height data, thus reconstructing a new wave sequence. The original wave sequence refers to the previous original observation data of the observation area.
[0007] Step (2) involves encoding the new wave sequence obtained after preprocessing in step (1) using local and global timestamps, and then inputting it into the tree generation module designed in this invention to generate an attention tree. The tree attention mechanism proposed in this invention captures the long-term correlation between different scales and the same scale in the preprocessed new wave sequence. Furthermore, a self-attention distillation module is used to reduce the feature dimension of the preprocessed new wave sequence, obtaining a feature map that enables the encoder to handle longer input sequences, thus solving the stacking problem inherent in transformer prediction methods.
[0008] Step (3) inputs the feature map and new wave sequence generated by the attention distillation module in step (2) into the generative decoder module designed in this invention to perform univariate or multivariate prediction. That is, without the need for iterative prediction, the prediction results under different prediction durations can be obtained directly.
[0009] The specific implementation steps of this invention are as follows:
[0010] Step (1): Obtain the original wave sequence and perform preprocessing.
[0011] Step 1.1: Select observation data from observation stations over a certain period of time, including wave height and various variables related to wave height. Then, process the data. Determine if a column contains missing data based on whether the number of unobserved data points exceeds 90% of the total data points in that column. If it exceeds 90%, the data is considered missing and deleted. Missing data in columns with fewer than 90% missing data points is filled using average or interpolation methods.
[0012] Step 1.2: We perform correlation statistics on the wave sequence obtained in Step 1.1 after preliminary processing to identify several variables that are strongly correlated with the wave height variable. Correlation statistics generally use the Pearson formula. Let x represent the wave height variable, and y represent the other variables whose correlation with the wave height variable needs to be determined. i and y i Let represent the i-th value in vectors x and y, then the formula is as follows:
[0013]
[0014] Where cov(x,y) represents the covariance between vectors x and y, σ x and σ y The standard deviations of the x and y vectors are represented. and This represents the average of all values in the x and y vectors.
[0015] Step 1.3: Remove all variables from the original wave sequence except for the highly correlated variables and wave height variable obtained in Step 1.2, and reconstruct it into a new wave sequence.
[0016] Step (2): Construct the encoder module
[0017] Step 2.1: Before inputting the encoder module, the new wave sequence obtained in step 1.3 is feature-encoded using local and global timestamps to obtain the feed vector.
[0018] Step 2.2: Input the feature-encoded feed vector into the tree generation module to generate an attention tree.
[0019] The tree generation module is a bottleneck structure consisting of five convolutional modules. This structure reduces computation by replacing large-size convolutions with multiple small-size convolutions. First, the input dimension is set to B×L×D, where B is the BatchSize of this invention, L is the length of the input sequence (i.e., the new wave sequence), and D is the node dimension. It first passes through an intermediate dimension of D... K A 1×1 convolutional layer transforms the dimensions to B×L×D. K Then, it passes through three convolutional modules with kernel size C and stride C; finally, it is restored to the original scale through a 1×1 convolutional layer of dimension D. If the convolution operation is performed directly, the number of parameters F is:
[0020]
[0021] Wherein, D in the above formula i and C i Both have fixed node dimensions D and kernel size C. However, the number of parameters after adopting the bottleneck structure... It then becomes:
[0022]
[0023] Among them, in the above formula and C i Each has a fixed intermediate dimension D. K And the kernel size C.
[0024] Comparing the parameter quantities obtained from formulas (2) and (3), it can be seen that after adopting this bottleneck structure, due to the reduced intermediate dimension D... K The value is much smaller than D, allowing the bottleneck structure to reduce the number of parameters from exponential to linear levels. It also prevents overfitting.
[0025] Step 2.3: In the convolution process described in Step 2.2, after each convolutional module, a time-dimension vector of length L / C is generated.s The sequence is generated by the algorithm, where L is the sequence length, C is the kernel size, and s is the current scale. A total of four scales generate four sequences. The tree generation module defines the sequence generated at the initial scale as the coarse sequence and the sequence generated at the final scale as the fine sequence. Before inputting these coarse to fine sequences into the encoder, the tree generation module uses a residual structure to connect the four sequences from coarse to fine, thereby constructing a multi-dimensional tree from the sequences at different scales.
[0026] Step 2.4: The tree attention mechanism, based on the tree generation module, acquires long-term correlations by continuously interacting and passing messages between different scales and within the same scale. For connections at different scales, a multivariate tree generated by the tree generation module is used, where tree nodes are arranged from coarse to fine from top to bottom, and each parent node has multiple child nodes. Since the prediction duration in typical wave prediction experiments is measured in hours, if the finest scale of the tree is correlated with the hourly observations in the original time series, then the coarser scale can be considered as representing the daily and monthly features of the time series. Therefore, this connection at different scales provides a multi-resolution representation of the original time series. Based on this background, compared to previous methods that could only operate at fine scales, this invention can effectively capture the long-term correlations of wave data, whether at finer or coarser scales—that is, between adjacent nodes within the same scale.
[0027] In the tree attention mechanism, we define the l-th node at scale s. It does not focus on all other nodes in the tree, but only on nodes that are at the same scale. Child nodes are adjacent nodes at a finer scale. And the parent node, i.e., the adjacent node at a coarser scale. For nodes at the same scale, we define their processable neighbor number as T, and then...
[0028]
[0029] definition For nodes The set of points of interest is represented as
[0030]
[0031] Then it is at the node The attention output at point can be represented as
[0032]
[0033] Next, a complexity analysis of this invention is performed. For the number of nodes L at scale s... (s) have
[0034]
[0035] And for nodes Its dot product D (s) It can be divided into scale range and between scales Two parts: the intra-scale dot product number is less than or equal to the number of neighboring nodes T that it can handle; the inter-scale dot product number is less than or equal to the number of finer points C that the coarser node can handle plus one. That is...
[0036]
[0037] Then, from formula (8), we can obtain the total dot product D.
[0038]
[0039] Therefore, the time complexity is O(D).
[0040]
[0041] As the input length L increases, the time complexity O(D) can be directly regarded as O(L), so the tree attention module can reduce the complexity of the model accordingly.
[0042] Step 2.5: Since the tree attention mechanism in Step 2.4 aims to capture the long-term correlation of long input sequences, directly performing tree attention operations would lead to continuous stacking of the encoder and decoder, resulting in a continuous increase in model memory usage and time efficiency issues. Therefore, a self-attention distillation operation is performed after each tree attention block. The self-attention distillation mechanism generates key features by processing the dominant features with primary characteristics, assigning them higher weights, and pruning the temporal dimension, thus allowing the encoder to process longer input sequences.
[0043] The encoder contains multiple tree attention blocks, each with half the dimensionality of the previous one. After passing through each tree attention block, the code proceeds through a one-dimensional convolutional layer, an ELU activation layer, and a max-pooling layer with a stride of 2, as shown in the formula.
[0044]
[0045] MaxPool is the max pooling layer, ELU is the function activation layer, and Conv1d is the one-dimensional convolutional layer. and This represents the outputs of layers j and j+1 in the distillation module. This indicates that the output of the j-th layer in the distillation module is passed through a tree attention block. To enhance the robustness of the model, we design a stacked structure with multiple layers. The input of each layer is half of the input of the layer above it, and one layer of distillation operations is discarded compared to the previous layer to align its output dimensions. In this way, each layer will obtain a feature map. We concatenate the feature maps obtained from each stacked structure to obtain the final output of the encoder.
[0046] Step (3): Construct the decoder module
[0047] The decoder section uses a standard decoder structure, consisting of a masked multi-head tree attention layer and a multi-head tree self-attention layer. Traditional long-term prediction methods stack two identical multi-head attention layers in the decoder structure, performing iterative prediction. However, this prediction method causes subsequent predictions to depend on the prediction results of previous time steps, leading to efficiency issues. This decoder section employs a generative operation, obtaining the prediction result in one step from the input vector shown below:
[0048]
[0049] Concat represents merging joins. It is the starting sequence segment, which can be dynamically sampled from the input sequence close to the prediction target; while The timestamps of the predicted sequence can be viewed as a zero matrix with the same prediction duration. The concatenated result is then encoded using features and input into the decoder for decoding. This eliminates the need for dynamic decoding, employing a single forward pass through a fully connected layer to obtain the entire output sequence, thus solving the efficiency problem.
[0050] Step (4): Utilize evaluation indexes to measure the model.
[0051] The output sequence generated by the decoder is processed with the corresponding observation data to obtain two indicators: mean squared error and mean absolute error. These two indicators reflect the quality of the model's prediction performance. By comparing these two indicators simultaneously with the increase in the length of the wave sequence input to the model and the prediction duration, it can be seen that the designed tree attention-based long-term wave prediction method can maintain the error at a normal level and effectively improve the performance of long-term wave prediction.
[0052] The beneficial effects of this invention are as follows:
[0053] (1) This invention proposes a tree generation module and introduces an attention mechanism. Multiple scales are constructed using a convolution module, and the scales are mapped to durations, so that the tree attention mechanism can effectively capture the long-term correlation of wave sequences between different scales and the same scale.
[0054] (2) This invention employs a self-attention distillation module. By performing feature processing on the dominant features with primary characteristics and assigning them higher weights, and by pruning the time dimension to generate key features, the encoder is allowed to process longer sequence inputs.
[0055] (3) This invention employs a generative decoder. It can achieve long-term prediction of wave sequences in one go, thereby mitigating the adverse effects of iterative prediction. Attached Figure Description
[0056] Figure 1 This is a general framework diagram of the present invention.
[0057] Figure 2 This is a comparison curve of the prediction results of the present invention. Detailed Implementation
[0058] The specific embodiments of the present invention will be further described below in conjunction with the technical solution.
[0059] A long-term wave prediction method based on tree attention, with the following specific steps:
[0060] 1. Obtain the original wave sequence and perform preprocessing.
[0061] Step 1.1: This invention selects observational data from 46080 observation stations at NOAA for the entire year of 2015 as the dataset. This dataset includes 13 variables: wind direction, average wind speed, peak wind speed, wave height, dominant wave period, average wave period, dominant wave period direction of origin, sea level pressure, air temperature, sea level temperature, dew point temperature, station visibility, and below-average water level. The data is then processed. Unobserved data in this dataset is replaced with 99.00. The missing data in each column is determined by whether the number of unobserved data points (i.e., 99.00) exceeds 90% of the total data in that column. If it exceeds 90%, the column is considered missing and deleted. Missing data in columns with less than 90% missing data are filled using average or interpolation methods.
[0062] Step 1.2: We perform correlation statistics on the wave sequence obtained in Step 1.1 after preliminary processing to identify several variables that are strongly correlated with the wave height variable. Correlation statistics generally use the Pearson formula. Let x represent the wave height variable, and y represent the other variables whose correlation with the wave height variable needs to be determined. i and y i Let represent the i-th value in vectors x and y, then the formula is as follows:
[0063]
[0064] Where cov(x,y) represents the covariance between vectors x and y, σ x and σ y The standard deviations of the x and y vectors are represented. and This represents the average of all values in the x and y vectors.
[0065] After correlation statistics, a total of six variables with strong correlation to wave height were obtained: dominant wave period, mean wave period, peak wind speed, sea level pressure, and sea level temperature.
[0066] Step 1.3: Remove all variables from the original wave sequence except for the highly correlated variables and wave height variable obtained in Step 1.2, and reconstruct it into a new wave sequence.
[0067] 2. Build the encoder module
[0068] Step 2.1: Before inputting the encoder module, the new wave sequence obtained in step 1.3 is feature-encoded using local and global timestamps to obtain the feed vector.
[0069] Step 2.2: The input vector after feature encoding is fed into the tree generation module to generate the attention tree. The tree generation module is a bottleneck structure consisting of 5 convolutional modules. This structure reduces the computational load by replacing large-size convolutions with multiple small-size convolutions. First, the input dimension is set to B×1×D, where B is the Vatch Size of this invention, L is the length of the input sequence (i.e., the new wave sequence), and D is the dimension of the node. First, it passes through an intermediate dimension of D... K A 1×1 convolutional layer transforms the dimensions to B×L×D. K Then, it passes through three convolutional modules with kernel size C and stride C; finally, it is restored to the original scale through a 1×1 convolutional layer of dimension D. If the convolution operation is performed directly, the number of parameters F is:
[0070]
[0071] Wherein, D in the above formula i and C i Both have fixed node dimensions D and kernel size C. However, the number of parameters after adopting the bottleneck structure... It then becomes:
[0072]
[0073] Among them, in the above formula and C i Each has a fixed intermediate dimension D. K And the kernel size C.
[0074] Comparing the parameter quantities obtained from formulas (2) and (3), it can be seen that after adopting this bottleneck structure, due to the reduced intermediate dimension D... K The value is much smaller than D, allowing the bottleneck structure to reduce the number of parameters from exponential to linear levels. It also prevents overfitting.
[0075] Step 2.3: In the convolution process described in Step 2.2, after each convolutional module, a time-dimension vector of length L / C is generated. s The sequence is generated by the algorithm, where L is the sequence length, C is the kernel size, and s is the current scale. A total of four scales generate four sequences. The tree generation module defines the sequence generated at the initial scale as the coarse sequence and the sequence generated at the final scale as the fine sequence. Before inputting these coarse to fine sequences into the encoder, the tree generation module uses a residual structure to connect the four sequences from coarse to fine, thereby constructing a multi-dimensional tree from the sequences at different scales.
[0076] Step 2.4: The tree attention mechanism, based on the tree generation module, acquires long-term correlations by continuously interacting and passing messages between different scales and within the same scale. For connections at different scales, a multivariate tree generated by the tree generation module is used, where tree nodes are arranged from coarse to fine from top to bottom, and each parent node has multiple child nodes. Since the prediction duration in typical wave prediction experiments is measured in hours, if the finest scale of the tree is correlated with the hourly observations in the original time series, then the coarser scale can be considered as representing the daily and monthly features of the time series. Therefore, this connection at different scales provides a multi-resolution representation of the original time series. Based on this background, compared to previous methods that could only operate at fine scales, this invention can effectively capture the long-term correlations of wave data, whether at finer or coarser scales—that is, between adjacent nodes within the same scale.
[0077] In the tree attention mechanism, the l-th node at scale s It does not focus on all other nodes in the tree, but only on nodes that are at the same scale. Child nodes are adjacent nodes at a finer scale. And the parent node, i.e., the adjacent node at a coarser scale. For nodes at the same scale, we define their processable neighbor number as T, and then...
[0078]
[0079] Then it is at the node The attention output at point can be represented as
[0080]
[0081] in For nodes The set of points of interest is represented as
[0082]
[0083] For the number of nodes L at scale s (s) have
[0084]
[0085] And for nodes Its dot product D (s) It can be divided into scale range and between scales Two parts: the intra-scale dot product number is less than or equal to the number of neighboring nodes T that it can handle; the inter-scale dot product number is less than or equal to the number of finer points C that the coarser node can handle plus one. That is...
[0086]
[0087] Then the total dot product D has
[0088]
[0089] Therefore, the time complexity is O(D).
[0090]
[0091] As the input length L increases, the time complexity O(D) can be directly regarded as O(L), so the tree attention module can reduce the complexity of the model accordingly.
[0092] Step 2.5: Since the tree attention mechanism in Step 2.4 aims to capture the long-term correlation of long input sequences, directly performing tree attention operations would lead to continuous stacking of the encoder and decoder, resulting in a continuous increase in model memory usage and time efficiency issues. Therefore, a self-attention distillation operation is performed after each tree attention block. The self-attention distillation mechanism generates key features by processing the dominant features with primary characteristics, assigning them higher weights, and pruning the temporal dimension, thus allowing the encoder to process longer input sequences.
[0093] The encoder contains multiple tree attention blocks, each with half the dimensionality of the previous one. After passing through each tree attention block, the code proceeds through a one-dimensional convolutional layer, an ELU activation layer, and a max-pooling layer with a stride of 2, as shown in the formula.
[0094]
[0095] MaxPool is the max pooling layer, ELU is the function activation layer, and Conv1d is the one-dimensional convolutional layer. and This represents the outputs of layers j and j+1 in the distillation module. This indicates that the output of the j-th layer in the distillation module is passed through a tree attention block. To enhance the robustness of the model, we design a stacked structure with multiple layers. The input of each layer is half of the input of the layer above it, and one layer of distillation operations is discarded compared to the previous layer to align its output dimensions. In this way, each layer will obtain a feature map. We concatenate the feature maps obtained from each stacked structure to obtain the final output of the encoder.
[0096] 3. Build the decoder module
[0097] The decoder section uses a standard decoder structure, consisting of a masked multi-head tree attention layer and a multi-head tree self-attention layer. Traditional long-term prediction methods stack two identical multi-head attention layers in the decoder structure, performing iterative prediction. However, this prediction method causes subsequent predictions to depend on the prediction results of previous time steps, leading to efficiency issues. This decoder section employs a generative operation, obtaining the prediction result in one step from the input vector shown below:
[0098]
[0099] Concat represents merging joins. It is the starting sequence segment, which can be dynamically sampled from the input sequence close to the prediction target; while The timestamps of the predicted sequence can be viewed as a zero matrix with the same prediction duration. The concatenated result is then encoded using features and input into the decoder for decoding. This eliminates the need for dynamic decoding, employing a single forward pass through a fully connected layer to obtain the entire output sequence, thus solving the efficiency problem.
[0100] 4. Utilize evaluation index measurement models
[0101] The output sequence generated by the decoder is processed with the corresponding observation data to obtain two indicators: mean squared error and mean absolute error. These two indicators reflect the quality of the model's prediction performance. By comparing these two indicators simultaneously with the increase in the length of the wave sequence input to the model and the prediction duration, it can be seen that the designed tree attention-based long-term wave prediction method can maintain the error at a normal level and effectively improve the performance of long-term wave prediction.
[0102] Figure 2 This is a comparison curve of the prediction results of the present invention, from Figure 2As can be seen, this invention introduces a tree attention mechanism through a tree generation structure to capture the long-term correlation of wave sequences between different scales and the same scale, and performs a self-attention distillation operation in the decoder structure to solve the stacking problem. The prediction effect of wave sequences is much better than the other two wave sequence prediction models.
[0103] The embodiments described above are merely illustrative of the implementation methods of the present invention, but should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the protection scope of the present invention.
Claims
1. A long-term wave prediction method based on tree attention, characterized in that, Includes the following steps: Step (1) First, the original wave sequence data is preprocessed to remove abnormal data and perform correlation statistics to identify several variables that are strongly correlated with the wave height data, and then a new wave sequence is reconstructed; the original wave sequence is the original observation data of the observation area in the past. Step (2) involves encoding the new wave sequence obtained after preprocessing in step (1) with local and global timestamps, inputting it into the tree generation module to generate an attention tree. The tree attention mechanism is used to capture the long-term correlation between different scales and the same scale in the preprocessed new wave sequence. The self-attention distillation module is used to reduce the feature dimension of the preprocessed new wave sequence and obtain a feature map, enabling the encoder to process longer input sequences, thereby solving the stacking problem of the transformer prediction method. The specific steps (2) are as follows: Step 2.1: Before inputting the encoder module, the new wave sequence is feature-encoded using local and global timestamps to obtain the feed vector; Step 2.2: Input the feature-encoded feed vector into the tree generation module to generate the attention tree; The tree generation module is a bottleneck structure consisting of 5 convolutional modules; this structure replaces large-size convolutions with multiple small-size convolutions; the input dimension is set to... B is , The length of the input sequence, i.e., the new wave sequence. Let the dimension be the node; first, it passes through an intermediate dimension. of The convolutional layer transforms the dimension to Then, it is passed through three convolutional modules with kernel size H and stride H; finally, it is passed through a dimension of of The convolutional layers are restored to their original scale; Parameter quantity after adopting bottleneck structure It then becomes: in, and Each is a fixed intermediate dimension and kernel size ; Step 2.3: In the convolution process described in Step 2.2, after each convolutional module, a time-dimension vector of length is generated. The sequence, where For sequence length, The kernel size is [size]. For the current scale, a total of 4 scales generate 4 sequences; the tree generation module defines the sequence generated at the initial scale as the coarse sequence and the sequence generated at the final scale as the fine sequence. Before inputting these coarse to fine sequences into the encoder, the tree generation module uses a residual structure to connect the above 4 sequences from coarse to fine, thereby forming a multi-dimensional tree from the obtained sequences at different scales. Step 2.4: The tree attention mechanism is based on the tree generation module. It obtains the long-term correlation of time by continuously interacting and passing messages between different scales and within the same scale. For the connection between different scales, it is a multi-dimensional tree generated by the tree generation module. The tree nodes are arranged from top to bottom in a coarse to fine order. Each parent node has multiple child nodes. Therefore, whether at a finer scale or a coarser scale, i.e., between adjacent nodes within the same scale, the long-term correlation of wave data can be effectively captured. Step 2.5: Since the tree attention mechanism in Step 2.4 aims to capture the long-term correlation of long sequence inputs, a self-attention distillation operation is performed after each tree attention block. The self-attention distillation mechanism generates key features by performing feature processing on the dominant features with the main features, assigning higher weights, and pruning the time dimension to generate key features, thereby allowing the encoder to process longer sequence inputs. The encoder contains multiple tree attention blocks, each with half the dimensionality of the previous one. After passing through each tree attention block, the input layer passes through a one-dimensional convolutional layer, an ELU activation layer, and a max pooling layer with a stride of 2, as shown in the formula: in, For max pooling layer, For function activation layer, It is a one-dimensional convolutional layer. and Indicates the first in the distillation module and The output of the layer, This indicates that the first [unit] in the distillation module will be [distilled / distilled]. The layer's output passes through a tree attention block; Design a stacked structure with multiple layers, where the input of each layer is half of the input of the layer above, and a distillation operation is discarded compared to the layer above to align the output dimensions; in this way, each layer will obtain a feature map, and the feature maps obtained from each stacked structure are concatenated to obtain the final output of the encoder; Step (3): Input the feature map and new wave sequence generated by the attention distillation module in step (2) into the generative decoder module to perform univariate or multivariate prediction. That is, there is no need to perform layer-by-layer iterative prediction results, and the prediction results under different prediction durations can be obtained directly. Step (4) uses the evaluation index to measure the model. The designed wave long-term prediction method based on tree attention can maintain the error at a normal level and effectively improve the wave long-term prediction performance.
2. The wave long-term prediction method based on tree attention according to claim 1, characterized in that, The specific steps (1) are as follows: Step 1.1: Select observation data from the observation station over a certain period of time, including wave height and various variables related to wave height; then organize the data, and determine whether the data in each column is missing based on whether the number of unobserved data in each column exceeds 90% of the total number of data in that column. If it exceeds 90%, it is considered missing data and is deleted. Missing data in columns that do not exceed 90% are filled using the average value or interpolation method. Step 1.2: Perform correlation statistics on the wave sequence obtained in Step 1.1 after preliminary processing to obtain several variables that are strongly correlated with the wave height variable; Step 1.3: Remove all variables from the original wave sequence except for the highly correlated variables and wave height variable obtained in Step 1.2, and reconstruct it into a new wave sequence.
3. The wave long-term prediction method based on tree attention according to claim 1, characterized in that, In step 2.4 of the tree attention mechanism, the scale is defined. The first node It does not focus on all other nodes in the tree, but only on nodes that are at the same scale. Child nodes are adjacent nodes at a finer scale. And the parent node, i.e., the adjacent node at a coarser scale. For nodes at the same scale, the number of their processable neighboring nodes is defined as follows: ,have: definition For nodes The set of points of interest is represented as: Then it is at the node The attention output at point can be represented as Next, a complexity analysis is performed; for the number of nodes at scale s... have: And for nodes Its dot product It can be divided into scale range and between scales Two parts: the dot product number within the scale is less than or equal to the number of neighboring nodes it can process. The number of dot products between scales is less than or equal to the number of finer points that can be processed by coarser nodes. Add one; that is Then by Get the total dot product have: Therefore, the time complexity is O(D). With input length As the time complexity continues to increase, It can be directly regarded as Therefore, the tree attention module can reduce the complexity of the model.
4. The wave long-term prediction method based on tree attention according to claim 1, characterized in that, The specific steps (3) are as follows: The decoder part employs a generative operation, meaning it obtains the prediction result in one step from the input vector shown below: in Indicates a merge join. It is the starting sequence segment, which can be dynamically sampled from the input sequence close to the prediction target; while It is the timestamp of the predicted sequence, which can be regarded as a zero matrix with the same prediction duration; The concatenated result is then encoded using features and input into the decoder for decoding.
Citation Information
Patent Citations
Long-time sequence prediction method and storage medium
CN116090619A
Query optimization method based on tree attention and cardinality perception and storage medium
CN116483863A