简体   繁体   中英

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.

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

How can I create a dataset of sliding windows over the time-series.

You can use this code by considering windows size and stride

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]))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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