mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-28 20:35:09 -04:00
Add schedulers header
This commit is contained in:
parent
8249736233
commit
2eaea3b397
1 changed files with 3 additions and 5 deletions
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
|
||||
// Cosine learning rate scheduler
|
||||
|
||||
/*
|
||||
Implements various learning rate schedulers.
|
||||
*/
|
||||
#ifndef SCHEDULERS_H
|
||||
|
||||
#define SCHEDULERS_H
|
||||
|
|
@ -16,7 +15,6 @@ typedef struct {
|
|||
float final_learning_rate_frac;
|
||||
} CosineLearningRateScheduler;
|
||||
|
||||
|
||||
// learning rate schedule: warmup linearly to max LR, then cosine decay to LR * final_learning_rate_frac
|
||||
float get_learning_rate(CosineLearningRateScheduler *scheduler, int step) {
|
||||
float step_learning_rate = scheduler->learning_rate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue