我试图调和我对LSTM的理解,并在克里斯托弗·奥拉在克拉拉斯实施的这篇文章中指出.我正在关注Jason Brownlee为Keras教程撰写的博客.我主要困惑的是,
[samples, time steps, features]
和,让我们参考下面粘贴的代码集中讨论上述两个问题:
# reshape into X=t and Y=t+1
look_back = 3
trainX, trainY = create_dataset(train, look_back)
testX, testY = create_dataset(test, look_back)
# reshape input to be [samples, time steps, features]
trainX = numpy.reshape(trainX, (trainX.shape[0], look_back, 1))
testX = numpy.reshape(testX, (testX.shape[0], look_back, 1))
########################
# The IMPORTANT BIT
##########################
# create and fit the LSTM network
batch_size = 1
model = Sequential()
model.add(LSTM(4, …
Run Code Online (Sandbox Code Playgroud)