class_docstr: Cosine learning rate decay
  lr = 0.05 * (math.cos(epoch * (math.pi / epochs)) + 1)
  Args:
      lr(float): initial learning rate
      step_each_epoch(int): steps each epoch
      epochs(int): total training epochs
      last_epoch (int, optional):  The index of last epoch. Can be set to restart training. Default: -1, means initial learning rate.
class_docstr_tok: ["Cosine","learning","rate","decay","lr","=","0.05","*","(","math.cos","(","epoch","*","(","math.pi","\/","epochs",")",")","+","1",")","Args",":","lr","(","float",")",":","initial","learning","rate","step_each_epoch","(","int",")",":","steps","each","epoch","epochs","(","int",")",":","total","training","epochs","last_epoch","(","int",",","optional",")",":","The","index","of","last","epoch",".","Can","be","set","to","restart","training",".","Default",":","-1",",","means","initial","learning","rate","."]
code: def __init__(
      self,
      learning_rate,
      step_each_epoch,
      epochs,
      warmup_epoch=0,
      last_epoch=-1,
      **kwargs,
  ):
      super(TwoStepCosine, self).__init__()
      self.learning_rate = learning_rate
      self.T_max1 = step_each_epoch * 200
      self.T_max2 = step_each_epoch * epochs
      self.last_epoch = last_epoch
      self.warmup_epoch = round(warmup_epoch * step_each_epoch)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from paddle.optimizer import lr
  from .lr_scheduler import CyclicalCosineDecay, OneCycleDecay, TwoStepCosineDecay
label_desc: Use image node_id 1 to create a new TwoStepCosine object from inherited base classes: object with example: obj = TwoStepCosine(learning_rate, step_each_epoch, epochs, warmup_epoch, last_epoch)