Deciding output style for ANN classifier

73 Views Asked by At

I'm in the process of choosing a design for ANN classifier's output. Should I choose one output neuron and train it with '-1' '+1' output values from training data and then when NN will output a number it will be close to either +1 or -1 and so I will decide which class is more likely, or should I use two neurons and train them to '1' and '0' and compare values when evaluating?

1

There are 1 best solutions below

2
On

How to encode the target values depends on the type of activation function that is being used in the output layer. A logistic sigmoid activation varies between 0 and 1 so your target values should be specified in that range. Whereas a hyperbolic tangent activation varies between -1 and 1. You should select the values based on the range of the activation function that is being used.

If you have a simple binary classifier, you could have a single output neuron and select the class based on whether the output is closer to 0 or 1 (I'm assuming a sigmoidal output here). Alternately, you could use two output neurons trained such that [1, 0] corresponds to the first class and [0, 1] corresponds to the second. You would then choose the class for whichever output is highest. While it is slightly more complex, the second scheme generalizes easily to an arbitrary number of classes.