Skip to content

lrsched v0.4.0

Choose a tag to compare

@amaar-mc amaar-mc released this 17 Jun 08:07
· 1 commit to main since this release
b8ca0be

What is new

Three standard decay schedules are now in the library.

polynomial_decay

from lrsched import polynomial_decay
s = polynomial_decay(start_lr=1e-3, end_lr=1e-5, total_steps=1000, power=2.0)

Follows (start_lr - end_lr) * (1 - t/T)**power + end_lr, then holds end_lr. power must be positive; both rates must be finite.

exponential_decay

from lrsched import exponential_decay
s = exponential_decay(base_lr=1e-3, decay_rate=0.96, decay_steps=100)

Computes base_lr * decay_rate ** (t / decay_steps). Continuous (fractional exponent), so the decay is smooth rather than stepped. decay_rate must satisfy 0 < decay_rate < 1.

step_decay (updated)

The gamma parameter is renamed to drop, and the factory now validates 0 < drop <= 1 and base_lr > 0. Formula is unchanged: base_lr * drop ** floor(t / step_size).

The CLI lrsched step subcommand now takes --drop instead of --gamma.

Migration

Replace step_decay(base_lr=..., gamma=0.5, step_size=10) with step_decay(base_lr=..., drop=0.5, step_size=10).

Full changelog

See CHANGELOG.md.