Skip to content
Advertisement

InvalidArgumentError training multivariate LSTM autoencoder

I tried to do experiments in different datasets using this model, it works fine for univariate time series. However, I get an issue when trying to do it for multivariate time series and I think it’s due to Time Distributed layer but I am not sure. I tried to read different posts about the same question with no luck.

trainx shape: (38100, 100, 4) | trainy shape: (38100, 4)

testx shape: (12230, 100, 4) | testy shape: (12230, 4)

(samples, timestamps, features)

The model is as follows:

JavaScript

Then I build the model and compile and fit it as follows:

JavaScript

I get the following error trace:

JavaScript

As I mentioned I think it is probably related to time distributed layer. However, if it helps, the model can run when batch_size=1. Other than that it does not.

Advertisement

Answer

From comments

The network output must match your target shape. If you have a 2D target your network must produce 2D and not 3D. simply setting return_sequences=False produces 2D output.

JavaScript

(paraphrased from Marco Cerliani)

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement