class_docstr: Example: ::
  
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import CosineAnnealingLR
  
      >>> # Example scheduler which uses cosine learning rate annealing - see PyTorch docs
      >>> scheduler = MultiStepLR(milestones=[30,80], gamma=0.1)
      >>> trial = Trial(None, callbacks=[scheduler], metrics=['loss'], verbose=2).for_steps(10).run(1)
  
  Args:
      step_on_batch (bool): If True, step will be called on each training iteration rather than on each epoch
  
  See:
      `PyTorch CosineAnnealingLR <http://pytorch.org/docs/master/optim.html#torch.optim.lr_scheduler.CosineAnnealingLR>`_
class_docstr_tok: ["Example",":",":",":",">",">",">","from","torchbearer","import","Trial",">",">",">","from","torchbearer.callbacks","import","CosineAnnealingLR",">",">",">","#","Example","scheduler","which","uses","cosine","learning","rate","annealing","-","see","PyTorch","docs",">",">",">","scheduler","=","MultiStepLR","(","milestones=","[","30,80","]",",","gamma=0.1",")",">",">",">","trial","=","Trial","(","None",",","callbacks=","[","scheduler","]",",","metrics=","[","'loss","'","]",",","verbose=2",")",".for_steps","(","10",")",".run","(","1",")","Args",":","step_on_batch","(","bool",")",":","If","True",",","step","will","be","called","on","each","training","iteration","rather","than","on","each","epoch","See",":","`","PyTorch","CosineAnnealingLR","<","http",":","\/\/pytorch.org\/docs\/master\/optim.html","#","torch.optim.lr_scheduler.CosineAnnealingLR",">","`","_"]
code: def __init__(self, T_max, eta_min=0, step_on_batch=False):
      super(CosineAnnealingLR, self).__init__(
          functools.partial(
              torch.optim.lr_scheduler.CosineAnnealingLR,
              T_max=T_max,
              eta_min=eta_min,
          ),
          step_on_batch=step_on_batch,
      )
  
imports: import functools
  import warnings
  import torch
  import torchbearer
  from torchbearer.bases import get_metric, _pytorch_version_lt, _pytorch_version_gt
  from torchbearer.callbacks import Callback
label_desc: Use image node_id 1 to create a new CosineAnnealingLR object from inherited base classes: TorchScheduler with example: obj = CosineAnnealingLR(T_max, eta_min, step_on_batch)