class_docstr: Learning Rate Scheduler
  
  Parameters
  ----------
  
  mode : str
      Modes for learning rate scheduler.
      Currently it supports 'constant', 'step', 'linear', 'poly' and 'cosine'.
  base_lr : float
      Base learning rate, i.e. the starting learning rate.
  target_lr : float
      Target learning rate, i.e. the ending learning rate.
      With constant mode target_lr is ignored.
  niters : int
      Number of iterations to be scheduled.
  nepochs : int
      Number of epochs to be scheduled.
  iters_per_epoch : int
      Number of iterations in each epoch.
  offset : int
      Number of iterations before this scheduler.
  power : float
      Power parameter of poly scheduler.
  step_iter : list
      A list of iterations to decay the learning rate.
  step_epoch : list
      A list of epochs to decay the learning rate.
  step_factor : float
      Learning rate decay factor.
class_docstr_tok: ["Learning","Rate","Scheduler","Parameters","--","--","--","--","--","mode",":","str","Modes","for","learning","rate","scheduler",".","Currently","it","supports","'constant","'",",","'step","'",",","'linear","'",",","'poly","'","and","'cosine","'",".","base_lr",":","float","Base","learning","rate",",","i.e",".","the","starting","learning","rate",".","target_lr",":","float","Target","learning","rate",",","i.e",".","the","ending","learning","rate",".","With","constant","mode","target_lr","is","ignored",".","niters",":","int","Number","of","iterations","to","be","scheduled",".","nepochs",":","int","Number","of","epochs","to","be","scheduled",".","iters_per_epoch",":","int","Number","of","iterations","in","each","epoch",".","offset",":","int","Number","of","iterations","before","this","scheduler",".","power",":","float","Power","parameter","of","poly","scheduler",".","step_iter",":","list","A","list","of","iterations","to","decay","the","learning","rate",".","step_epoch",":","list","A","list","of","epochs","to","decay","the","learning","rate",".","step_factor",":","float","Learning","rate","decay","factor","."]
code: def update(self, num_update):
      N = self.niters - 1
      T = num_update - self.offset
      T = min(max(0, T), N)
  
      if self.mode == "constant":
          factor = 0
      elif self.mode == "linear":
          factor = 1 - T / N
      elif self.mode == "poly":
          factor = pow(1 - T / N, self.power)
      elif self.mode == "cosine":
          factor = (1 + cos(pi * T / N)) / 2
      elif self.mode == "step":
          if self.step is not None:
              count = sum([1 for s in self.step if s <= T])
              factor = pow(self.step_factor, count)
          else:
              factor = 1
      else:
          raise NotImplementedError
  
      if self.mode == "step":
          self.learning_rate = self.base_lr * factor
      else:
          self.learning_rate = (
              self.target_lr + (self.base_lr - self.target_lr) * factor
          )
  
file_path: gluon-cv/gluoncv/utils/lr_scheduler.py
imports: from __future__ import division
  import warnings
  from math import pi, cos
  from mxnet import lr_scheduler
label_desc: Use image node_id 3 for calling the LRScheduler obj's underlying member method code with example usage: obj.update(num_update) without return types