Beta

Sync to cloud

Uses your current signed-in YoolVi account. A Learn profile is not required.

Upload a snapshot of this browser’s saved lesson work across all subjects, including notes, experiments, journal and review history. Existing guest work is included only when you confirm below. This does not upload account credentials or award XP.

Sync uploads to your private account; it does not automatically merge or replace this device’s work. On another device, download the cloud copy and use My Learning’s backup import. The previous cloud snapshot is retained when a new one replaces it.

Export or import this device’s work

No background uploads. Edits made after a snapshot need another sync. On shared devices, work is bound to the first account observed by cloud sync; another account must use a separate browser profile. Keep your own downloaded backup too.

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Back to Neural Networks Training and Debugging

Neural Networks Training and Debugging · Lesson 1 of 2 in this module

Understand nonlinear layers

The lamp rule
Switch ASwitch BLamp should be
OffOffOff
OffOnOn
OnOffOn
OnOnOff
Nonlinear layersFixed teaching example — not your saved experiment.
  1. Starting information

    Switches: off/on and on/off

  2. Relationship or operation

    Both differ; matching switch pairs do not

  3. Consequence

    Lamp on only for different switches

XOR means exactly one input is on. A nonlinear transformation such as ReLU, which replaces negative values with zero, enables boundaries that one straight line cannot express.

The idea in everyday terms

Some patterns cannot be separated by one straight line. The four XOR corners make this visible: the two positive corners lie across from each other. Moving a line around cannot put both positive corners on one side and both negative corners on the other.

What to watch in the experiment

A hidden layer builds new numbers from the inputs before making the final decision. A nonlinear activation bends that transformation; adding more straight-line calculations alone still gives one straight-line calculation. Compare the original coordinates with the hidden-layer view to see how the problem changes.

What this does not establish

The lab illustrates a representation that separates these four points. It does not prove that adding layers always helps or that each neuron learns one understandable concept.

Full worked explanation, calculations and control definitions

Use this reference for the detailed mechanism and control meanings. Derivations explicitly marked optional are enrichment.

A line has a limit

In the input diagram, (0,1) and (1,0) are positive. The other two corners are negative. Any single straight decision boundary leaves at least one corner on the wrong side. This is a limitation of the model family, not a lack of training time.

Two affine transformations still combine into one: if h = ax + b and y = ch + d, then y = cax + cb + d. Adding layers without nonlinearity does not remove this limit.

Two hidden features change the view

ReLU returns its input when positive, and zero otherwise. Our first hidden neuron computes ReLU(A + B). The second computes ReLU(A + B − 1). The output subtracts twice the second value from the first.

For (1,1), the hidden values are 2 and 1, so the output is 2 − 2 × 1 = 0. For (1,0), they are 1 and 0, so the output is 1. The weights in this lab are hand-chosen to expose the mechanism; no training has taken place.

h1=max⁡(0,A+B),h2=max⁡(0,A+B−1),y=h1−2h2h_1=\max(0,A+B),\quad h_2=\max(0,A+B-1),\quad y=h_1-2h_2

A representation is useful for what comes next

A hidden layer produces a new set of features. In hidden space, a simple output rule can now distinguish the positive examples. A representation helps when relevant differences become easier for later operations to use.

Real image networks can combine edges into useful shape evidence. But a concept does not have to live in one neuron: features are often distributed and overlapping. More depth can express compositional functions efficiently, while also making optimization harder.