多输入多输出 | MATLAB实现CNN-BiGRU卷积双向门控循环单元多输入多输出

多输入多输出 | MATLAB实现CNN-BiGRU卷积双向门控循环单元多输入多输出

预测效果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

基本介绍

MATLAB实现CNN-BiGRU卷积双向门控循环单元多输入多输出,运行环境Matlab2020及以上。采用特征融合的方法,通过卷积网络提取出浅层特征与深层特征并进行联接,对特征通过卷积进行融合,将获得的矢量信息输入BiGRU单元。
Matlab实现CNN-BiGRU卷积双向门控循环单元多输入多输出预测
1.data为数据集,10个输入特征,3个输出变量。
2.MainCNN_BiGRUNM.m为主程序文件,运行环境Matlab2020b及以上。
3.命令窗口输出MAE、MBE和R2,可在下载区获取数据和程序内容。

程序设计

  • 完整程序和数据下载方式:私信博主回复MATLAB实现CNN-BiGRU卷积双向门控循环单元多输入多输出
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%%
% 层设置,参数设置
inputSize = size(xnorm{
    
    1},1);   %数据输入x的特征维度
outputSize = size(ynorm,2);     %数据输出y的维度  
numhidden_units1=50;            %网络单元
numhidden_units2= 20;
numhidden_units3=100;
%%
% gru
————————————————
版权声明:本文为CSDN博主「机器学习之心」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/kjm13182345320/article/details/127418340
%%  参数设置
options = trainingOptions('adam', ...       % Adam 梯度下降算法
    'MiniBatchSize', 100, ...               % 批大小
    'MaxEpochs', 1000, ...                  % 最大迭代次数
    'InitialLearnRate', 1e-2, ...           % 初始学习率
    'LearnRateSchedule', 'piecewise', ...   % 学习率下降
    'LearnRateDropFactor', 0.1, ...         % 学习率下降因子
    'LearnRateDropPeriod', 700, ...         % 经过700次训练后 学习率为 0.01 * 0.1
    'Shuffle', 'every-epoch', ...           % 每次训练打乱数据集
    'ValidationPatience', Inf, ...          % 关闭验证
    'Plots', 'training-progress', ...       % 画出曲线
    'Verbose', false);
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%%  训练模型
net = trainNetwork(p_train, t_train, layers, options);
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%%  仿真预测
t_sim1 = predict(net, p_train); 
t_sim2 = predict(net, p_test ); 

往期精彩

MATLAB实现RBF径向基神经网络多输入多输出预测
MATLAB实现BP神经网络多输入多输出预测
MATLAB实现DNN神经网络多输入多输出预测

参考资料

[1] https://blog.csdn.net/kjm13182345320/article/details/116377961
[2] https://blog.csdn.net/kjm13182345320/article/details/127931217
[3] https://blog.csdn.net/kjm13182345320/article/details/127894261

猜你喜欢

转载自blog.csdn.net/kjm13182345320/article/details/132945547