
Native SGD fine-tuning with frozen params, warmup and weight decay (hmfth)
Source:R/geron_w4a_native.R
morie_geron_finetune_lm.RdNative SGD fine-tuning with frozen params, warmup and weight decay (hmfth)
Usage
morie_geron_finetune_lm(
model,
dataset,
epochs = 10,
lr = 0.01,
theta = NULL,
freeze = NULL,
batch_size = NULL,
weight_decay = 0,
warmup = 0
)Examples
task <- function(th, batch) list((th[1] - 3)^2, 2 * (th[1] -
3))
morie_geron_finetune_lm(task, list(1), epochs = 1, lr = 0.1,
theta = 0)
#> $theta
#> [1] 0.6
#>
#> $theta_init
#> [1] 0
#>
#> $loss_history
#> [1] 9
#>
#> $grad_norms
#> [1] 6
#>
#> $lr_schedule
#> [1] 0.1
#>
#> $drift
#> [1] 0.6
#>
#> $n_steps
#> [1] 1
#>
#> $frozen
#> [1] FALSE
#>
#> $n_frozen
#> [1] 0
#>
#> $weight_decay
#> [1] 0
#>
#> $warmup
#> [1] 0
#>
#> $estimate
#> [1] 9
#>
#> $n
#> [1] 1
#>
#> $method
#> [1] "native SGD fine-tuning loop with frozen parameters, warmup and weight decay"
#>