Could the Input shape of the LSTM layer not be a constant? I am trying a vanilla LSTM on my dataset.
According to this course; the LSTM layer should be built as follows:
model.add(LSTM(50, activation='relu', input_shape=(n_steps, n_features)))

Key in the definition is the shape of the input; that is what the model expects as input for each sample in terms of the number of time steps and the number of features.

In my case, it's a univariate regression also, with &quot;multi-step&quot; though...
Instead of some constant n_steps, I have a different &quot;step&quot; for each Input.
eg:
...
X                                                                                             y
[2006-10-11 10:00:00  0.295046,2006-10-21 10:00:00  0.325147,2006-11-11 10:00:00  0.361293] [0,666506515]
[2006-12-01 10:00:00  0.249307,2006-12-11 10:00:00  0.444077] [1,885262136]
[2009-05-11 14:00:00  0.570017,2009-05-21 14:00:00  0.525082,2009-06-01 14:00:00  0.475404,2009-06-11 14:00:00  0.390616] [1,998273253]

Let's assume that fsplit is the list containing the different steps:
What I've tried so far is doing this:
model.add(LSTM(50, activation='relu', input_shape=([i for i in fsplit], 1)))
but it doesn't work of couse
Thanks in advance :)
That line doesn't work because the architecture of ANNs must be kept constant, in order to train them. If you vary the number of input cells, you change the architecture of the ANN itself.

If your input sequences are not of constant length, I suggest you to use zero padding. This is the most common and used padding technique. In other words, you "complete" the input series with zeros at the end, so that they all have the same length. A properly defined Neural Network would then learn to ignore the zeros and capture only the relvant information.

You can read more about padding here.