mlx.optimizers.join_schedules#
- join_schedules(schedules: List[Callable], boundaries: List[int]) Callable #
Join multiple schedules to create a new schedule.
- Parameters:
Example
>>> warmup = optim.linear_schedule(0, 1e-1, steps=10) >>> cosine = optim.cosine_decay(1e-1, 200) >>> lr_schedule = optim.join_schedules([warmup, cosine], [10]) >>> optimizer = optim.Adam(learning_rate=lr_schedule) >>> optimizer.learning_rate array(0.0, dtype=float32) >>> for _ in range(12): optimizer.update({}, {}) ... >>> optimizer.learning_rate array(0.0999938, dtype=float32)