class_docstr: Ignite handler to update the Learning Rate based on PyTorch LR scheduler.
class_docstr_tok: ["Ignite","handler","to","update","the","Learning","Rate","based","on","PyTorch","LR","scheduler","."]
docstr: Args:
      lr_scheduler: typically, lr_scheduler should be PyTorch
          lr_scheduler object. If customized version, must have `step` and `get_last_lr` methods.
      print_lr: whether to print out the latest learning rate with logging.
      name: identifier of logging.logger to use, if None, defaulting to ``engine.logger``.
      epoch_level: execute lr_scheduler.step() after every epoch or every iteration.
          `True` is epoch level, `False` is iteration level.
      step_transform: a callable that is used to transform the information from `engine`
          to expected input data of lr_scheduler.step() function if necessary.
  
  Raises:
      TypeError: When ``step_transform`` is not ``callable``.
docstr_tok: ["Args",":","lr_scheduler",":","typically",",","lr_scheduler","should","be","PyTorch","lr_scheduler","object",".","If","customized","version",",","must","have","`","step","`","and","`","get_last_lr","`","methods",".","print_lr",":","whether","to","print","out","the","latest","learning","rate","with","logging",".","name",":","identifier","of","logging.logger","to","use",",","if","None",",","defaulting","to","``","engine.logger","``",".","epoch_level",":","execute","lr_scheduler.step","(",")","after","every","epoch","or","every","iteration",".","`","True","`","is","epoch","level",",","`","False","`","is","iteration","level",".","step_transform",":","a","callable","that","is","used","to","transform","the","information","from","`","engine","`","to","expected","input","data","of","lr_scheduler.step","(",")","function","if","necessary",".","Raises",":","TypeError",":","When","``","step_transform","``","is","not","``","callable","``","."]
code: def __init__(
      self,
      lr_scheduler: _LRScheduler | ReduceLROnPlateau,
      print_lr: bool = True,
      name: str | None = None,
      epoch_level: bool = True,
      step_transform: Callable[[Engine], Any] = lambda engine: (),
  ) -> None:
      """
      Args:
          lr_scheduler: typically, lr_scheduler should be PyTorch
              lr_scheduler object. If customized version, must have `step` and `get_last_lr` methods.
          print_lr: whether to print out the latest learning rate with logging.
          name: identifier of logging.logger to use, if None, defaulting to ``engine.logger``.
          epoch_level: execute lr_scheduler.step() after every epoch or every iteration.
              `True` is epoch level, `False` is iteration level.
          step_transform: a callable that is used to transform the information from `engine`
              to expected input data of lr_scheduler.step() function if necessary.
  
      Raises:
          TypeError: When ``step_transform`` is not ``callable``.
  
      """
      self.lr_scheduler = lr_scheduler
      self.print_lr = print_lr
      self.logger = logging.getLogger(name)
      self.epoch_level = epoch_level
      if not callable(step_transform):
          raise TypeError(
              f"step_transform must be callable but is {type(step_transform).__name__}."
          )
      self.step_transform = step_transform
  
      self._name = name
  
file_path: MONAI/monai/handlers/lr_schedule_handler.py
imports: from __future__ import annotations
  import logging
  from collections.abc import Callable
  from typing import TYPE_CHECKING, Any
  from torch.optim.lr_scheduler import ReduceLROnPlateau, _LRScheduler
  from monai.config import IgniteInfo
  from monai.utils import ensure_tuple, min_version, optional_import
label_desc: Use image node_id 1 to create a new LrScheduleHandler object  with example: obj = LrScheduleHandler(lr_scheduler, print_lr, name, epoch_level, step_transform)