Prints a progress bar and the metrics for training and validation.
Super class
CallbackSet -> CallbackSetProgress
Methods
Inherited methods
CallbackSetProgress$new()
Creates a new instance of this R6 class.
Usage
CallbackSetProgress$new(digits = 2)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.
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.
CallbackSetProgress$load_state_dict()
Loads the time that the previous runs took.
Arguments
state_dict(named
list())
The state dict as retrieved via$state_dict().
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)
#> Epoch 1/5 started (2026-09-01 11:21:17)
#> Validation for epoch 1 started (2026-09-01 11:21:17)
#>
#> [Summary epoch 1]
#> ------------------
#> Measures (Train):
#> * classif.acc = 0.23
#> * classif.ce = 0.77
#> Measures (Valid):
#> * classif.ce = 0.78
#>
#> Epoch 2/5 started (2026-09-01 11:21:17)
#> Validation for epoch 2 started (2026-09-01 11:21:18)
#>
#> [Summary epoch 2]
#> ------------------
#> Measures (Train):
#> * classif.acc = 0.62
#> * classif.ce = 0.38
#> Measures (Valid):
#> * classif.ce = 0.53
#>
#> Epoch 3/5 started (2026-09-01 11:21:18)
#> Validation for epoch 3 started (2026-09-01 11:21:18)
#>
#> [Summary epoch 3]
#> ------------------
#> Measures (Train):
#> * classif.acc = 0.70
#> * classif.ce = 0.30
#> Measures (Valid):
#> * classif.ce = 0.60
#>
#> Epoch 4/5 started (2026-09-01 11:21:18)
#> Validation for epoch 4 started (2026-09-01 11:21:19)
#>
#> [Summary epoch 4]
#> ------------------
#> Measures (Train):
#> * classif.acc = 0.60
#> * classif.ce = 0.40
#> Measures (Valid):
#> * classif.ce = 0.60
#>
#> Epoch 5/5 started (2026-09-01 11:21:19)
#> Validation for epoch 5 started (2026-09-01 11:21:19)
#>
#> [Summary epoch 5]
#> ------------------
#> Measures (Train):
#> * classif.acc = 0.72
#> * classif.ce = 0.28
#> Measures (Valid):
#> * classif.ce = 0.60
#>
#> Finished training for 5 epochs (2026-09-01 11:21:19, 2.2s total)