Skip to main content

11.4 A graphical deep net

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §11.3 (Zhou / Rohrer-style didactic net). Rewritten in original wording. Continues 11.3b. Next: 11.4b.

The shallow 2–2–1 net can learn a little. Here we look at a deeper hierarchy (three hidden layers) that classifies line orientation inside a small pixel patch — essentially an ML decision tree drawn as a net — designed so each layer sees a richer pattern than the one before. The point is graphical intuition, not a full training loop.

Hierarchy on a 2×22\times 2 patch​

Figure 11.5 — pixels → pairs → lines → class.

Input patterns (filled = “on”):

  • horizontal: top row on, or bottom row on
  • vertical: left column on, or right column on
  • diagonal: main or anti diagonal
  • none: all on or all off

Each input node maps to one pixel. Edges carry weights (often ±1\pm 1). In this didactic graph there are no same-layer links and no skips over a layer.

Hidden layer 1 — single pixels → pairs​

A node that probes “vertical on the left” might combine top-left and bottom-left inputs. For a horizontal top-row input encoded so those vertical edges see (−1)(-1) and (+1)(+1),

xTLwTL+xBLwBL=(−1)(1)+(1)(1)=0.x_{\mathrm{TL}} w_{\mathrm{TL}}+x_{\mathrm{BL}} w_{\mathrm{BL}}=(-1)(1)+(1)(1)=0.

Zero ⇒ that vertical detector stays inactive (no onward pulse). Nonzero ⇒ stay active.

Hidden layer 2 — pairs → line hypotheses​

Later nodes add / subtract pair patterns. Schematically (white = on, black = off; negation flips colors):

1⋅[□x□x]+1⋅[x□x□]=blank board,1\cdot\begin{bmatrix}\square & x\\ \square & x\end{bmatrix} +1\cdot\begin{bmatrix}x & \square\\ x & \square\end{bmatrix} =\text{blank board}, (−1)⋅[□x□x]+1⋅[x□x□]=left column.(-1)\cdot\begin{bmatrix}\square & x\\ \square & x\end{bmatrix} +1\cdot\begin{bmatrix}x & \square\\ x & \square\end{bmatrix} =\text{left column}.

Hidden layer 3 — ReLU​

fReLU(z)=max⁡(0,z)f_{\mathrm{ReLU}}(z)=\max(0,z)

passes positive evidence and silences negative scores — a hard “is this line present?” gate before the class output.

Exercise (open)​

Four two-cell combinations: [X][□][X][\square], [X][X][X][X], [□][X][\square][X], [□][□][\square][\square]. Design weights (and a tiny depth) that separate them. Labs lock the arithmetic pieces (00 vertical probe, ReLU, simple two-bit classifiers).

Takeaway​

LayerRecognizes
InputRaw pixels
Hidden 1Local pairs
Hidden 2Line orientations
Hidden 3 / outClass via ReLU / readout

Depth ≈ composition of features, not magic.

Quiz

Graphical deep net

1 / 4

In the didactic hierarchy, later hidden layers…

Pick an answer to see if you are right.

Next: 11.4b Graphical deep-net labs.