Saves the training and validation history during training.
The history is saved as a data.table where the validation measures are prefixed with "valid."
and the training measures are prefixed with "train."
.
Super class
mlr3torch::CallbackSet
-> CallbackSetHistory
Methods
Inherited methods
Method load_state_dict()
Sets the field $train
and $valid
to those contained in the state dict.
Examples
cb = t_clbk("history")
task = tsk("iris")
learner = lrn("classif.mlp", epochs = 3, batch_size = 1,
callbacks = t_clbk("history"), validate = 0.3)
learner$param_set$set_values(
measures_train = msrs(c("classif.acc", "classif.ce")),
measures_valid = msr("classif.ce")
)
learner$train(task)
print(learner$model$callbacks$history)
#> Key: <epoch>
#> epoch train.classif.acc train.classif.ce valid.classif.ce
#> <num> <num> <num> <num>
#> 1: 1 0.3047619 0.6952381 0.6222222
#> 2: 2 0.3142857 0.6857143 0.7333333
#> 3: 3 0.3523810 0.6476190 0.5111111