syne_tune.callbacks.remove_checkpoints_callback module
- class syne_tune.callbacks.remove_checkpoints_callback.RemoveCheckpointsCallback[source]
Bases:
TunerCallback
This implements early removal of checkpoints of paused trials. In order for this to work, the scheduler needs to implement
trials_checkpoints_can_be_removed()
.
- class syne_tune.callbacks.remove_checkpoints_callback.DefaultRemoveCheckpointsSchedulerMixin[source]
Bases:
RemoveCheckpointsSchedulerMixin
Implements general case of
RemoveCheckpointsSchedulerMixin
, where the callback is of typeRemoveCheckpointsCallback
. This means scheduler has to implementtrials_checkpoints_can_be_removed()
.- trials_checkpoints_can_be_removed()[source]
Supports the general case (see header comment). This method returns IDs of paused trials for which checkpoints can safely be removed. These trials either cannot be resumed anymore, or it is very unlikely they will be resumed. Any trial ID needs to be returned only once, not over and over. If a trial gets stopped (by returning
SchedulerDecision.STOP
inon_trial_result()
), its checkpoint is removed anyway, so its ID does not have to be returned here.- Return type:
List
[int
]- Returns:
IDs of paused trials for which checkpoints can be removed
- callback_for_checkpoint_removal(stop_criterion)[source]
- Parameters:
stop_criterion (
Callable
[[TuningStatus
],bool
]) – Stopping criterion, as passed toTuner
- Return type:
Optional
[TunerCallback
]- Returns:
CP removal callback, or
None
if CP removal is not activated