I am trying to build a simple Convolutional NN with:
- 340 samples,
- 260 rows per sample
- 16 features per row.
I thought the order of the shape is (batch_size, steps, input_dim), which would mean (340, 16, 260) I believe.
Current code:
model = Sequential()
model.add(Conv1D(64, kernel_size=3, activation='relu', input_shape=(340, 16, 260)))
# model.add(Conv2D(64, 2, activation='relu'))
model.add(MaxPooling1D())
# model.add(Conv2D(128, 2, activation='relu'))
model.add(Conv1D(64, kernel_size=3, activation='relu'))
model.add(GlobalAveragePooling1D())
model.add(Dense(1, activation='linear'))
model.compile(loss='binary_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
model.summary()
model.fit(xTrain, yTrain, batch_size=16, epochs=1000)
I am getting an error:
ValueError: Input 0 is incompatible with layer conv1d_1: expected ndim=3, found ndim=4
I am very lost and believe that my shapes are off. Could someone help me? Thank you!