
Cosine annealing LR schedule (Geron Ch 11, morie.fn grlrco)
Source:R/geron_train_native.R
morie_geron_lr_cosine_annealing.Rdeta_t = eta_min + 0.5 (eta_max - eta_min)(1 + cos(pi t / T)); the full 0..T curve is returned and its monotonicity checked.
Examples
morie_geron_lr_cosine_annealing(0.001, 0.1, 3, 10)
#> $eta
#> [1] 0.07959537
#>
#> $schedule
#> [1] 0.100000000 0.097577298 0.090546341 0.079595370 0.065796341 0.050500000
#> [7] 0.035203659 0.021404630 0.010453659 0.003422702 0.001000000
#>
#> $eta_min
#> [1] 0.001
#>
#> $eta_max
#> [1] 0.1
#>
#> $halfway_value
#> [1] 0.0505
#>
#> $is_monotone_decreasing
#> [1] TRUE
#>
#> $t
#> [1] 3
#>
#> $T
#> [1] 10
#>
#> $estimate
#> [1] 0.07959537
#>
#> $n
#> [1] 11
#>