def decay_every_scheduler(step, steps_per_decay, decay_factor):
  """Gives a scaling factor based on scheduling with a decay every n-steps.

  Args:
    step: int; Current step.
    steps_per_decay: int; How often to decay.
    decay_factor: float; The amount to decay.

  Returns:
    Scaling factor applied to the learning rate on the given step.
  """
  return decay_factor**(step // steps_per_decay)