I am training LSTM for multiple time-series in an array which has a structure: 450x801. There are 450 time series with each of 801 timesteps / time series. The labels are classes with assigned integer from 1 to 6, so the dimension of the label is 450x1. This is my implmentation:
This is my code:
def readData():
labels = pd.read_csv('label.csv', header = None)
labels = labels.values
data = pd.read_csv('data.csv', header = None)
return data, labels
data, labels = readData()
data_train, data_test, labels_train, labels_test = train_test_split(data, labels)
model = Sequential()
model.add(LSTM(units=32, input_shape = (450,801,1)))
model.add(Dense(6, activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
However, I get following errors:
Input 0 is incompatible with layer lstm_3: expected ndim=3, found ndim=4
Any idea how do I solve it?