Ravindra BagaleCourses & study guides English Track your progress

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

Data Science

42.4 Learning Rate Simply

42.4 Learning rate — simple

lr खूप मोठा = overshoot. खूप छोटा = snail training.

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

Why. Learning rate खूप मोठा → overshoot. खूप छोटा → snail training.

हे काय आहे?

What. Learning rate (lr) = step size. Beginners 0.1, 0.01, 0.001 ने सुरू करतात आणि loss curve बघतात.

कसं करायचं?

How.

Toy वर दोन lrs compare करा

  1. Chapter 42.3 loop lr=1.5 ने rerun (बहुतेकदा unstable).
  2. lr=0.01 ने rerun (slow पण steady).
  3. Wild jumps पेक्षा loss चा steady drop prefer करा.
def walk(lr, steps=6):
    w = 0.0
    hist = []
    for _ in range(steps):
        w = w - lr * 2 * (w - 3)
        hist.append(round(w, 3))
    return hist
print("lr=0.2", walk(0.2))
print("lr=1.5", walk(1.5))

Ravindra Bagale's Tip

If the loss graph suddenly jumps up (a spike), make the learning rate (lr) smaller and run it again. Small, patient steps usually train better than huge steps.