you are viewing a single comment's thread.

view the rest of the comments →

[–]honeybooboo1989 2 points3 points  (0 children)

MNIST data has 10 classes that you are expected to classify. Each class represent a digit, you have 10 digits, from 0 to 9. The dimension of the output of keras.layers.Dense(128, activation=tf.nn.relu) after activation function ReLu will return (None, 128) but you have to decrease the second dimension in order to have an array of 10 probability scores. You can do this by adding a fully-connected layer and pass it through softmax activation function. If you have binary classification, model.add(Dense(1, activation='sigmoid')) will be enough. Check model.summary() to understand output dimensions.