如何正确配置编码器解码器LSTM具有一个携带多个功能的时间步输出
在每个观察结果中,我都有6个时间段,每个时间段具有2个功能,并且我正在尝试预测具有2个平行功能的1个时间表。更具体地说,
我的输入数据的形状是:(81、6、2) 我的输出数据的形状是:(81,1,2)
我编写了以下代码来构建Encoder-Decoder LSTM:
model.add(LSTM(200, activation='relu', input_shape=(n_input, 2)))
model.add(RepeatVector(1))
model.add(LSTM(200, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(100, activation='relu')))
model.add(TimeDistributed(Dense(2)))
当我执行单个预测时,网络使我恢复了形状(1,1,2)。
我想仔细检查这是否正确,并且我不会缺少任何东西,因为预测的值很糟糕(有些是负面的,而另一些则很高)。
In each observation, I have 6 timesteps each with 2 features, and I am trying to predict 1 timetsep that has 2 parallel features. More specifically,
The shape of my input data is: (81, 6, 2)
The shape of my output data is: (81, 1, 2)
I wrote the following code to build Encoder-Decoder LSTM:
model.add(LSTM(200, activation='relu', input_shape=(n_input, 2)))
model.add(RepeatVector(1))
model.add(LSTM(200, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(100, activation='relu')))
model.add(TimeDistributed(Dense(2)))
The network gives me back the shape (1, 1, 2) when I perform a single prediction.
I want to double check if this is correct, and I am not missing anything, because the predicted values are very bad (some are negative and others are very high).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个不良的预测是一个不同的问题。您获得的形状应与(样本,时间段,功能)=> (1,1,2)在密集(2)层中指定。
Having a bad prediction is a different issue. The shape you're getting back should correspond to (samples, timesteps, features) => (1, 1, 2) as specified in the Dense(2) layer.