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 __init__(
      self,
      mode,
      base_lr=0.1,
      target_lr=0,
      niters=0,
      nepochs=0,
      iters_per_epoch=0,
      offset=0,
      power=2,
      step_iter=None,
      step_epoch=None,
      step_factor=0.1,
      baselr=None,
      targetlr=None,
  ):
      super(LRScheduler, self).__init__()
      assert mode in ["constant", "step", "linear", "poly", "cosine"]
  
      self.mode = mode
      if mode == "step":
          assert step_iter is not None or step_epoch is not None
      if baselr is not None:
          warnings.warn("baselr is deprecated. Please use base_lr.")
          if base_lr == 0.1:
              base_lr = baselr
      self.base_lr = base_lr
      if targetlr is not None:
          warnings.warn("targetlr is deprecated. Please use target_lr.")
          if target_lr == 0:
              target_lr = targetlr
      self.target_lr = target_lr
      if self.mode == "constant":
          self.target_lr = self.base_lr
  
      self.niters = niters
      self.step = step_iter
      epoch_iters = nepochs * iters_per_epoch
      if epoch_iters > 0:
          self.niters = epoch_iters
          if step_epoch is not None:
              self.step = [s * iters_per_epoch for s in step_epoch]
  
      self.offset = offset
      self.power = power
      self.step_factor = step_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 1 to create a new LRScheduler object from inherited base classes: lr_scheduler with example: obj = LRScheduler(mode, base_lr, target_lr, niters, nepochs, iters_per_epoch, offset, power, step_iter, step_epoch, step_factor, baselr, targetlr)