????????歡迎來到本博客????????
??博主優(yōu)勢:??????博客內(nèi)容盡量做到思維縝密,邏輯清晰,為了方便讀者。
??座右銘:行百里者,半于九十。
??????本文目錄如下:??????
目錄
??1 概述
1.1 變分模態(tài)分解算法
1.2?LSTM
??2 運行結(jié)果?編輯
??3?參考文獻
??4 Python代碼實現(xiàn)
??1 概述
參考文獻:
1.1 變分模態(tài)分解算法
變分 模 態(tài) 分 解 ( variational mode decomposition,VMD) 算法是由 Dragomiretskiy 等提出的一種自動自適應(yīng)、非遞歸的信號處理方法。此算法克服了 EMD 及其改進算法端點效應(yīng)和模態(tài)分量
混疊的問題,可以將非穩(wěn)定性、非線性且復(fù)雜度高的信號分解為多個相對平穩(wěn)的子序列,在求解過
程中可自適應(yīng)匹配最佳中心特征,極大程度地迎合高頻率復(fù)雜信號的分解。
1.2?LSTM
長短時記憶( long-short term memory,LSTM) 神經(jīng)網(wǎng)絡(luò)是 Hochreiter 等提出的一種改進后的循環(huán)式神經(jīng)網(wǎng)絡(luò),可有效解決循環(huán)式神經(jīng)網(wǎng)絡(luò)存在的梯度爆炸和階段性梯度消失的問題。在傳統(tǒng)
循環(huán)式神經(jīng)網(wǎng)絡(luò)基礎(chǔ)上,在隱含層增設(shè)記憶模塊,可使信息較長時間地儲存和遺傳,其結(jié)構(gòu)如圖 1
所示。
??2 運行結(jié)果
?
部分代碼:
def?GRU_predict(data=None,?epochs=100,?predict_duration=len(test),?fitting=None):? ????trainX,trainY,scalarY?=?create_train_test_set(data,?co_imf_predict_for_fitting=fitting)? ????x_train,x_test?=?trainX[:-predict_duration],trainX[-predict_duration:]? ????y_train,y_test?=?trainY[:-predict_duration],trainY[-predict_duration:] ????train_X?=?x_train.reshape((x_train.shape[0],?x_train.shape[1],?x_train.shape[2]))? ????test_X?=?x_test.reshape((x_test.shape[0],?x_test.shape[1],?x_test.shape[2]))? ????model?=?GRU_model(train_X.shape)? ????patience?=?epochs//10? ????EarlyStop?=?EarlyStopping(monitor='val_loss',?patience=5*patience,?verbose=0,?mode='auto')? ????Reduce?=?ReduceLROnPlateau(monitor='val_loss',?patience=patience,?verbose=0,?mode='auto') ???? ????history?=?model.fit(train_X,?y_train,?epochs=epochs,?batch_size=32,?validation_split=0.1,?verbose=0,?shuffle=True,?callbacks=[EarlyStop,Reduce])? ???? ????y_test_predict?=?model.predict(test_X)? ????df_gru_evaluation?=?evaluation_model(y_test,?y_test_predict)? ????y_test_predict?=?y_test_predict.ravel().reshape(-1,1)? ???? ????y_test_predict_result?=?scalarY.inverse_transform(y_test_predict)? ????y_test_raw?=?scalarY.inverse_transform(y_test)???? ????df_predict_raw?=?pd.DataFrame({'raw':?y_test_raw.ravel(),?'predict':?y_test_predict_result.ravel()},?index=range(len(y_test_raw)))?#?Output ????df_train_loss=?pd.DataFrame({'loss':?history.history['loss'],?'val_loss':?history.history['val_loss']},?index=range(len(history.history['val_loss']))) ???? ????return?df_predict_raw,?df_gru_evaluation,?df_train_loss
??3?參考文獻
部分理論來源于網(wǎng)絡(luò),如有侵權(quán)請聯(lián)系刪除。文章來源:http://www.zghlxwxcb.cn/news/detail-488590.html
[1]邴其春,張偉健,沈富鑫,胡嫣然,高鵬,劉東杰.基于變分模態(tài)分解和LSTM的短時交通流預(yù)測[J].重慶理工大學(xué)學(xué)報(自然科學(xué)),2023,37(05):169-177.文章來源地址http://www.zghlxwxcb.cn/news/detail-488590.html
??4 Python代碼實現(xiàn)
到了這里,關(guān)于【VMD-LSTM】變分模態(tài)分解-長短時記憶神經(jīng)網(wǎng)絡(luò)研究(Python代碼實現(xiàn))的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!