MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / cosine_decay

Function cosine_decay

common/train.cpp:408–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408float cosine_decay(int64_t step, int64_t decay_steps, float minimum) {
409 if (step > decay_steps) {
410 step = decay_steps;
411 }
412 const float cosine_decay = 0.50f*(1.0f + cosf(3.14159265359f*step/decay_steps));
413 const float decay = (1 - minimum)*cosine_decay + minimum;
414 return decay;
415}
416
417float cosine_decay_restart(int64_t step, int64_t decay_steps, float minimum, float restart_step_mult) {
418 while (step > decay_steps) {

Callers 2

cosine_decay_restartFunction · 0.85
learning_scheduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected