| lr_scheduler_cosine | R Documentation |
Varies the learning rate following a cosine curve from lr_max down to
lr_min over T_max steps. Restarts (SGDR-style) if
restart = TRUE.
lr_scheduler_cosine(optimizer, T_max, lr_min = 0, restart = FALSE)
optimizer |
Optimizer environment. |
T_max |
Number of steps for one cosine cycle. |
lr_min |
Minimum learning rate (default 0). |
restart |
Logical; if |
An lr_scheduler_cosine environment
w <- ag_param(matrix(runif(4), 2, 2))
opt <- optimizer_adam(list(w = w), lr = 0.1)
sch <- lr_scheduler_cosine(opt, T_max = 50L)
for (epoch in 1:50) sch$step()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.