| 406 | } |
| 407 | |
| 408 | float 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 | |
| 417 | float cosine_decay_restart(int64_t step, int64_t decay_steps, float minimum, float restart_step_mult) { |
| 418 | while (step > decay_steps) { |
no outgoing calls
no test coverage detected