国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【LSTM預測】基于自編LSTM神經(jīng)網(wǎng)絡空調能耗數(shù)據(jù)預測含Matlab源碼

2022-05-19 23:44 作者:Matlab工程師  | 我要投稿

1 簡介

基于自編LSTM神經(jīng)網(wǎng)絡實現(xiàn)空調能耗數(shù)據(jù)預測。

2 部分代碼


%% 程序說明% ?1、數(shù)據(jù)為7天,四個時間點的空調功耗,用前三個推測第四個訓練,依次類推。第七天作為檢驗% ?2、LSTM網(wǎng)絡輸入結點為12,輸出結點為4個,隱藏結點18個clear all;clc;%% 數(shù)據(jù)加載,并歸一化處理[train_data,test_data]=LSTM_data_process();data_length=size(train_data,1);data_num=size(train_data,2);%% 網(wǎng)絡參數(shù)初始化% 結點數(shù)設置input_num=12;cell_num=18;output_num=4;% 網(wǎng)絡中門的偏置bias_input_gate=rand(1,cell_num);bias_forget_gate=rand(1,cell_num);bias_output_gate=rand(1,cell_num);% ab=1.2;% bias_input_gate=ones(1,cell_num)/ab; ? ?end ? ?if(Error_Cost(1,iter)<cost_gate) ? ? ? ?break; ? ?endend%% 繪制Error-Cost曲線圖% for n=1:1:iter% ? ? text(n,Error_Cost(1,n),'*');% ? ? axis([0,iter,0,1]);% ? ? title('Error-Cost曲線圖'); ? % endfor n=1:1:iter ? ?semilogy(n,Error_Cost(1,n),'*'); ? ?hold on; ? ?title('Error-Cost曲線圖'); ? end%% 使用第七天數(shù)據(jù)檢驗%數(shù)據(jù)加載test_final=[0.4557 0.4790 0.7019 0.8211 0.4601 0.4811 0.7101 0.8298 0.4612 0.4845 0.7188 0.8312]';test_final=test_final/sqrt(sum(test_final.^2));test_output=test_data(:,4);%前饋m=4;gate=tanh(test_final'*weight_input_x+h_state(:,m-1)'*weight_input_h);input_gate_input=test_final'*weight_inputgate_x+cell_state(:,m-1)'*weight_inputgate_c+bias_input_gate;forget_gate_input=test_final'*weight_forgetgate_x+cell_state(:,m-1)'*weight_forgetgate_c+bias_forget_gate;output_gate_input=test_final'*weight_outputgate_x+cell_state(:,m-1)'*weight_outputgate_c+bias_output_gate;for n=1:cell_num ? ?input_gate(1,n)=1/(1+exp(-input_gate_input(1,n))); ? ?forget_gate(1,n)=1/(1+exp(-forget_gate_input(1,n))); ? ?output_gate(1,n)=1/(1+exp(-output_gate_input(1,n)));endcell_state_test=(input_gate.*gate+cell_state(:,m-1)'.*forget_gate)';pre_h_state=tanh(cell_state_test').*output_gate;h_state_test=(pre_h_state*weight_preh_h)'test_output

3 仿真結果


4 參考文獻

[1]徐凌峰, 高洪. 基于LSTM神經(jīng)網(wǎng)絡的乘用車能耗預測[J]. 井岡山大學學報:自然科學版, 2021, 42(5):7.

博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡預測、信號處理、元胞自動機、圖像處理、路徑規(guī)劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。

部分理論引用網(wǎng)絡文獻,若有侵權聯(lián)系博主刪除。




【LSTM預測】基于自編LSTM神經(jīng)網(wǎng)絡空調能耗數(shù)據(jù)預測含Matlab源碼的評論 (共 條)

分享到微博請遵守國家法律
彩票| 西峡县| 宜宾市| 观塘区| 屯留县| 商水县| 正安县| 腾冲县| 同江市| 敦化市| 揭西县| 雷波县| 宝兴县| 夹江县| 彭州市| 重庆市| 嵩明县| 武鸣县| 米脂县| 嘉义市| 榆林市| 阿坝县| 永川市| 威信县| 长顺县| 龙州县| 武平县| 呼伦贝尔市| 灵寿县| 浪卡子县| 桂林市| 上饶市| 陵川县| 察隅县| 邵阳县| 河曲县| 防城港市| 绥棱县| 彝良县| 武隆县| 临澧县|