Ravindra BagaleCourses & study guides English Track your progress

42. Activation Functions, Loss, and Gradient Descent (Plain English)

Data Science

42.3 Gradient Descent Intuition

42.3 Gradient descent — intuition

Loss माहित असून पुरेसं नाही — weights downhill नेायला हवेत.

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

Why. Loss माहित असून पुरेसं नाही — weights loss surface वर downhill नेायला हवेत. ती walk = gradient descent.

हे काय आहे?

What. Gradient ≈ “loss कुठे fastest वाढते”. Descent उलट दिशेने step: weight := weight − learning_rate × gradient.

कसं करायचं?

How.

Hill story

  1. तुम्ही धुंद टेकडीवर उभे (loss).
  2. पायाखालचा slope feel करा (gradient).
  3. खाली छोटा step (learning rate).
  4. पुन्हा पुन्हा (epochs / iterations).
# 1D toy: loss = (w - 3)**2 ; true best w is 3
w = 0.0
lr = 0.2
for step in range(8):
 grad = 2 * (w - 3) # d/dw of (w-3)^2
 w = w - lr * grad
 print(step, "w=", round(w, 3), "loss=", round((w-3)**2, 3))

Output / जे दिसायला हवं. w 3 कडे चालतो आणि loss कमी होते. Real nets मध्ये लाखो weights — idea तेच, automated.