| lr_scheduler_step | R Documentation |
Multiplies the optimizer learning rate by gamma every
step_size calls to $step().
lr_scheduler_step(optimizer, step_size, gamma = 0.1)
optimizer |
An |
step_size |
Decay every this many steps (epochs). |
gamma |
Multiplicative decay factor (default 0.1). |
An lr_scheduler_step environment
w <- ag_param(matrix(runif(4), 2, 2))
opt <- optimizer_adam(list(w = w), lr = 0.1)
sch <- lr_scheduler_step(opt, step_size = 10L, gamma = 0.5)
for (epoch in 1:30) sch$step()
opt$lr # 0.1 * 0.5^3 = 0.0125
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.