Machine Learning Basics
Which logic function cannot be represented by a simple perceptron consisting only of input and output layers (a single neuron that outputs 0 or 1 with a threshold)?
- AXOR
- BAND
- COR
Show answer and explanation
Answer: A. XOR
A simple perceptron decides its output by whether the weighted sum of its inputs exceeds a threshold, so it can only divide the input space in two with a single straight line (hyperplane). AND and OR can separate the points with output 1 from those with output 0 by a straight line, but XOR gives 1 at (0, 1) and (1, 0) and 0 at (0, 0) and (1, 1), which a single straight line cannot separate. A multilayer perceptron, with a hidden layer in between and a nonlinear activation function, can represent XOR as well.
- A. Correct. XOR cannot be separated by a single straight line (it is not linearly separable), so a simple perceptron cannot represent it.
- B. For example, weights of 1 and 1 with a threshold of 1.5 represent AND.
- C. For example, weights of 1 and 1 with a threshold of 0.5 represent OR.