I want to add an LSTM layer to my sequential model, Below is what I have done My input data has dimensions of 792 X 8. And I am extracting 5 features out of it. I am getting the error “Input 0 of layer “lstm” is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (None, 5)” regarding the input arguments to LSTM model. Any help or guidance will be greatly appreciated.
Thanks
model = Sequential([
LayerNormalization(center=True , scale=True,
input_shape=(shape_input,)),
Dense(
units = 512, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 1024, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 2048, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 4096, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 4096, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 2048, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 1024, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 512, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(
units = 256, kernel_initializer = 'he_normal', activation='relu'),
Dropout(0.3),
Dense(units = num_output, activation='softmax')
])
model.add(LSTM(1, input_shape=(8,792,5)))
model.compile(optimizer='adam',
loss='categorical_crossentropy',
metrics = ['accuracy'])
return model