3
我想对多元时间序列的未来值进行预测。我使用此代码作为模板,但将输出激活修改为线性用于预测Keras未来时间序列值的lstm
https://gist.github.com/karpathy/587454dc0146a6ae21fc
输入数据是双值8维向量的序列。输出在输入序列之前的一个时间周期内是相同的8维向量。这是选择线性激活的原因。
model = Sequential()
model.add(LSTM(512, input_dim=len(chars),return_sequences=True)) #minesh witout specifying the input_length
model.add(LSTM(512, return_sequences=True)) #- original
model.add(Dropout(0.2))
model.add(TimeDistributed(Dense(len(chars))))
model.add(Activation('linear'))
model.compile(loss='mean_squared_error', optimizer='rmsprop')
我是新来Keras和RNN。有人可以确认这种设计吗?
感谢您的建议。 – bhomass