callbacks
Callbacks for training.
Callback
#
Represents a callback for the explainable model.
EarlyStopping
#
Initialize the EarlyStopping callback.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
monitoring_metric |
The metric name to use for early stopping. |
required | |
reset_after_pruning |
If True, reset the best metrics after pruning. Else keep the best model regardless of the pruning. |
required | |
min_delta |
Minimum delta between two monitoring values to consider an improvement. |
required | |
patience |
Number of epochs to wait with no improvement of the monitoring value. |
required | |
mode |
Whether to "maximize" or "minimize" the provided metric. |
required | |
num_pruning_criteria |
Minimal number of pruning steps performed required. |
required | |
num_leaf_criteria |
Minimal number of remaining leaves required. |
required |
LrScheduler
#
Initialize a scheduler object to encapsulate different torch schedulers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pre_scheduler |
Based torch lr scheduler or no scheduler to be instantiated. |
required | |
step_method |
"epoch" or "batch". |
required | |
monitoring_metric |
Optional monitoring metric required for the step method, default None. |
required |
ModelCheckpoint
#
Model checkpoint initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode |
Whether to "maximize" or "minimize" the provided metric. |
required | |
monitoring_metric |
Monitoring metric required for the step method, default None. |
required | |
reset_after_pruning |
If True, reset the best metrics after pruning. Else keep the best model regardless of the pruning. |
required | |
save_every_epoch |
How often to save the model. If None, only save the best checkpoint. |
required |