# Is it possible to model the XOR gate using a 2-2-1 network with no activation function?

The top answer in this question claims that it is possible to model the XOR gate using a 2-2-1 neural network (2 inputs, 2 neurons in the hidden layer) and no activation function. (Or an identity linear activation function if you prefer).

Is this true?

• The term is linear activation function👌 – Preston Roy Jun 21 '17 at 3:59
• @Joshua_T , according to Dr Andrej Karpathy, you can say both: " Unlike all layers in a Neural Network, the output layer neurons most commonly do not have an activation function (or you can think of them as having a linear identity activation function). Source: cs231n.github.io/neural-networks-1 – nayriz Jun 21 '17 at 5:52
• Concerning the question, I think it is unnecessary to consider using a linear activation function. The reason being that you want binary output, it is best to use a hard limit (unit step) transfer function. There is a solution to this problem using a 2-2-1 architecture and hard limit activation functions. You can refer to section 11-4 of "Neural Network Design" by Hagan, which can be found on the web – Preston Roy Jun 21 '17 at 12:33
• @Joshua_T, it's probably unnecessary to use a neural network to model the XOR gate in the first place. It's just a theoretical exercise which I tried to code, and was wondering why I was getting the same result with a 1 layer and a 2 layer network. In another question, someone stated that the problem was solvable and their answer came on top, but I believe it is incorrect, so I just wanted others to help me check. – nayriz Jun 21 '17 at 15:51

Obviously, $f$ is a linear function. Also quite obviously, the XOR-problem is not linearly seperable. Hence $f$ can't solve the XOR-problem.