What is a neuron?

Part 0, Neural networks from absolute zero

Learning objectives

  • Read a neuron's arithmetic, y=Οƒ(wx+b)y = \sigma(w x + b), and name each part
  • Say where a squashing neuron switches on (at x=βˆ’b/wx = -b/w) and what sets how sharply (the weight)
  • Tell the parameters training tunes (weights and biases) from the choice made before it (the activation)
  • Read the error of one trained neuron on the Marmousi2 column and say why one switch is not enough

One Neuron Is a Switch

A neuron multiplies its input by a weight, adds a bias and passes the sum through an activation: y=Οƒ(wx+b)y = \sigma(w x + b). For a squashing activation such as tanh⁑\tanh that makes it a switch: off on one side of x=βˆ’b/wx = -b/w, on on the other, and the larger the weight the sharper the turn. Fed the depth down the book's column of the Marmousi2 model and scaled into velocity by a second weight and bias, the one tanh neuron the book trained puts its switch at 1282 m, in the middle of the climb from the water to the deep rock, and misses the column by 211 m/s RMS: one switch bends the profile once, and the column has many bends.

One Neuron Is A SwitchInteractive figure, enable JavaScript to interact.

The Column

Every network in Part 0 learns the same thing: the P-wave velocity down one column of the Marmousi2 window the FWI Lab holds, at x = 3600 m, the book's stand-in for a velocity log. The window is the Marmousi2 model of Martin, Wiley and Marfurt, cropped and resampled to 50 m; it is a 2D acoustic, constant-density slice of a synthetic model, not field data, and its attribution is in the figure's model line. The column has 450 m of water at 1500 m/s, then rock that climbs in steps, with a slower layer near 1100 m and its largest step, to 3487 m/s, at 1450 m. The choice of column is the book's own.

The Arithmetic

The neuron's input is depth made dimensionless, x=z/Lx = z/L with LL = 1800 m, the window's depth. Its score is wx+bw x + b: the weight ww is how fast the score grows with depth, the bias bb the score at the surface. The activation turns the score into the neuron's output; tanh⁑\tanh is near βˆ’1-1 for a score well below zero, near +1+1 well above, and passes zero where the score does, at x=βˆ’b/wx = -b/w. The output layer, another weight aa and bias kk, scales it into velocity:

v(z)=V0 (a tanh⁑(w z/L+b)+k),V0=1500Β m/s.v(z) = V_0\,\big(a\,\tanh(w\,z/L + b) + k\big), \qquad V_0 = 1500\ \mathrm{m/s}.

Four numbers in all, ww, bb, aa and kk: the network's parameters, the numbers training tunes. The activation is not tuned; it is chosen before training starts (Section 0.3). Goodfellow, Bengio and Courville (2016) describe a hidden unit the same way: an affine transformation of its inputs followed by an elementwise nonlinear function.

The Trained Neuron

The book trained this neuron on the column at 176 depths every 10 m down to 1750 m, from its seed's random start, by Adam and then L-BFGS to convergence (both in Section 0.8). It found w=5.88w = 5.88, b=βˆ’4.19b = -4.19, a=0.62a = 0.62 and k=1.69k = 1.69: the switch at βˆ’b/w=0.71-b/w = 0.71 of the window's depth, 1282 m, turning on over about 612 m of depth (where the score runs from βˆ’1-1 to 11, Ξ”x=2/w\Delta x = 2/w). Its error at the 176 depths is 211 m/s RMS. The figure starts near it, at w=6w = 6 and b=βˆ’4.25b = -4.25 on the sliders' grid of 0.25, where the error is 212 m/s.

Where One Switch Goes

Move the bias and the switch moves; keep βˆ’b/w-b/w and raise the weight and the switch stays where it is and sharpens. Put the switch at the sea floor, 450 m down, and the error grows to 1025 m/s: the sea floor is the column's first step, but most of the climb lies deeper, and one switch can take only one step. Make it steep, w=12w = 12 with b=βˆ’8.5b = -8.5, and it turns on over 300 m and misses by 248 m/s. Push the bias to βˆ’12-12 and the switch would sit at 3600 m, below the column: the neuron is off at every depth and the output is a constant, 843 m/s RMS from the column. Swap tanh⁑\tanh for ReLU and keep the other numbers, and the error is 750 m/s: the output layer was trained for tanh⁑\tanh.

Why It Matters for a PINN

Every physics-informed network in this book is a stack of these switches, with depth, distance and time as its inputs. Section 0.2 adds them together; Part 1 trains them on a wave equation's residual instead of on a profile. The building block does not change.

What Comes Next

Section 0.2 puts many neurons in a layer, then two layers, and fits the same column.

References

  • Goodfellow, I., Bengio, Y. and Courville, A. (2016). Deep Learning, Chapter 6, Deep feedforward networks. MIT Press.
  • Martin, G. S., Wiley, R. and Marfurt, K. J. (2006). Marmousi2: An elastic upgrade for Marmousi. The Leading Edge, 25(2), 156-166. doi:10.1190/1.2172306.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.