Madmegsox1 / Cat-and-Dog-classifier

My first open source machine learning project!
GNU General Public License v3.0
2 stars 0 forks source link

using nonbinary classification methods for a binary classification #1

Open rigba opened 3 years ago

rigba commented 3 years ago

Might be wrong but best practice for the last layer for binary image classification is a single output neuron with a sigmoid activation. Something like this:

tf.keras.layers.Dense(1, activation=tf.nn.sigmoid (or whatever))

Idk if its just a standard thing or it's actually has a tangible improvement but yeh might improve training. The loss function used (SparseCategoricalCrossentropy) is also used for classifying non binary outputs. A loss='binary_crossentropy' should be more appropriate.

again no idea if it has tangible benefits

master7720 commented 3 years ago

gae