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

Function learning_schedule

common/train.cpp:425–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425float learning_schedule(
426 int64_t step,
427 int64_t warmup_steps,
428 int64_t cos_decay_steps,
429 float learning_rate,
430 float overall_minimum,
431 float cos_decay_minimum,
432 float cos_decay_restart_step_mult,
433 bool enable_restart) {
434
435 float result =
436 (step < warmup_steps)
437 ? (float) step / (float) warmup_steps
438 : enable_restart
439 ? cosine_decay_restart(
440 step - warmup_steps,
441 cos_decay_steps,
442 cos_decay_minimum,
443 cos_decay_restart_step_mult)
444 : cosine_decay(
445 step,
446 cos_decay_steps,
447 cos_decay_minimum);
448
449 float min = overall_minimum / learning_rate;
450 result = min + result * (1.0f - min);
451 return result;
452}
453
454static bool are_same_layout(struct ggml_tensor * a, struct ggml_tensor * b) {
455 GGML_ASSERT(a != NULL);

Callers 1

train_opt_callbackFunction · 0.85

Calls 2

cosine_decay_restartFunction · 0.85
cosine_decayFunction · 0.85

Tested by

no test coverage detected