Forward pass and backpropagation

Problem

A scalar network has h=ReLU⁡(wx)h=\operatorname{ReLU}(wx), y^=vh\hat{y}=vh, and loss

L=12(y^−y)2.L=\frac{1}{2}(\hat{y}-y)^2.

At x=2x=2, w=1w=1, v=3v=3, and y=4y=4, compute hh, y^\hat{y}, LL, ∂L∂v\frac{\partial L}{\partial v}, and ∂L∂w\frac{\partial L}{\partial w}.

Reveal answer or reference solution

h=2h=2, y^=6\hat{y}=6, and L=2L=2. The derivatives are

∂L∂v=(6−4)h=4\frac{\partial L}{\partial v}=(6-4)h=4

and

∂L∂w=(6−4)vx=12,\frac{\partial L}{\partial w}=(6-4)vx=12,

because the ReLU input is positive.

Outcome

Previous attempts

Loading attempts saved in this browser…

    Appears in