爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5351|回复: 0

[程序设计] lstm模型每次输出结果不一致

[复制链接]

新浪微博达人勋

发表于 2022-3-29 17:49:31 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
各位大佬,我用lstm模型进行预测是,发现每次输出的结果都不一样,而且输出的曲线是平滑的(图1),输入的数据并不是平滑曲线,这要怎么解决。代码如下:
%% trainoption(lstm)
opts = trainingOptions('adam', ...                %
    'MaxEpochs',200, ...
    'GradientThreshold',1,...
    'ExecutionEnvironment','cpu',...
    'InitialLearnRate',0.001, ...
    'LearnRateSchedule','piecewise', ...
    'LearnRateDropPeriod',100, ...                % epoch后学习率更新
    'LearnRateDropFactor',0.8, ...
    'Verbose',0, ...
    'Plots','training-progress'...
    );

%% LSTM网络训练
tic
LSTMnet = trainNetwork(inputn_train ,outputn_train ,layers,opts);
toc;
[LSTMnet,LSTMoutputr_train]= predictAndUpdateState(LSTMnet,inputn_train);
LSTMoutput_train = mapminmax('reverse',LSTMoutputr_train,outputps);
%% LSTM测试数据
%%
%网络测试输出
[LSTMnet,LSTMoutputr_test] = predictAndUpdateState(LSTMnet,inputn_test);
%网络输出反归一化
LSTMoutput_test= mapminmax('reverse',LSTMoutputr_test,outputps);

图1

图1
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表