最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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源碼的評論 (共 條)

分享到微博請遵守國家法律
东光县| 威宁| 双鸭山市| 博白县| 漳平市| 义乌市| 沈阳市| 喜德县| 鞍山市| 百色市| 治县。| 云阳县| 五峰| 景德镇市| 曲水县| 兴海县| 竹北市| 全椒县| 赞皇县| 东乌珠穆沁旗| 灌阳县| 吴忠市| 三河市| 岳池县| 田林县| 阳谷县| 浦县| 甘南县| 西乌珠穆沁旗| 南和县| 三穗县| 德州市| 定远县| 景德镇市| 台南县| 三明市| 昂仁县| 陈巴尔虎旗| 兰溪市| 固阳县| 大埔县|