Propagate two activations through a second layer

Read a complete operation before typing its result. · 199 words

An activation is a number produced by a neuron. To see how two such numbers move through another layer, suppose the first layer outputs a = [2, 1]. The second layer has two neurons, so each one receives both activations. For its first neuron, choose weights [0.5, -1] and bias 0. Weight means multiply an activation by the matching weight, then add the products and the bias: z1 = (2 x 0.5) + (1 x -1) + 0 = 0. If this second layer also uses ReLU, its first output is a2_1 = ReLU(0) = 0.

For the second neuron, choose weights [2, 1] and bias -1. It receives the same two first-layer activations but combines them differently: z2 = (2 x 2) + (1 x 1) - 1 = 4. ReLU keeps 4, so the second layer produces [0, 4]. Notice that the two neurons share the incoming vector [2, 1] but use separate weight pairs. This is a small feed-forward network: information moves forward, and no activation travels backward. As another quick check, first-layer outputs [3, -2] with second-layer weights [1, 0.5] and bias 0 give z = 3 - 1 = 2 and ReLU output 2.

Check your recall

A second layer receives activations [2, 1]. Its neuron has weights [3, -1] and bias 0. What is the neuron's output after ReLU?

Check your answer

The pre-activation is z = (2 x 3) + (1 x -1) + 0 = 5, so the ReLU output is 5.

Sources and credits

Original KeyTouch lesson. Background reading · Google · Neural networks.