liveBook · Manning

Logical XOR

As explained in Math and Architectures of Deep Learning

A Boolean operation that outputs true when exactly one of its two binary inputs is true.

Logical XOR, or exclusive OR, returns 1 when exactly one of two binary inputs is 1. It returns 0 when both inputs agree: both are 0 or both are 1. For inputs x0 and x1, XOR can be written as ¬x0x1 + x0¬x1. section 7.2.1 section 7.5.2

The two-input truth table is:

Rock-music friendship recommendation

Let each input indicate whether one person likes rock music. XOR identifies disagreement: one person likes rock and the other does not. Applying NOT to XOR instead recommends friendship when both like rock or both dislike it: friendship = ¬(rockA ⊕ rockB). section 7.2.1

XOR matters for neural networks because its positive points, (0,1) and (1,0), cannot be separated from its negative points, (0,0) and (1,1), by one straight line. A single perceptron therefore cannot model XOR. Multiple perceptrons can form the required nonlinear partition. section 7.4.1 section 7.4

Figure 7.13 MLP for the logical function corresponding to table 7.1

(a) Perceptron for x̄0x1

(b) Perceptron for x0x̄1

(c) MLP for x̄0x1 + x0x̄1

Inspect the MLP construction: implement x̄0x1 and x0x̄1 with separate perceptrons, then combine the two terms with OR. section 7.5.2

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains truth assignments, geometric nonseparability, and an MLP decomposition into complemented conjunctions, stopping short of learned parameter values.
Examples
Uses a rock-music friendship rule, four binary input points, a truth table, and a two-layer perceptron construction.
What it assumes
Assumes binary inputs and basic logical operators while developing the perceptron limitation and MLP solution explicitly.
What you can do after
Build it from scratch by expressing XOR as two conjunction terms and combining their perceptron outputs in an MLP.
How it connects
Connects Boolean logic, logical NOT, AND, OR, perceptrons, linear decision boundaries, truth tables, and multilayer perceptrons.

Also explained in

Compare how 3 books explain logical XOR →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.