Three Layers, One Matrix, One Zero

Linear Algebra for Deep LearningMedium+20 XP+20

Three Layers, One Matrix, One Zero

A network stacks three fully connected layers with no activation function anywhere — every layer is a plain affine map:

h1=W1x+b1,h2=W2h1+b2,y=W3h2+b3\mathbf{h}_1 = W_1\mathbf{x} + \mathbf{b}_1, \qquad \mathbf{h}_2 = W_2\mathbf{h}_1 + \mathbf{b}_2, \qquad \mathbf{y} = W_3\mathbf{h}_2 + \mathbf{b}_3h1​=W1​x+b1​,h2​=W2​h1​+b2​,y=W3​h2​+b3​

with

W1=[1201],W2=[2−111],W3=[210−1]W_1 = \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix}, \qquad W_2 = \begin{bmatrix} 2 & -1 \\ 1 & 1 \end{bmatrix}, \qquad W_3 = \begin{bmatrix} 2 & 1 \\ 0 & -1 \end{bmatrix}W1​=[10​21​],W2​=[21​−11​],W3​=[20​1−1​]

b1=[1−1],b2=[02],b3=[30]\mathbf{b}_1 = \begin{bmatrix} 1 \\ -1 \end{bmatrix}, \qquad \mathbf{b}_2 = \begin{bmatrix} 0 \\ 2 \end{bmatrix}, \qquad \mathbf{b}_3 = \begin{bmatrix} 3 \\ 0 \end{bmatrix}b1​=[1−1​],b2​=[02​],b3​=[30​]

Because nothing nonlinear sits between the layers, the entire stack is equivalent to a single affine map

y=Mx+c\mathbf{y} = M\mathbf{x} + \mathbf{c}y=Mx+c

that produces identical outputs for every input x=(x1, x2)\mathbf{x} = (x_1,\ x_2)x=(x1​, x2​).

Exactly one input makes this network output the zero vector, y=(0, 0)\mathbf{y} = (0,\ 0)y=(0, 0).

For that input, what is x2x_2x2​? Round your answer to 3 decimal places.

Two Layers Collapse Into One

f(x) = w₂(w₁x + b₁) + b₂ simplifies to a single line.

w₁x + b₁
→
w₂(·) + b₂
Same line, either way. Stacking linear layers never buys extra shape.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.