Splashery

Multilayer Net. The same points, seen from the side. Drag down to look at it from above.

About 8 MB, on this tap only

Multilayer Net

One perceptron can only split its inputs with a single straight line, so it cannot learn XOR, “exclusive or”, which is 1 when exactly one of two inputs is 1.

PlaygroundHow to play

Shelf
AI and Computing
Kind
Built from a recipe
Sound
Yes
Hands-on
Yes
Licenses
Own work (made in the page)

How to play

Tap it to try all four inputs. Hands-on: tap each input to flip it; XOR answers.

Its controls

ControlKindRangeStart
Try all four inputsTap
RunButton
FlipButton
ViewList2 choicesPoster (2D)

About it

One perceptron can only split its inputs with a single straight line, so it cannot learn XOR, “exclusive or”, which is 1 when exactly one of two inputs is 1. Put neurons in layers and it can. Here an OR neuron and a NAND (“not both”) neuron feed an AND neuron, and together they give XOR. Blue wires add to a neuron's sum and red wires subtract.

Tap it and it tries the inputs 00, 01, 10 and 11 in turn, lighting each neuron that fires, and fills in the truth table: 0, 1, 1, 0. Pick the poster or a 3D model in the Splash tab. With ✋ Hands-on on, tap each input lamp to flip it: the OR and NAND neurons and the output show XOR's answer at once, and the truth table marks the row.

Details

Splats
Opens at 200,000 at Mid Detail, 120,001 at Low, and up to 630,000 at Max

Is it right?

The hidden units produce the XOR truth table correctly. The splash demonstrates a fixed nonlinear circuit; it does not learn XOR from examples.

  1. Correct

    A single linear decision boundary cannot represent XOR; hidden nonlinear units can.1

    The fixed hidden units compute OR and NAND; their final threshold computes XOR for all four input pairs.

  2. Correct

    The XOR output is one when exactly one input is one.2

    The actual XOR helper returns 0, 1, 1, 0 for 00, 01, 10, 11.

  3. Simplified

    The picture illustrates a multilayer network, not a trained model.1

    The weights and thresholds are stored constants; tapping cycles the four input cases.

  1. 1Multilayer perceptrons, Dive into Deep Learning authors
  2. 2Half adder, All About Circuits textbook
Simplified
The XOR network uses fixed threshold units. Its truth table is real, but there is no loss calculation or training step.

Sources and credits

Made in Splashery. Its code is MIT.

Share it

This page's code, the same one the top of its block shows. The link below opens it in the Playground. To put it on your own page, add the element and one script tag. Every option.

https://splashery.app/play/?toy=multilayer-perceptron
<script type="module" src="https://splashery.app/play/src/element.js"></script> <splashery-toy toy="multilayer-perceptron"></splashery-toy>

Nearby in the collection