資源簡介
深度學習中的長短期記憶網(wǎng)絡模型,LSTM網(wǎng)絡(長短期記憶網(wǎng)絡)可以理解為是RNN的改進版,它的出現(xiàn)解決了RNN的記憶問題。
代碼片段和文件信息
#coding:utf-8
import?pandas?as?pd
from?pandas?import?datetime
import?matplotlib.pyplot?as?plt
import?numpy?as?np
from?sklearn.metrics?import?mean_squared_error
from?sklearn.preprocessing?import?MinMaxScaler
from?keras.models?import?Sequential
from?keras.layers?import?Dense
from?keras.layers?import?LSTM
import?math
df=pd.read_excel(r“/Users/wangyy/Desktop/pcawjw.xls“sep=‘‘)
#covert?to?nparray
df=df.values
#read?648rows3?cols
datax=df[:0:4]
#read?the?last?col?do
datay=?df[:-1]
#set?training?data?(518)and?test?data(130)
train_size=int(len(df)*0.8)
print?train_size
test_size=len(df)-train_size
print?test_size
trainxtestx=datax[0:train_size:]?datax[train_size:len(df):]
#?print?trainx
trainytestY=datay[0:train_size]datay[train_size:len(df)]
print?‘this?is?testY‘
print?testY
#?reshape?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-01-11?13:45??lstm\
?????文件????????1567??2018-01-11?13:41??lstm\lstm.py
?????文件?????????789??2017-12-26?10:03??lstm\modifyWindow.py
?????文件???????13128??2018-01-11?13:45??lstm\readme.docx
?????文件?????????711??2018-01-11?13:33??lstm\results.py
評論
共有 條評論