mlr_callback_set.lr_scheduler {mlr3torch} | R Documentation |
Learning Rate Scheduling Callback
Description
Changes the learning rate based on the schedule specified by a torch::lr_scheduler
.
As of this writing, the following are available:
Custom schedulers defined with
torch::lr_scheduler()
.
Super class
mlr3torch::CallbackSet
-> CallbackSetLRScheduler
Public fields
scheduler_fn
(
lr_scheduler_generator
)
Thetorch
function that creates a learning rate schedulerscheduler
(
LRScheduler
)
The learning rate scheduler wrapped by this callback
Methods
Public methods
Inherited methods
Method new()
Creates a new instance of this R6 class.
Usage
CallbackSetLRScheduler$new(.scheduler, step_on_epoch, ...)
Arguments
.scheduler
(
lr_scheduler_generator
)
Thetorch
scheduler generator (e.g.torch::lr_step
).step_on_epoch
(
logical(1)
)
Whether the scheduler steps after every epoch (otherwise every batch)....
(any)
The scheduler-specific arguments
Method on_begin()
Creates the scheduler using the optimizer from the context
Usage
CallbackSetLRScheduler$on_begin()
Method clone()
The objects of this class are cloneable with this method.
Usage
CallbackSetLRScheduler$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.