keras/src/optimizers/schedules/learning_rate_schedule.py/CosineDecay/_decay_function
class CosineDecay:    def _decay_function(self, step, decay_steps, decay_from_lr, dtype):
        with ops.name_scope(self.name):
            completed_fraction = step / decay_steps
            pi = ops.array(math.pi, dtype=dtype)
            cosine_decayed = 0.5 * (1.0 + ops.cos(pi * completed_fraction))
            decayed = (1 - self.alpha) * cosine_decayed + self.alpha
            return ops.multiply(decay_from_lr, decayed)