class_docstr: note: use with a base_lr of 1.0
class_docstr_tok: ["note",":","use","with","a","base_lr","of","1.0"]
code: def schedule(self, n, **kwargs):
      if self.verbosity_interval > 0:
          if n % self.verbosity_interval == 0:
              print(
                  f"current step: {n}, recent lr-multiplier: {self.last_lr}"
              )
      if n < self.lr_warm_up_steps:
          lr = (
              self.lr_max - self.lr_start
          ) / self.lr_warm_up_steps * n + self.lr_start
          self.last_lr = lr
          return lr
      else:
          t = (n - self.lr_warm_up_steps) / (
              self.lr_max_decay_steps - self.lr_warm_up_steps
          )
          t = min(t, 1.0)
          lr = self.lr_min + 0.5 * (self.lr_max - self.lr_min) * (
              1 + np.cos(t * np.pi)
          )
          self.last_lr = lr
          return lr
  
file_path: ColossalAI/examples/images/diffusion/ldm/lr_scheduler.py
imports: import numpy
label_desc: Use image node_id 2 for calling the LambdaWarmUpCosineScheduler obj's underlying member method code with example usage: obj.schedule(n) and returns: lr, lr