Ravindra BagaleCourses & study guides English Track your progress

43. Backpropagation Intuition (No Heavy Maths)

Data Science

43.3 Chain Rule in One Sentence

43.3 Chain rule — एका वाक्यात

एक maths वाक्य पुरेसं: chain rule local slopes multiply करते.

हे का शिकायचं?

Why. एक maths वाक्य पुरेसं: chain rule path वरच्या local slopes multiply करते.

हे काय आहे?

What. Loss ŷ वर अवलंबून, ŷ weight w वर अवलंबून → d(loss)/dw = d(loss)/dŷ × dŷ/dw. Deep nets अनेक अशा multiplications chain करतात. Frameworks automate करतात.

कसं करायचं?

How.

Tiny numeric chain

  1. माना ŷ = 2w, loss = (ŷ − 4)**2.
  2. w=1: ŷ=2, loss=4.
  3. d(loss)/dŷ = 2(ŷ−4) = −4; dŷ/dw = 2; product = −8.
  4. ते −8 त्या point वर w चा gradient.
w = 1.0
y_hat = 2 * w
loss = (y_hat - 4) ** 2
dloss_dyhat = 2 * (y_hat - 4)
dyhat_dw = 2
grad_w = dloss_dyhat * dyhat_dw
print("loss", loss, "grad_w", grad_w)

Heavy maths exam नको. Idea हवं, theorems prove नको. PyTorch chain rule तुमच्यासाठी लागू करते.

You need the idea, not proving theorems. PyTorch applies the chain rule for you.