Predict using data with less time steps (different dimension) using Keras RNN model

你说的曾经没有我的故事 提交于 2019-12-12 08:55:02

问题


According to the nature of RNN, we can get an output of predicted probabilities at every time stamp (unfold in time).

Suppose I train an RNN with 5 time steps, each having 6 features. Thus I have to specify the first layer like this(suppose we use a LSTM layer with 20 nodes as the first layer):

model.add(LSTM(20, return_sequences=True, input_shape=(5, 6)))

And the model works well if I input the same dimension data. However, now I want to use first 3 time steps of the data to get the prediction (input shape will be 3, 6), the same syntax will not be accepted.

My question is, is it possible to make such predictions with the same model with keras (without taking first 3 time steps of the training data and train another model)? If yes, how should I deal with the syntax? If no, is there any other RNN packages with LSTM that supports such functionalities?

来源:https://stackoverflow.com/questions/38280766/predict-using-data-with-less-time-steps-different-dimension-using-keras-rnn-mo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!