class_docstr: Example: ::
  
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import LambdaLR
  
      # Example Trial which performs the two learning rate lambdas from the PyTorch docs
      >>> lambda1 = lambda epoch: epoch // 30
      >>> lambda2 = lambda epoch: 0.95 ** epoch
      >>> scheduler = LambdaLR(lr_lambda=[lambda1, lambda2])
      >>> 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 LambdaLR <http://pytorch.org/docs/master/optim.html#torch.optim.lr_scheduler.LambdaLR>`_
class_docstr_tok: ["Example",":",":",":",">",">",">","from","torchbearer","import","Trial",">",">",">","from","torchbearer.callbacks","import","LambdaLR","#","Example","Trial","which","performs","the","two","learning","rate","lambdas","from","the","PyTorch","docs",">",">",">","lambda1","=","lambda","epoch",":","epoch","\/\/","30",">",">",">","lambda2","=","lambda","epoch",":","0.95","*","*","epoch",">",">",">","scheduler","=","LambdaLR","(","lr_lambda=","[","lambda1",",","lambda2","]",")",">",">",">","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","LambdaLR","<","http",":","\/\/pytorch.org\/docs\/master\/optim.html","#","torch.optim.lr_scheduler.LambdaLR",">","`","_"]
code: def __init__(self, lr_lambda, step_on_batch=False):
      super(LambdaLR, self).__init__(
          functools.partial(
              torch.optim.lr_scheduler.LambdaLR, lr_lambda=lr_lambda
          ),
          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 LambdaLR object from inherited base classes: TorchScheduler with example: obj = LambdaLR(lr_lambda, step_on_batch)