How can a two-layer MLP with two ReLU hidden units and a linear output unit compute the XOR function on , and what values do its hidden units and output take on all four inputs?
Deep learning, Multilayer perceptrons
Level L2 Elementary. Length Short. Nature Mat Mathematical.
What's being asked
Whether you can construct an explicit non-linear feature mapping with ReLU units to separate a non-linearly separable problem.
Key idea
Set , and . The hidden units map , and to , and , which are linearly separable.
Steps
- Define the hidden layer with and , and output with .
- For : and , giving .
- For and : and , giving .
- For : and , giving .
Common mistakes
- Trying to separate and from and with a single hidden unit or without a bias in .
- Omitting the negative weight on , which is needed to pull back down to .
How long your answer should be
4–5 lines with the weights and the four-row evaluation table.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: In a U-Net encoder–decoder for image segmentation, why are encoder feature maps concatenated directly to the corresponding decoder layers instead of relying on the bottleneck alone?
Next in Deep learning: In a small computation graph, input feeds two branches that share the same weight : and , and the loss is . How do you compute by backpropagation, and what happens if an implementation overwrites instead of accumulating branch gradients?