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, Lv\frac{\partial L}{\partial v}, and Lw\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

Lv=(64)h=4\frac{\partial L}{\partial v}=(6-4)h=4

and

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

because the ReLU input is positive.

Local history

Loading attempts saved in this browser…

    Use with your agent

    Share this URL and your attempt. Ask the agent to start with a clarifying question or the smallest useful hint.

    Tutor me on https://mlprep.iwase.dev/item/original-ml-forward-backprop/. If window.mlPrepAgent is available, read attempts for item original-ml-forward-backprop before tutoring. Inspect my attempt, keep the item ID, and do not reveal the full answer first. After a real attempt, append its record with recorded_by agent, include agent_session_id when available, and read it back.

    Appears in