class_docstr: Learning rate schedule.
  
  By default implements a constant learning rate:
  
  .. code-block:: python
  
      # Constant learning rate of 0.01 across training epochs
      optimizer = GradientDescentMomentum(0.01, 0.9, schedule = Schedule())
  
  Otherwise, the schedule multiplies the learning rate by change at every element in
  ``step_config``.
  For example,
  
  .. code-block:: python
  
      schedule = Schedule(step_config=[2, 6], change=0.5)
      optimizer = GradientDescentMomentum(1.0, 0.9, schedule = Schedule())
  
  will yield a learning rate schedule of:
  
  .. csv-table::
      :header: "Epoch", "LR"
      :widths: 20, 10
  
      0, 1.0
      1, 1.0
      2, 0.5
      3, 0.5
      4, 0.5
      5, 0.5
      6, 0.25
      7, 0.25
      8, 0.25
      9, 0.25
class_docstr_tok: ["Learning","rate","schedule",".","By","default","implements","a","constant","learning","rate",":","..","code-block",":",":","python","#","Constant","learning","rate","of","0.01","across","training","epochs","optimizer","=","GradientDescentMomentum","(","0.01",",","0.9",",","schedule","=","Schedule","(",")",")","Otherwise",",","the","schedule","multiplies","the","learning","rate","by","change","at","every","element","in","``","step_config","``",".","For","example",",","..","code-block",":",":","python","schedule","=","Schedule","(","step_config=","[","2",",","6","]",",","change=0.5",")","optimizer","=","GradientDescentMomentum","(","1.0",",","0.9",",","schedule","=","Schedule","(",")",")","will","yield","a","learning","rate","schedule","of",":","..","csv-table",":",":",":","header",":","``","Epoch","''",",","``","LR","''",":","widths",":","20",",","10","0",",","1.0","1",",","1.0","2",",","0.5","3",",","0.5","4",",","0.5","5",",","0.5","6",",","0.25","7",",","0.25","8",",","0.25","9",",","0.25"]
docstr: Returns the current learning rate given the epoch and initial learning rate.
  
  Arguments:
      learning_rate (float): Initial learning rate
      epoch (int): Current epoch, used to calculate the adjusted learning rate
  
  Returns:
      (float): The adjusted learning rate
docstr_tok: ["Returns","the","current","learning","rate","given","the","epoch","and","initial","learning","rate",".","Arguments",":","learning_rate","(","float",")",":","Initial","learning","rate","epoch","(","int",")",":","Current","epoch",",","used","to","calculate","the","adjusted","learning","rate","Returns",":","(","float",")",":","The","adjusted","learning","rate"]
code: def get_learning_rate(self, learning_rate, epoch):
      """
      Returns the current learning rate given the epoch and initial learning rate.
  
      Arguments:
          learning_rate (float): Initial learning rate
          epoch (int): Current epoch, used to calculate the adjusted learning rate
  
      Returns:
          (float): The adjusted learning rate
      """
  
      # will be moved to StepSchedule in the future
      if isinstance(self.step_config, list) and isinstance(
          self.change, list
      ):
          if epoch in self.step_config:
              # steps will store the current lr
              self.steps = self.change[self.step_config.index(epoch)]
          if self.steps == 0:
              return learning_rate
          else:
              return self.steps
  
      # will be moved to PowerSchedule in the future
      elif isinstance(self.step_config, int):
          self.steps = np.floor(epoch / self.step_config)
  
      elif isinstance(self.step_config, list):
          self.steps = np.sum(epoch >= np.array(self.step_config))
  
      return float(learning_rate * self.change**self.steps)
  
imports: from __future__ import division
  from neon import NervanaObject
  from neon.util.persist import load_class
  import logging
  import numpy
label_desc: Use image node_id 2 for calling the Schedule obj's underlying member method code with example usage: obj.get_learning_rate(learning_rate, epoch) and returns: float, learning_rate, self