我希望能预测多变量时间序列的未来值。我使用这段代码作为模板,但将输出激活函数修改为线性。
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很新,能有人确认一下这个设计吗?