TimeStopping

class TimeStopping(seconds: Int, verbose: Boolean) : Callback

Callback for stopping training of a model when a specified amount of time has passed.

This callback could be used to limit the training time of a model to a specified maximum duration. When the specified amount of time passes, the training of the model is stopped (if it has not already been finished or stopped) at the end of current epoch.

Constructors

TimeStopping
Link copied to clipboard
fun TimeStopping(seconds: Int = 86400, verbose: Boolean = false)

Functions

onEpochBegin
Link copied to clipboard
open fun onEpochBegin(epoch: Int, logs: TrainingHistory)

Called at the start of an epoch during training phase.

onEpochEnd
Link copied to clipboard
open override fun onEpochEnd(epoch: Int, event: EpochTrainingEvent, logs: TrainingHistory)

Called at the end of an epoch during training phase.

onPredictBatchBegin
Link copied to clipboard
open fun onPredictBatchBegin(batch: Int, batchSize: Int)

Called at the beginning of a batch during prediction phase.

onPredictBatchEnd
Link copied to clipboard
open fun onPredictBatchEnd(batch: Int, batchSize: Int)

Called at the end of a batch during prediction phase.

onPredictBegin
Link copied to clipboard
open fun onPredictBegin()

Called at the beginning of prediction.

onPredictEnd
Link copied to clipboard
open fun onPredictEnd()

Called at the end of prediction.

onTestBatchBegin
Link copied to clipboard
open fun onTestBatchBegin(batch: Int, batchSize: Int, logs: History)

Called at the beginning of a batch during evaluation phase. Also called at the beginning of a validation batch during validation phase, if validation data is provided.

onTestBatchEnd
Link copied to clipboard
open fun onTestBatchEnd(batch: Int, batchSize: Int, event: BatchEvent?, logs: History)

Called at the end of a batch during evaluation phase. Also called at the end of a validation batch during validation phase, if validation data is provided.

onTestBegin
Link copied to clipboard
open fun onTestBegin()

Called at the beginning of evaluation or validation.

onTestEnd
Link copied to clipboard
open fun onTestEnd(logs: History)

Called at the end of evaluation or validation.

onTrainBatchBegin
Link copied to clipboard
open fun onTrainBatchBegin(batch: Int, batchSize: Int, logs: TrainingHistory)

Called at the beginning of a batch during training phase.

onTrainBatchEnd
Link copied to clipboard
open fun onTrainBatchEnd(batch: Int, batchSize: Int, event: BatchTrainingEvent, logs: TrainingHistory)

Called at the end of a batch during training phase.

onTrainBegin
Link copied to clipboard
open override fun onTrainBegin()

Called at the beginning of training.

onTrainEnd
Link copied to clipboard
open override fun onTrainEnd(logs: TrainingHistory)

Called at the end of training. This method is empty. Extend this class to handle this event.