create_interval_scheduler#

composer.utils.create_interval_scheduler(interval, include_end_of_training=True, checkpoint_events=True, final_events=None)[source]#

Helper function to create a scheduler according to a specified interval.

Parameters
  • interval (Union[str, int, Time]) โ€“ If an integer, it will be assumed to be in TimeUnit.EPOCH. Otherwise, the unit must be either TimeUnit.ITERATION, TimeUnit.EPOCH, TimeUnit.BATCH, TimeUnit.TOKEN, or TimeUnit.SAMPLE.

  • include_end_of_training (bool) โ€“ If true, the returned callable will return true at the end of training as well. Otherwise, the returned callable will return true at intervals only.

  • checkpoint_events (bool) โ€“ If true, will use the EPOCH_CHECKPOINT and BATCH_CHECKPOINT events. If False, will use the EPOCH_END and BATCH_END events.

  • final_events (Optional[Set[Event]]) โ€“ The set of events to trigger on at the end of training.

Returns

Callable[[State, Event], bool] โ€“ A function that returns true at interval and at the end of training if specified. For example, it can be passed as the save_interval argument into the CheckpointSaver.