Skip to contents

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

Super class

mlr3torch::CallbackSet -> CallbackSetProgress

Methods

Inherited methods


Method on_epoch_begin()

Initializes the progress bar for training.

Usage

CallbackSetProgress$on_epoch_begin()


Method on_batch_end()

Increments the training progress bar.

Usage

CallbackSetProgress$on_batch_end()


Method on_before_valid()

Creates the progress bar for validation.

Usage

CallbackSetProgress$on_before_valid()


Method on_batch_valid_end()

Increments the validation progress bar.

Usage

CallbackSetProgress$on_batch_valid_end()


Method on_epoch_end()

Prints a summary of the training and validation process.

Usage

CallbackSetProgress$on_epoch_end()


Method on_end()

Prints the time at the end of training.

Usage

CallbackSetProgress$on_end()


Method clone()

The objects of this class are cloneable with this method.

Usage

CallbackSetProgress$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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 started (2025-02-08 11:18:56)
#> 
#> [Summary epoch 1]
#> ------------------
#> Measures (Train):
#>  * classif.acc = 0.31
#>  * classif.ce = 0.69
#> Measures (Valid):
#>  * classif.ce = 0.62
#> Epoch 2 started (2025-02-08 11:18:56)
#> 
#> [Summary epoch 2]
#> ------------------
#> Measures (Train):
#>  * classif.acc = 0.31
#>  * classif.ce = 0.69
#> Measures (Valid):
#>  * classif.ce = 0.56
#> Epoch 3 started (2025-02-08 11:18:57)
#> 
#> [Summary epoch 3]
#> ------------------
#> Measures (Train):
#>  * classif.acc = 0.55
#>  * classif.ce = 0.45
#> Measures (Valid):
#>  * classif.ce = 0.44
#> Epoch 4 started (2025-02-08 11:18:57)
#> 
#> [Summary epoch 4]
#> ------------------
#> Measures (Train):
#>  * classif.acc = 0.57
#>  * classif.ce = 0.43
#> Measures (Valid):
#>  * classif.ce = 0.49
#> Epoch 5 started (2025-02-08 11:18:58)
#> 
#> [Summary epoch 5]
#> ------------------
#> Measures (Train):
#>  * classif.acc = 0.51
#>  * classif.ce = 0.49
#> Measures (Valid):
#>  * classif.ce = 0.60
#> Finished training for 5 epochs (2025-02-08 11:18:58)