Back to Deep Learning Notes
Topic #106

Exponential Decay

Exponential decay shrinks the learning rate smoothly and continuously every single step, rather than in the sudden jumps of step decay — trading step decay's simplicity for a gentler, gradually-shrinking curve.

Formula

\[ \eta_t = \eta_0 \cdot \gamma^{t} \]

\(\gamma\) (e.g. 0.95, 0.99) is a decay rate applied every single epoch (or step) — unlike step decay's \(\gamma\), which only applies at discrete intervals.

Numerical Example

With \(\eta_0=0.1\), \(\gamma=0.95\): epoch 0: \(0.1\); epoch 10: \(0.1\times0.95^{10}\approx0.0599\); epoch 30: \(0.1\times0.95^{30}\approx0.0215\) — a smooth, continuous shrinkage rather than step decay's flat-then-drop pattern.

Graph

A smooth, continuously decreasing curve — steep early, flattening as it approaches zero.

Code

import torch.optim as optim
from torch.optim.lr_scheduler import ExponentialLR

optimizer = optim.SGD(model.parameters(), lr=0.1)
scheduler = ExponentialLR(optimizer, gamma=0.95)

for epoch in range(30):
    # ... training loop for this epoch ...
    scheduler.step()
    print(scheduler.get_last_lr())

Step Decay vs Exponential Decay

Step DecayExponential Decay
ShapeFlat segments, sudden dropsSmooth, continuous shrinkage
InterpretabilityVery easy to reason about ("halves every 10 epochs")Slightly less intuitive, but avoids abrupt loss-curve jumps
HyperparametersStep size \(s\) and decay factor \(\gamma\)Just decay rate \(\gamma\)

Common Mistakes

  • Choosing a \(\gamma\) too close to 1 (e.g. 0.999) expecting meaningful decay — over a typical training run, this decays extremely slowly and may barely differ from a constant learning rate in practice.
  • Choosing a \(\gamma\) too far from 1 (e.g. 0.7) — the learning rate can shrink to near-zero within just a handful of epochs, effectively freezing training prematurely.

Interview Relevance

Q: "When might you prefer exponential decay over step decay?" When you want a smoother loss curve without the small, temporary jumps that can appear right at step decay's sudden drop points — exponential decay changes the learning rate a tiny amount every single step instead of in occasional large jumps, at the cost of being slightly less intuitive to reason about directly.

Practice Question

With \(\eta_0=0.05\) and \(\gamma=0.9\), what is the learning rate at epoch 5? (You can approximate \(0.9^5 \approx 0.59\).)

Want to go beyond the notes?

Join Coding Now Tech Institute's Deep Learning course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Exponential Decay – FAQs

Quick answers about learning Exponential Decay in Deep Learning.

This free note from Coding Now Tech Institute explains Exponential Decay in Deep Learning — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Deep Learning topic on Coding Now Tech Institute, including Exponential Decay, is 100% free with no signup required.
With focused practice, most students grasp Exponential Decay in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now