class_docstr: Updates the learning rate for optimizers according to the configured LrUpdaterHook.
  
  mmcv's LrUpdaterHook replaces lr schedulers to perform lr warmup and annealing.
  See: https://github.com/open-mmlab/mmcv/blob/master/mmcv/runner/hooks/lr_updater.py
  for supported lr updaters.
  
  We mock the behavior of the mmcv hook with our PyTorchCallback.  We do not have a
  `on_batch_start` callback so that is called manually in the `train_batch` method
  of `MMDetTrial`.
  
  The LrUpaterHook is configured from the mmdet configuration file passed to the
  experiment config.
class_docstr_tok: ["Updates","the","learning","rate","for","optimizers","according","to","the","configured","LrUpdaterHook",".","mmcv","'s","LrUpdaterHook","replaces","lr","schedulers","to","perform","lr","warmup","and","annealing",".","See",":","https",":","\/\/github.com\/open-mmlab\/mmcv\/blob\/master\/mmcv\/runner\/hooks\/lr_updater.py","for","supported","lr","updaters",".","We","mock","the","behavior","of","the","mmcv","hook","with","our","PyTorchCallback",".","We","do","not","have","a","`","on_batch_start","`","callback","so","that","is","called","manually","in","the","`","train_batch","`","method","of","`","MMDetTrial","`",".","The","LrUpaterHook","is","configured","from","the","mmdet","configuration","file","passed","to","the","experiment","config","."]
docstr: Creates the callback from either the provided `hook` or `lr_config`.
  One of `hook` or `lr_config` must be defined. If both are provided,
  `hook` takes precedence.
  
  Arguments:
      context: PyTorchTrialContext used to get iterations and epoch information
      hook (Optional): already created mmcv LrUpdaterHook
      lr_config (Optional): configuration for LrUpdaterHook
docstr_tok: ["Creates","the","callback","from","either","the","provided","`","hook","`","or","`","lr_config","`",".","One","of","`","hook","`","or","`","lr_config","`","must","be","defined",".","If","both","are","provided",",","`","hook","`","takes","precedence",".","Arguments",":","context",":","PyTorchTrialContext","used","to","get","iterations","and","epoch","information","hook","(","Optional",")",":","already","created","mmcv","LrUpdaterHook","lr_config","(","Optional",")",":","configuration","for","LrUpdaterHook"]
code: def __init__(
      self,
      context: det_torch.PyTorchTrialContext,
      hook: Optional[mmcv_hooks.LrUpdaterHook] = None,
      lr_config: Optional[Dict[Any, Any]] = None,
  ):
      """
      Creates the callback from either the provided `hook` or `lr_config`.
      One of `hook` or `lr_config` must be defined. If both are provided,
      `hook` takes precedence.
  
      Arguments:
          context: PyTorchTrialContext used to get iterations and epoch information
          hook (Optional): already created mmcv LrUpdaterHook
          lr_config (Optional): configuration for LrUpdaterHook
      """
      self.runner = FakeRunner(context)
      assert (
          hook is not None or lr_config is not None
      ), "One of hook or lr_config must be provided."
      if hook is None:
          lr_config = cast(Dict[Any, Any], lr_config)
          hook = build_lr_hook(lr_config)
      self.hook = hook
  
imports: from typing import Any, Dict, Optional, cast
  import mmcv
  import mmcv.runner.hooks
  import determined.pytorch
label_desc: Use image node_id 1 to create a new LrUpdaterCallback object from inherited base classes: det_torch with example: obj = LrUpdaterCallback(context, hook, lr_config)