A method for generating spatiotemporal data of ocean temperature field based on the separation attention mechanism
By replacing the convolution operator with a separate attention mechanism and a self-attention mechanism, and combining it with a teacher forcing mechanism, the problem of insufficient capture of spatiotemporal dependencies in the generation of marine environmental data in existing models is solved, achieving faster training speed and more accurate generation of marine temperature field data.
Patent Information
- Application Number
- CN202310900245.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-07-23
- Filing Date
- 2023-07-21
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-07-21
AI Technical Summary
Existing neural network models struggle to capture the complex dynamics and interactions of marine environmental parameters at different times and in different regions, resulting in inaccurate marine environmental data generation, especially during seasonal transitions.
We employ a method for generating spatiotemporal ocean temperature field data based on a separate attention mechanism. By replacing the convolution operator in the traditional model with a separate attention mechanism, and combining a self-attention mechanism and a modified teacher forcing mechanism, we can capture long-range spatiotemporal dependencies, thereby achieving faster training speed and more accurate data generation.
It achieves accurate generation of ocean temperature field data, avoids information loss, has faster training speed and stronger prediction performance, and can generate data for longer periods with limited computing resources and time.
Smart Images

Figure CN117251645B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine spatiotemporal data generation technology, and more specifically to a method for generating marine temperature field spatiotemporal data based on a separation attention mechanism. Background Technology
[0002] As a major component of the environment, the ocean has a profound impact on climate change and economic development, making the need for virtual environment modeling of the ocean increasingly urgent. The generation of spatiotemporal environmental data is generally considered a crucial step in virtual environment modeling, as it is essentially a multivariate time series problem.
[0003] Existing neural network models have shown good performance for specific environmental parameters, but due to the difficulty in considering global spatial information at all times, they are unable to capture the complex dynamics and interactions between environmental parameters at different times and in different regions, which is insufficient for the accurate generation of environmental data, especially during seasonal transitions.
[0004] Therefore, how to provide a method for generating spatiotemporal data of ocean temperature field based on the separation attention mechanism to overcome the limitations of existing methods in capturing the long-range dependence of environmental parameters in time and space and to achieve accurate generation of ocean environmental variables has become an urgent problem for those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method for generating spatiotemporal ocean temperature field data based on a separate attention mechanism, which can better capture long-range spatiotemporal dependencies, has a faster training speed than traditional models based on CNN and RNN such as Conv-TT-LSTM, and can achieve the generation of ocean temperature field data with longer periods under limited computing resources and training time.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A method for generating spatiotemporal data of ocean temperature fields based on a separation attention mechanism includes the following steps:
[0008] Acquire ocean temperature field data;
[0009] Based on the ocean temperature field data, a pre-trained ocean temperature field prediction model is used to make predictions, and the ocean temperature field prediction results are obtained.
[0010] The training steps for the ocean temperature field prediction model include:
[0011] The ocean temperature field data is preprocessed; the preprocessed results are sequentially encoded using a separate attention mechanism and decoded based on Ground Truth data frames; the decoded data is then summarized to output the ocean temperature field prediction results.
[0012] Furthermore, the preprocessing step includes:
[0013] Based on the ocean temperature field data, sliding window sampling is performed to generate multiple sets of data frames; these multiple sets of data frames span the entire time domain of the ocean data.
[0014] Each data frame is decomposed to generate multiple non-overlapping first data blocks, which span the entire spatial domain of the data frame.
[0015] Spatiotemporal location encoding and layer standardization are performed on multiple non-overlapping first data blocks.
[0016] Furthermore, spatiotemporal location encoding is performed on the multiple non-overlapping first data blocks, the steps of which include:
[0017] Flatten the non-overlapping data blocks into vectors Where p = 1, ..., N represents spatial location, and t = 1, ..., F represents time index;
[0018] Through learnable matrices Each vector Mapping to an embedding vector:
[0019]
[0020] in, This represents a learnable positional embedding.
[0021] Furthermore, the preprocessing result is encoded using a separate attention mechanism, the steps of which include:
[0022] The preprocessing result of each first data block is subjected to multiple progressive encodings. In each encoding process, the q / k / v vector is calculated for each first data block based on the previous layer normalization encoding result.
[0023] Calculate time feedback based on the time attention coefficient;
[0024] Based on the results of the time feedback, spatial attention is calculated to obtain spatial attention coefficients and spatial attention vectors.
[0025] The spatial attention vector is residually concatenated with the previous layer normalized coding result and then input into the multilayer perceptron. After another residual concatenation, the coding result is obtained.
[0026] Furthermore, the formula for calculating the time attention coefficient is as follows:
[0027]
[0028] Based on the aforementioned time attention, time feedback is calculated, and the steps include:
[0029] Calculate the output vector for each attention head based on the aforementioned temporal attention coefficient:
[0030]
[0031] The output vectors from all attention heads are concatenated and projected to obtain the time feedback:
[0032]
[0033] Furthermore, the spatial attention vector is residually concatenated with the previous layer-normalized coding result, and then layer-normalized before being input into the multilayer perceptron to calculate the coding result. At this point, the output of coding block l is the layer-normalized coding result.
[0034] The residual connection formula is:
[0035] The encoding result is:
[0036] Furthermore, a separate attention mechanism is used for decoding, the steps of which include:
[0037] Construct a first attention calculation module and a second attention calculation module;
[0038] The final encoding result of obtaining the spatiotemporal data of sea surface temperature at all historical moments is then extracted after layer standardization.
[0039] The layer-normalized spatiotemporal position coding result of the data frame at the last moment is used as the start signal and input into the second attention module. Temporal attention and spatial attention are calculated sequentially to obtain the query value of the first attention module at the first moment.
[0040] Based on the query value of the first attention module at the first moment and the extracted key and value values, the first attention calculation module sequentially calculates temporal attention and spatial attention to obtain the data frame at the first moment.
[0041] Based on the start signal and the data frame at the first moment, the second attention calculation module sequentially calculates temporal attention and spatial attention to obtain the query value at the second moment.
[0042] Based on the query value of the first attention module at the second time point and the extracted key and value values, the first attention calculation module sequentially calculates temporal attention and spatial attention to obtain the data frame at the second time point.
[0043] Repeat this process until all data frames have been decoded.
[0044] Furthermore, decoding is performed using a separate attention mechanism, and the steps also include:
[0045] The target dataset is acquired and a sliding window sampling is performed on the target dataset to obtain multiple sets of Ground Truth data frames;
[0046] The unfolding operation expands each GroundTruth data frame in the GroundTruth data frame group corresponding to the current task to generate multiple non-overlapping second data blocks.
[0047] All the second data blocks obtained by decomposing the Ground Truth data frame are input into the second attention calculation module for decoding.
[0048] Furthermore, after obtaining the data frame at the first moment, a modified teacher forcing mechanism is used to control the input to the second attention module, including:
[0049] Teacher forcing employs a mask control that follows a Bernoulli distribution to manage the input at the next time step. Specifically, the data frames output from the previous time step are first randomly replaced with the Ground Truth data frames according to a preset replacement probability. Then, all data frames required for generating the next time step are processed through expansion, spatiotemporal location encoding, and layer normalization before being input into the second attention calculation module. As training progresses, the replacement probability gradually decreases.
[0050] Furthermore, the step of summarizing the decoded data is as follows: the decoded data is dimensionally transformed and folded using a linear layer.
[0051] The beneficial effects of this invention are:
[0052] As can be seen from the above technical solution, compared with the prior art, this invention discloses a method for generating spatiotemporal data of ocean temperature field based on a separate attention mechanism. It replaces the convolution operator in the traditional model with a separate attention mechanism, which can apply less inductive bias. Secondly, by directly comparing the feature activations of all spatiotemporal locations, a self-attention mechanism can be applied to capture global long-range spatiotemporal dependencies. This far exceeds the receptive field of traditional convolutional filters, avoiding the problem of information loss due to excessive information length when using RNNs. That is, the self-attention mechanism can obtain a receptive field covering the complete spatial and temporal window, which is difficult for traditional models based on CNNs and RNNs to achieve. Therefore, this invention has a significant advantage in capturing long-range spatiotemporal dependencies, enabling it to accurately complete the task of generating spatiotemporal data of sea surface temperature. However, due to the high inductive bias, the expressive power of convolution operators is limited, and models based on convolution operators may exhibit significant prediction biases, such as accurate predictions of cooling temperatures but poor performance when temperatures are warming. This invention replaces the convolution operator with an attention mechanism, which has a smaller inductive bias and achieves unbiased prediction of hot and cold events to a certain extent. Finally, this invention introduces a modified teacher forcing mechanism and performs parallel training, thus having a faster training speed than traditional models, which helps to build a model with stronger performance under the same computing resources and limited training time. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0054] Figure 1 The attached figure is a schematic diagram of a method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism provided by the present invention.
[0055] Figure 2 The attached figure is a schematic diagram of the identification model structure in this invention. Detailed Implementation
[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] like Figure 1 and Figure 2 This invention discloses a method for generating spatiotemporal data of ocean temperature fields based on a separation attention mechanism, comprising the following steps:
[0058] S1: Acquire ocean temperature field data;
[0059] S2: Based on ocean temperature field data, a pre-trained ocean temperature field prediction model is used to make predictions and obtain ocean temperature field prediction results;
[0060] The training steps for the ocean temperature field prediction model include:
[0061] S21: Preprocess the ocean temperature field data to obtain the preprocessed layer-normalized spatiotemporal location code;
[0062] S211: Sample and decompose the spatiotemporal data of ocean temperature to obtain a non-overlapping first data block with spatial location information and time index;
[0063] Based on ocean temperature field data, sliding window sampling is performed to generate multiple sets of data frames. These multiple sets of data frames span the entire time domain of the ocean data. Ocean data over a period of time is treated as a video, and the spatial distribution of ocean data is regarded as the distribution of image pixels at a certain moment. F data frames of size H×W obtained from the dataset through sliding window sampling are used as input.
[0064] Each data frame is decomposed into multiple non-overlapping first data blocks, which span the entire spatial domain of the data frame. The function of `unfold` is to decompose each data frame into N non-overlapping data block patches of size P×P, so that the N patches span the entire spatial domain of the data frame, where N = HW / P. 2 We flatten these small blocks into vectors. Where p = 1, ..., N represents spatial location, and t = 1, ..., F represents time index.
[0065] S212: Perform spatiotemporal location coding and layer normalization on all non-overlapping first data blocks obtained from the decomposition of historical data frames.
[0066] Through learnable matrices Each patch Mapping to an embedding vector:
[0067]
[0068] in, This represents a learnable location embedding, used to encode the spatiotemporal location of each patch. Finally, the layer-normalized spatiotemporal location encoding result can be represented as...
[0069] S22: The spatiotemporal location coding results of the layer normalization are encoded and then decoded using a separate attention mechanism;
[0070] S221: A separate attention mechanism is used to encode the spatiotemporal location encoding results of the layer normalization: temporal attention and spatial attention are applied to ocean data respectively, which can significantly reduce the amount of computation and improve the efficiency of the model.
[0071] S2211: Progressive coding based on spatiotemporal location coding. In each coding process, the q / k / v vector is calculated for each data block according to the result of the previous layer normalization coding.
[0072] In one embodiment, encoding is performed using L coding blocks, with each block taking the output of the previous block as input. Deep feature extraction from spatiotemporal data can be achieved by stacking multiple coding blocks. Within each coding block l, the layer-normalized coding result of the previous block is used... Calculate the q / k / v vector for each patch:
[0073]
[0074] Where LN() represents LayerNorm, a = 1,...,A is the index of multiple attention heads, and A is the total number of attention heads. The latent dimension of each attention head is set to D. h =D / A.
[0075] S2212: In each encoding process, take data blocks in the same space from multiple data frames to calculate temporal attention and obtain the temporal attention coefficient.
[0076] SM() is the softmax activation function.
[0077] S2213: Calculate time feedback based on time considerations:
[0078] Calculate the output vector for each attention head based on the temporal attention coefficient:
[0079]
[0080] Concatenate and project the output vectors from all attention heads to obtain the time feedback:
[0081]
[0082] S2214: Time Feedback It was used for spatial attention calculations; incorrect. Perform layer standardization, from The new q / k / v vectors are obtained directly from the calculation, and then spatial attention is calculated. When attention is computed only in one dimension, such as spatially or temporally, the computational cost is significantly reduced. For example, in the case of spatial attention, using a key from the same frame as the query requires only N query-key comparisons.
[0083]
[0084] S2215: The resulting vector The layer-normalized coding result of the previous coding block is passed through a residual concatenation and then through layer-normalization before being fed into a multilayer perceptron (MLP). The output of the MLP is then residually concatenated with its input to calculate the coding result of patch l in coding block. At this point, the output of coded block l is the encoded result after layer normalization.
[0085] At this point, all the input feature information is extracted by the Encoder and compressed into the last hidden layer.
[0086] The residual connection formula is as follows:
[0087] The formula for calculating the encoding result is:
[0088] S222: Decoding is performed using a separate attention mechanism, with the following specific steps:
[0089] S2221: Construct a first attention calculation module and a second attention calculation module; and construct a residual connection and a layer normalization layer after each attention calculation module to calculate the final output of each attention calculation module; construct an MLP layer and a residual connection and layer normalization layer to output the decoding result.
[0090] S2222: Obtain the final encoding result of layer normalization of sea surface temperature spatiotemporal data for all historical moments, and extract the Value and Key values;
[0091] The spatiotemporal location encoding result of the last historical data frame is used as the start signal input into the second attention module, and temporal attention and spatial attention are calculated in sequence to obtain the query value of the first attention module.
[0092] S2223: Based on the query value and extracted Key and Value values of the first attention module at the first moment, the first attention calculation module sequentially calculates temporal attention and spatial attention to obtain the data frame at the first moment;
[0093] S2224: Based on the start signal and the data frame at the first moment, the second attention calculation module sequentially calculates temporal attention and spatial attention to obtain the query value at the second moment;
[0094] S2225: Based on the query value and extracted Key and Value values of the first attention module at the second time step, the first attention calculation module sequentially calculates temporal attention and spatial attention to obtain the data frame at the second time step;
[0095] S2226: Repeat the process until all data frames at all times are decoded. During the cyclic decoding process, the Value and Key values used in step S2223 are derived from the final encoding results of the layer normalization of the historical time of the current task, and the query value is obtained by calculating the data frame decoding results before the current time using step S2224.
[0096] In one embodiment, the training speed and convergence speed of the model are improved by using the target dataset: before being input to the second attention calculation module, the target dataset is processed by the input module as follows;
[0097] The target dataset is acquired and a sliding window sampling is performed on the target dataset to obtain multiple sets of Ground Truth data frames;
[0098] The unfold operation decomposes each GroundTruth data frame in the GroundTruth data frame group corresponding to the current task into multiple non-overlapping second data blocks.
[0099] All second data blocks obtained from the decomposition of the Ground Truth data frame are input into the second attention calculation module for decoding.
[0100] In this embodiment, after obtaining the data frame at the first time step, a modified teacher forcing mechanism is used to control the input of the second attention module. Teacher forcing uses a mask that follows a Bernoulli distribution to control the input of the next time step. That is, the data frame output at the previous time step is first randomly replaced with a Ground Truth data frame according to a preset replacement probability. Then, all the data frames required for generating the data at the next time step are processed by unfolding, spatiotemporal location encoding, and layer normalization before being input into the second attention calculation module. As the training process progresses, the replacement probability gradually decreases. In the prediction process, the decoding process of the model is similar to the training process. The difference is that the input at each time step in the prediction process depends entirely on the output of the previous time step, and the Ground Truth is no longer involved. During parallel training, the data of all time steps are input at once, and the data of the current time step and subsequent time steps are masked using a mask. For each time step, it is possible to use the output of the previous time step as the input, or it is possible to use data that contains part of the output of the previous time step and part of the target value corresponding to the previous time step as the input. Specifically, during parallel training, the prediction results at each time step are first obtained by decoding historical data frames, the final encoding results of layer normalization, and Ground Truth data frames. Then, the prediction results at each time step are randomly replaced with their corresponding Ground Truth data frames according to the probability that changes with the training process through modified teacher forcing. Next, a new input sequence is constructed and the data required for predicting each time step is generated through Mask. Finally, the prediction values at each time step are generated synchronously.
[0101] Taking the task of generating three days of future data based on three days of historical data as an example, we define the historical data frames for days one to three as S1, S2, and S3, and the true values for the data frames for days four to six as K4, K5, and K6, respectively. During parallel training: First, S1, S2, and S3 are input to the encoder to calculate the final encoding result after layer normalization. Then, S3, K4, and K5 are simultaneously input to the decoder to calculate the predicted values P4, P5, and P6 for the data frames from days four to six based on the final encoding result after layer normalization. Next, using modified teacherforcing, the predicted results for each day are randomly replaced with their corresponding Ground Truth data frames according to probabilities that change with the training process, constructing new inputs such as S3, P4, and K5. Finally, a mask is used to generate the data needed to predict each day, such as the data S3 needed to predict day four, the data S3 and P4 needed to predict day five, and the data S3, P4, and K5 needed to predict day six.
[0102] S23: Summarize the decoded data and output the ocean temperature field prediction results; compare the prediction results with the target value to calculate the loss and gradient, and use backpropagation of the gradient to adjust the learnable parameters until the loss tends to stabilize with the number of training times, at which point the training is complete.
[0103] During training and prediction, after performing dimensionality transformation on the decoded data using a linear layer, the sea surface temperature data for multiple future moments can be obtained through the unfold operation.
[0104] This invention adopts an editor-decoder framework design, which consists of four parts: an input module, an output module, an encoder, and a decoder.
[0105] The input module includes an unfold layer, an embedding layer, a position encoder, and a layer normalization layer for historical data frames, as well as a teacher forcing layer, an unfold layer, an embedding layer, a position encoder, and a layer normalization layer for the target data frame.
[0106] The historical data frame unfold layer decomposes each data frame of the historical ocean temperature field into multiple non-overlapping first data blocks; the embedding layer embeds features into all non-overlapping first data blocks, and the position encoder encodes the spatiotemporal position of all non-overlapping first data blocks; the layer normalization layer normalizes the spatiotemporally encoded data blocks and inputs them into the encoder.
[0107] The unfold layer decomposes each Ground Truth data frame into multiple non-overlapping second data blocks; the embedding layer embeds features into all non-overlapping second data blocks, and the position encoder performs spatiotemporal position encoding on all non-overlapping second data blocks; the layer normalization layer normalizes the encoded data blocks before inputting them into the decoder. The teacher forcing layer of the target data frame uses a mask that follows a Bernoulli distribution to control the input amount at the next time step.
[0108] The encoder is composed of multiple stacked coding modules. Each coding block consists of two sub-layer connection structures. The first sub-layer connection structure includes a multi-head separation self-attention layer, a layer normalization layer, and a residual connection. The second sub-layer connection structure includes a feedforward fully connected sub-layer, a layer normalization layer, and a residual connection.
[0109] The decoder is composed of multiple stacked decoding blocks. Each decoding block consists of three sub-layer connection structures. The first sub-layer connection structure includes a multi-head separation self-attention layer, a layer normalization layer, and a residual connection. The second sub-layer connection structure includes a multi-head separation attention layer, a layer normalization layer, and a residual connection. The third sub-layer connection structure includes a feedforward fully connected sub-layer, a layer normalization layer, and a residual connection. The decoder outputs multiple spatial representations of ocean data at multiple future time points.
[0110] The output module performs dimensionality transformation on the decoded results using a linear layer, and then obtains ocean data for multiple future time points through a fold operation.
[0111] This invention employs separate attention to replace recurrent neural networks (RNNs) and convolutional operators (CNNs) in both the encoder and decoder to capture spatiotemporal dependent information. This avoids the information loss problem caused by excessive information length when using RNNs, achieving a wider spatial information reception domain than traditional convolutional filters. The separate attention mechanism is a type of multi-head attention; by forming multiple subspaces, it allows the model to attend to various different types of information. Compared to traditional models based on CNNs and RNNs, this invention considers the spatially non-local and more temporally continuous spatiotemporal structural evolution characteristics. By fully extracting spatiotemporal structural information using the attention mechanism, the spatiotemporal evolution of sea surface temperature can be simulated more accurately.
[0112] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0113] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating spatiotemporal data of ocean temperature fields based on a separation attention mechanism, characterized in that, Includes the following steps: Acquire ocean temperature field data; Based on the ocean temperature field data, a pre-trained ocean temperature field prediction model is used to make predictions, and the ocean temperature field prediction results are obtained. The training steps for the ocean temperature field prediction model include: The ocean temperature field data is preprocessed; the preprocessing steps include: Based on the ocean temperature field data, sliding window sampling is performed to generate multiple sets of data frames; these multiple sets of data frames span the entire time domain of the ocean data. Each data frame is decomposed to generate multiple non-overlapping first data blocks, which span the entire spatial domain of the data frame. The preprocessed result is encoded and then decoded using a separate attention mechanism. The encoding steps include: performing multiple progressive encodings on the preprocessing results of each first data block; and calculating the q / k / v vector for each first data block based on the layer normalization results of the previous encoding during each encoding process. Calculate time feedback based on the time attention coefficient; Based on the results of the time feedback, spatial attention is calculated to obtain spatial attention coefficients and spatial attention vectors. The previous encoding result is layer-normalized and connected to the spatial attention vector through a first residual connection and then layer-normalized again. The result is then input into a multilayer perceptron and, after a second residual connection, the encoding result is obtained. The next progressive encoding is performed based on the encoding result until the final encoding result is obtained; The decoding steps include: using a separate attention mechanism for decoding, the steps of which include: Construct a first attention calculation module and a second attention calculation module; Obtain the final encoded result of sea surface temperature spatiotemporal data for all historical moments, and extract the Value and Key values after layer standardization; The layer-normalized spatiotemporal position coding result of the data frame at the last moment is used as the start signal and input into the second attention module. Temporal attention and spatial attention are calculated sequentially to obtain the query value of the first attention module at the first moment. Based on the query value and extracted Key and Value values of the first attention module at the first moment, the first attention calculation module sequentially calculates temporal attention and spatial attention to obtain the data frame at the first moment. Based on the start signal and the data frame at the first moment, the second attention calculation module sequentially calculates temporal attention and spatial attention to obtain the query value at the second moment. Based on the query value and extracted Key and Value values of the first attention module at the second time, the first attention calculation module sequentially calculates temporal attention and spatial attention to obtain the data frame at the second time. Repeat this process until all data frames have been decoded; The decoded data is summarized to output the ocean temperature field prediction results.
2. The method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism according to claim 1, characterized in that, Spatiotemporal location encoding is performed on multiple non-overlapping first data blocks, the steps of which include: Flatten the non-overlapping data blocks into vectors Where p = 1, ..., N represents spatial location, and t = 1, ..., F represents time index; Through learnable matrices Each vector Mapping to an embedding vector: in, This represents a learnable positional embedding.
3. The method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism according to claim 1, characterized in that, The formula for calculating the time attention coefficient is as follows: Based on the aforementioned time attention, time feedback is calculated, and the steps include: Calculate the output vector for each attention head based on the aforementioned temporal attention coefficient: The output vectors from all attention heads are concatenated and projected to obtain the time feedback:
4. The method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism according to claim 1, characterized in that, The formulas for calculating the first residual connection and encoding result are as follows: The formula for the first residual connection is: The formula for calculating the encoding result is:
5. The method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism according to claim 1, characterized in that, The steps also include: The target dataset is acquired and a sliding window sampling is performed on the target dataset to obtain multiple sets of Ground Truth data frames; The unfolding operation expands each Ground Truth data frame in the Ground Truth data frame group corresponding to the current task to generate multiple non-overlapping second data blocks. The second data block is encoded in a spatiotemporal location and then normalized by layers before being input into the second attention calculation module for decoding.
6. The method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism according to claim 5, characterized in that, After obtaining the data frame at the first moment, a modified teacher forcing mechanism is used to control the input to the second attention module, including: Teacher forcing uses a mask that follows a Bernoulli distribution to control the input amount at the next time step. The data frame output at the previous time step is randomly replaced with the Ground Truth data frame according to a preset replacement probability for the input at the next time step. All data frames required for the generation of data at the next time step are expanded, spatiotemporally encoded, and layered and then input into the second attention calculation module.
7. The method for generating spatiotemporal data of ocean temperature field based on a separation attention mechanism according to claim 1, characterized in that, The steps for summarizing the decoded data are as follows: perform dimensional transformation and folding on the decoded data using a linear layer.
Citation Information
Patent Citations
Multi-group multi-attention modeling method for video space-time representation learning
CN112101248A
Multi-channel marine observation time sequence scalar data missing value prediction method and system
CN114385619A