class_docstr: Reduce the learning rate according to a cosine function
  
  Calculate the new learning rate by::
  
     final_lr + (start_lr - final_lr) * (1+cos(pi * nup/max_nup))/2
     if nup < max_nup, 0 otherwise.
  
  Parameters
  ----------
      max_update: int
          maximum number of updates before the decay reaches 0
      base_lr: float
          base learning rate
      final_lr: float
          final learning rate after all steps
      warmup_steps: int
          number of warmup steps used before this scheduler starts decay
      warmup_begin_lr: float
          if using warmup, the learning rate from which it starts warming up
      warmup_mode: string
          warmup can be done in two modes.
          'linear' mode gradually increases lr with each step in equal increments
          'constant' mode keeps lr at warmup_begin_lr for warmup_steps
code: def __call__(self, num_update):
      if num_update < self.warmup_steps:
          return self.get_warmup_lr(num_update)
      if num_update <= self.max_update:
          self.base_lr = (
              self.final_lr
              + (self.base_lr_orig - self.final_lr)
              * (
                  1
                  + cos(
                      pi
                      * (num_update - self.warmup_steps)
                      / self.max_steps
                  )
              )
              / 2
          )
      return self.base_lr
  
imports: import logging
  from math import cos, pi
label_desc: Use image node_id 2 for calling the CosineScheduler obj's underlying member method code with example usage: obj.__call__(num_update) and returns: self, self