Time series prediction | MATLAB implements CNN-BiLSTM (convolutional bidirectional long short-term memory neural network) time series prediction

Time series prediction | MATLAB implements CNN-BiLSTM (convolutional bidirectional long short-term memory neural network) time series prediction

List of effects

1
2
3
4

basic introduction

Time series dataset, build a hybrid model (CNN-BiLSTM) based on Convolutional Neural Network (CNN) and Bidirectional Long Short-Term Memory (BiLSTM) for yield estimation, improve the time dimension and Feature extraction capability in terms of spatial dimensions.

Model structure

5

  • In the convolution layer, the size of the convolution kernel is 3×3, the number is 16, the convolution stride is 1, the edge filling method is SAME, and the activation function is ReLU. The second part of the CNN structure is the pooling layer, which performs feature dimension reduction, removes redundant features, and improves the fault tolerance of the CNN structure. In the pooling layer, the sampling mode is max pooling, the size of the convolution kernel is 2×2, the number is 16, and the convolution stride is 2. After the spatial feature extraction is completed, the feature vectors obtained by the three CNN modules are input into the BiLSTM network.
  • The main hidden layer structure of BiLSTM network is composed of LSTM network with forward input operation and LSTM network with reverse input operation on the basis of LSTM network. While retaining the structural characteristics of LSTM units, it pays more attention to the front and back of time series data Correlation ensures the extraction of time series features.
  • Explore the best temporal feature extraction mode by continuously adjusting the number of BiLSTM hidden layers. The hidden layer includes 3 output nodes, corresponding to the feature outputs of the three growth stages of cotton seedling stage, bud stage and flowering stage. The output module of the CNN-BiLSTM model is composed of a fully connected neural network. The network input vector contains the spatial features extracted by CNN and the time series features extracted by the BiLSTM network. The number of hidden layers is 1, the number of neurons is 500, and the activation function is ReLU. The final output is the estimated yield result.

programming

  • Complete program private letter blogger.
ratio = 0.9;
% 批处理样本
MiniBatchSize =24;
% 最大迭代次数
MaxEpochs = 60;
% 学习率
learningrate = 0.005;
%% 加载数据
load data;
data = [data{
    
    :}];
%% 在训练和测试中划分顺序
% 在训练和测试中拆分数据。 
% 90%的数据用于训练,而10%的数据用于测试。 
numStepsTraining = round(ratio*numel(data));
indexTrain = 1:numStepsTraining;
dataTrain = data(indexTrain );
indexTest = numStepsTraining+1:size(data,2);
dataTest  = data(indexTest);
————————————————
版权声明:本文为CSDN博主「机器学习之心」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

learning summary

This study builds a CNN-BiLSTM hybrid model based on a Convolutional Neural Network (CNN) and a Bidirectional Long Short-Term Memory (BiLSTM) network. The Long Short-Term Memory Network Hybrid Model (CNN-BiLSTM) can extract more time series features at the same time, and has advantages in researching problems with a certain time span.

References

[1] https://blog.csdn.net/kjm13182345320/article/details/126805183
[2] https://blog.csdn.net/kjm13182345320/article/details/126239947
[3] https://blog.csdn .net/kjm13182345320/article/details/124147752
[4] https://blog.csdn.net/kjm13182345320/article/details/120377303

Guess you like

Origin blog.csdn.net/kjm13182345320/article/details/127261869