Skip to contents

Changes the learning rate based on the schedule specified by a torch::lr_scheduler.

As of this writing, the following are available:

Super class

mlr3torch::CallbackSet -> CallbackSetLRScheduler

Public fields

scheduler_fn

(lr_scheduler_generator)
The torch function that creates a learning rate scheduler

scheduler

(LRScheduler)
The learning rate scheduler wrapped by this callback

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)
The torch 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.