class_docstr: Lower the learning rate as soon as the validation score plateaus.
  
  :param optimizer: Optimizer.
  :param base_lr: Base learning rate.
  :param reduce_factor: Factor to reduce learning rate with.
  :param reduce_num_not_improved: Number of checkpoints with no improvement
                                  after which learning rate is reduced.
  :param warmup: Number of initial updates during which the learning rate
                 linearly increases.
class_docstr_tok: ["Lower","the","learning","rate","as","soon","as","the","validation","score","plateaus",".",":","param","optimizer",":","Optimizer",".",":","param","base_lr",":","Base","learning","rate",".",":","param","reduce_factor",":","Factor","to","reduce","learning","rate","with",".",":","param","reduce_num_not_improved",":","Number","of","checkpoints","with","no","improvement","after","which","learning","rate","is","reduced",".",":","param","warmup",":","Number","of","initial","updates","during","which","the","learning","rate","linearly","increases","."]
code: def __init__(
      self,
      optimizer: torch.optim.Optimizer,
      base_lr: float,
      reduce_factor: float,
      reduce_num_not_improved: int,
      warmup: int = 0,
  ) -> None:
      super().__init__(optimizer, base_lr, warmup)
      self.lr = base_lr
      check_condition(
          0.0 < reduce_factor < 1,
          "reduce_factor should be between (0, 1).",
      )
      self.reduce_factor = reduce_factor
      self.reduce_num_not_improved = reduce_num_not_improved
      self.num_not_improved = 0
  
      self.warmed_up = not self.warmup > 0
  
      logger.info(
          "Will reduce the learning rate by a factor of %.2f whenever"
          " the validation score doesn't improve %d times.",
          reduce_factor,
          reduce_num_not_improved,
      )
  
imports: import logging
  from math import sqrt
  from typing import Any, Dict, List, Optional, Tuple, Type
  import torch
  import sockeye.constants
  from sockeye.utils import check_condition
label_desc: Use image node_id 1 to create a new LearningRateSchedulerPlateauReduce object from inherited base classes: AdaptiveLearningRateScheduler with example: obj = LearningRateSchedulerPlateauReduce(optimizer, base_lr, reduce_factor, reduce_num_not_improved, warmup)