title: Why is this XOR neural network having 2 outputs?
body: <p>Regularly, a simple neural network to solve XOR should have 2 inputs, 2 neurons in hidden layer, 1 neuron in output layer.</p>
  
  <p>However, the following example implementation has 2 output neurons, and I don't get it:</p>
  
  <p><a href="https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/feedforward/xor/XorExample.java" rel="nofollow noreferrer">https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/feedforward/xor/XorExample.java</a></p>
  
  <p>Why did the author put 2 output neurons in there?</p>
  
  <p><strong>Edit:
  Author of the example noted that he is using 4 neurons in hidden layer, 2 neurons in output layer. But I still don't get it why, why a shape of {4,2} instead of {2,1}?</strong></p>