Ravindra BagaleCourses & study guides English Track your progress

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

Data Science

42.2 What Is Loss

42.2 Loss म्हणजे काय

Training ला “किती चुकलो” चा score हवा — तो loss.

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

Why. Training ला “किती चुकलो” चा score हवा. तो score = loss.

हे काय आहे?

What. Regression मध्ये बहुतेकदा mean squared error. Classification मध्ये cross-entropy (नंतर PyTorch मधून call कराल). Training data वर loss कमी — test data वर काळजीपूर्वक check — हे goal.

कसं करायचं?

How.

Tiny MSE हाताने

  1. True y = 10, prediction = 7 → error 3, squared 9.
  2. सगळ्या rows चे squared errors average = MSE.
  3. Training तो average कमी करायचा प्रयत्न करते.
y_true = [10, 12, 8]
y_pred = [9, 11, 10]
mse = sum((a-b)**2 for a,b in zip(y_true, y_pred)) / len(y_true)
print("MSE:", round(mse, 3))