CosineAnnealing

class opennmt.schedules.CosineAnnealing(eta_max, eta_min=0, max_step=1000000, warmup_steps=None)[source]

Decay using a cosine annealing schedule.

Inherits from: keras.src.optimizers.schedules.learning_rate_schedule.LearningRateSchedule

__init__(eta_max, eta_min=0, max_step=1000000, warmup_steps=None)[source]

Initializes the decay function.

Parameters
  • eta_max – Maximum learning rate.

  • eta_min – Minimum learning rate.

  • max_step – The last step of the scedule.

  • warmup_steps – The number of steps to increment the learning rate linearly from 0 to scale before annealing.