Please explain input shape in Keras My data consists of 2-dimensional arrays with shape (2,3).
The whole dataset (emp) consists of 12 items (I know that it is too small of a number for an NN training, but it is just a test), so it has shape (12,2,3)

truevals has shape (12,)

When I try to add Keras layer:

model = Sequential()
model.add(Dense(4, input_shape=(2,3), activation='tanh'))
model.add(Dense(1, activation='sigmoid'))
model.compile(SGD(lr=0.5), 'binary_crossentropy', metrics=['accuracy'])
model.fit(emp, truevals, epochs=200)


and then when I fit the model I get the exception:


  Error when checking target: expected dense_30 to have 3 dimensions,
  but got array with shape (12, 1).


What am I doing wrong?
Dense layers doesn't reduce dimensions of inputs, so if you provide a (12,2,3) input, it expects a (12,2,1) output (for your case).

If you want to make it work, you should flatten your input (or output of first layer) and provide a (12,1) output.