1

Using RapidMiner I want to implement an LSTM to classify patternes in a time series. Input data is a flat table. My first layer in the Keras operator is a core reshape from exampleset_length x nr_of_attributes to batch x time-steps x features. In the reshape parameter I specifically enter three figures because I want a specific amount of features and time-steps. The only way to achieve this is to specify also batch size, so in total three figures. But when I add a RNN LSTM layer an error is returned: Input is incompatible with layer lstm expected ndim=n found ndim=n+1. What’s wrong?

Chandan
  • 571
  • 4
  • 21
Luc
  • 223
  • 2
  • 13

1 Answers1

1

When specifying 'input_shape' for the LSTM layer, you do not include the batch size.

So your 'input_shape' value should be (timesteps, input_dim).

Source: Keras RNN Layer, the parent layer for LSTM

Bert Kellerman
  • 1,590
  • 10
  • 17
  • Your answer is in conformance with the Keras documentation. However, the Reshape operator in RapidMiner includes an validation. If input_shape and output of the Reshape are not of the same size then the following error is displayed: "Execution of Python script failed. ValueError: total size of new array must be unchanged." To get rid of this error the only option is to Reshape from N x M to M x N. Such would result in an amount of time-steps equivalent to the amount of examples in the initial exampleset. That is not what I want. – Luc Apr 15 '18 at 12:29