2
$\begingroup$

I'm using a neural network for a binary classification problem. Is it better to have one neuron in the output layer or to use two, i.e. one for each class?

$\endgroup$
3
$\begingroup$

Assuming you are using a softmax activation, you can do it either way. With softmax you can treat one as implicit.

Personally, I prefer to explicitly represent one neuron per class. At least for me I find it easier to reason about what the results mean that way, and I don't have to change as much if I want to switch activation functions or problem types.

But in general, the issue is minor (or at the very least, I've never seen it make a big difference).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.