How do I need to train an LSTM network to be able to predict arrays of different lengths?

Viewed 42

To solve a time-series problem, I am currently training a LSTM network with (20,3)-dimensional arrays. In this case 20 timesteps.

The thing is that I want to use this network to be able to predict arrays of 1,2,3... timesteps (Example with two timesteps: [x, x, None, None, None, None...]), and that these timesteps are placed from left to right.

Actually, when I try to do this with just [x,x] it predicts me placing the values in position 19-20, and that's exactly what I want to avoid.

Is there any way to avoid this? Or is the problem in the way I have trained the network?

One of the solutions I have thought of is to create 20 different LSTM networks, one for each timestep. But I don't think this is an optimal solution by far.

What ideas do you have to solve this problem? How would you approach the design of the training?

0 Answers
Related