| lr_scheduler_cyclic | R Documentation |
Cycles the learning rate linearly between base_lr and max_lr
over a triangular cycle of 2 * step_size_up steps (Smith, 2017).
Each call to $step() advances one step — call it per batch,
not per epoch.
lr_scheduler_cyclic(
optimizer,
base_lr,
max_lr,
step_size_up = 2000L,
step_size_down = NULL,
mode = c("triangular", "triangular2", "exp_range"),
gamma = 1
)
optimizer |
Optimizer environment. |
base_lr |
Lower learning rate bound. |
max_lr |
Upper learning rate bound. |
step_size_up |
Steps in the increasing half of a cycle (default 2000). |
step_size_down |
Steps in the decreasing half. |
mode |
One of |
gamma |
Decay factor for |
An lr_scheduler_cyclic environment with $step() and
$get_lr().
Smith, L. N. (2017). Cyclical Learning Rates for Training Neural Networks. WACV.
w <- ag_param(matrix(runif(4), 2, 2))
opt <- optimizer_sgd(list(w = w), lr = 0.01)
sch <- lr_scheduler_cyclic(opt, base_lr = 0.001, max_lr = 0.01,
step_size_up = 10L)
for (i in 1:40) sch$step()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.