Difference between Dense(2) and Dense(1) as the final layer of a binary classification CNN?
问题 In a CNN for binary classification of images, should the shape of output be (number of images, 1) or (number of images, 2)? Specifically, here are 2 kinds of last layer in a CNN: keras.layers.Dense(2, activation = 'softmax')(previousLayer) or keras.layers.Dense(1, activation = 'softmax')(previousLayer) In the first case, for every image there are 2 output values (probability of belonging to group 1 and probability of belonging to group 2). In the second case, each image has only 1 output