简体   繁体   English

多维输入 multi dimensional output rnn keras 数据预处理

[英]Multi dimensional input multi dimensional output rnn keras data preprocessing

I want to create a RNN model in Keras. In each time-step the input has 9 element and the output has 4 element.我想在 Keras 中创建一个 RNN model。在每个时间步中,输入有 9 个元素,而 output 有 4 个元素。

input_size = (304414,9)
target_size = (304414,4)

How can I create a dataset of sliding windows over the time-series.如何创建在时间序列上滑动 windows 的数据集。

You can use this code by considering windows size and stride您可以通过考虑 windows 大小和步幅来使用此代码

for idx in range(0, input.shape[0] - window_size - 1, stride):
        input.append(input_data[idx + 1: idx + 1 + window_size, :])

    input = np.reshape( input, (len(input), input[0].shape[0], input[0].shape[1]))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM