mlr_callback_set.progress: Progress Callback

mlr_callback_set.progressR Documentation

Progress Callback

Description

Prints a progress bar and the metrics for training and validation.

Resuming

This callback can be resumed without any problems.

Super class

CallbackSet -> CallbackSetProgress

Methods

Public methods

Inherited methods

CallbackSetProgress$new()

Creates a new instance of this R6 class.

Usage
CallbackSetProgress$new(digits = 2)
Arguments
digits

integer(1)
The number of digits to print for the measures.


CallbackSetProgress$on_begin()

Starts this run's timer.

Usage
CallbackSetProgress$on_begin()

CallbackSetProgress$on_epoch_begin()

Initializes the progress bar for training.

Usage
CallbackSetProgress$on_epoch_begin()

CallbackSetProgress$on_batch_end()

Increments the training progress bar.

Usage
CallbackSetProgress$on_batch_end()

CallbackSetProgress$on_before_valid()

Creates the progress bar for validation.

Usage
CallbackSetProgress$on_before_valid()

CallbackSetProgress$on_batch_valid_end()

Increments the validation progress bar.

Usage
CallbackSetProgress$on_batch_valid_end()

CallbackSetProgress$on_epoch_end()

Prints a summary of the training and validation process.

Usage
CallbackSetProgress$on_epoch_end()

CallbackSetProgress$on_end()

Prints the time at the end of training, and how long training took in total. A resumed run also reports how much of that total it contributed itself.

Usage
CallbackSetProgress$on_end()

CallbackSetProgress$state_dict()

Returns the seconds trained so far, so that a resumed run reports the time of all runs together rather than only its own.

Usage
CallbackSetProgress$state_dict()

CallbackSetProgress$load_state_dict()

Loads the time that the previous runs took.

Usage
CallbackSetProgress$load_state_dict(state_dict)
Arguments
state_dict

(named list())
The state dict as retrieved via ⁠$state_dict()⁠.


CallbackSetProgress$clone()

The objects of this class are cloneable with this method.

Usage
CallbackSetProgress$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other Callback: TorchCallback, as_torch_callback(), as_torch_callbacks(), callback_set(), mlr3torch_callbacks, mlr_callback_set, mlr_callback_set.checkpoint, mlr_callback_set.tb, mlr_callback_set.unfreeze, mlr_context_torch, t_clbk(), torch_callback()

Examples


task = tsk("iris")

learner = lrn("classif.mlp", epochs = 5, batch_size = 1,
  callbacks = t_clbk("progress"), validate = 0.3)
learner$param_set$set_values(
  measures_train = msrs(c("classif.acc", "classif.ce")),
  measures_valid = msr("classif.ce")
)

learner$train(task)


mlr3torch documentation built on Oct. 30, 2026, 5:10 p.m.