I have the following feature vector that consists in a single feature for each sample and 32 samples at total:
X = [[0.1], [0.12], [0.3] ... [0.10]]
and a label vector that consists of binary values
Y = [0, 1, 0 , 0, .... 1] (with 32 samples as well)
I'm trying to use Keras LSTM to predict the next value of the sequence based on a new entry. What I can't figure out is what the "batch_input_shape" tuple means for instance:
model.add(LSTM(neurons, batch_input_shape=(?, ?, ?), return_sequences=False, stateful=True))
According to this article the first one is the batch size, but what about the other two? Are they the number of features for each sample and the number of samples? What should be the value of batch_size in this case?
At the moment receiving the error message:
ValueError: Error when checking input: expected lstm_1_input to have 3 dimensions, but got array with shape (32, 1)
Edit: Here is the model declaration:
def create_lstm(batch_size, n_samples, neurons, dropout):
model = Sequential()
model.add(LSTM(neurons, batch_size=batch_size, input_shape=(n_samples, 1), return_sequences=False, stateful=True))
model.add(Dropout(dropout))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
return model