class_docstr: supports repeated iterations, configurable via lists
  note: use with a base_lr of 1.0.
class_docstr_tok: ["supports","repeated","iterations",",","configurable","via","lists","note",":","use","with","a","base_lr","of","1.0","."]
code: def schedule(self, n, **kwargs):
      cycle = self.find_in_interval(n)
      n = n - self.cum_cycles[cycle]
      if self.verbosity_interval > 0:
          if n % self.verbosity_interval == 0:
              print(
                  f"current step: {n}, recent lr-multiplier: {self.last_f}, "
                  f"current cycle {cycle}"
              )
      if n < self.lr_warm_up_steps[cycle]:
          f = (
              self.f_max[cycle] - self.f_start[cycle]
          ) / self.lr_warm_up_steps[cycle] * n + self.f_start[cycle]
          self.last_f = f
          return f
      else:
          t = (n - self.lr_warm_up_steps[cycle]) / (
              self.cycle_lengths[cycle] - self.lr_warm_up_steps[cycle]
          )
          t = min(t, 1.0)
          f = self.f_min[cycle] + 0.5 * (
              self.f_max[cycle] - self.f_min[cycle]
          ) * (1 + np.cos(t * np.pi))
          self.last_f = f
          return f
  
file_path: ColossalAI/examples/images/diffusion/ldm/lr_scheduler.py
imports: import numpy
label_desc: Use image node_id 3 for calling the LambdaWarmUpCosineScheduler2 obj's underlying member method code with example usage: obj.schedule(n) and returns: f, f