make_learning_rate_schedule

opennmt.schedules.make_learning_rate_schedule(initial_learning_rate, schedule_type, schedule_params=None, schedule_step_duration=1, start_step=0, minimum_learning_rate=0)[source]

Creates the learning rate schedule.

Parameters
  • initial_learning_rate – The initial learning rate value. This can be None if the learning rate is fully defined by the schedule.

  • schedule_type – The type of learning rate schedule. A class name from tf.keras.optimizers.schedules or opennmt.schedules as a string.

  • schedule_params – Additional parameters passed to the schedule constructor.

  • schedule_step_duration – The number of training steps that make 1 schedule step.

  • start_step – Start the schedule after this many steps.

  • minimum_learning_rate – Do not decay past this learning rate value.

Returns

A tf.keras.optimizers.schedules.LearningRateSchedule instance.

Raises

ValueError – if schedule_type can not be resolved to an existing schedule.