class_docstr: Represents the polynomial decay learning rate schedule.
  
  **During warmup:**
  
  .. math::
      \eta_t = \eta_{base} \frac{t}{T_{warmup}}
  
  **After warmup:**
  
  .. math::
      \eta_t = \eta_{final} + (\eta_{base} - \eta_{final}) (\frac{T - t}{T - T_{warmup}})^{p}
  
  This corresponds to increasing the learning rate linearly for the first
  :math:`T_{warmup}` training steps to the base learning rate, and decreasing
  it thereafter for :math:`T - T_{warmup}` steps to the final learning rate
  using a polynomial of degree :math:`p`.
  
  .. note::
      This scheduler is not chainable.
class_docstr_tok: ["Represents","the","polynomial","decay","learning","rate","schedule",".","*","*","During","warmup",":","*","*","..","math",":",":","\\eta_t","=","\\eta_","{","base","}","\\frac","{","t","}","{","T_","{","warmup","}","}","*","*","After","warmup",":","*","*","..","math",":",":","\\eta_t","=","\\eta_","{","final","}","+","(","\\eta_","{","base","}","-","\\eta_","{","final","}",")","(","\\frac","{","T","-","t","}","{","T","-","T_","{","warmup","}","}",")","^","{","p","}","This","corresponds","to","increasing","the","learning","rate","linearly","for","the","first",":","math",":","`","T_","{","warmup","}","`","training","steps","to","the","base","learning","rate",",","and","decreasing","it","thereafter","for",":","math",":","`","T","-","T_","{","warmup","}","`","steps","to","the","final","learning","rate","using","a","polynomial","of","degree",":","math",":","`","p","`",".","..","note",":",":","This","scheduler","is","not","chainable","."]
docstr: :param optimizer:
      The associated optimizer.
  :param num_steps:
      The total number of steps, including warmup, over which to decay the
      learning rate.
  :param num_warmup_steps:
      The number of warmup steps.
  :param power:
      The exponent of the polynomial used for decay.
  :param start_lr:
      The initial warmup learning rate of all parameter groups, or of each
      parameter group respectively.
  :param final_lr:
      The final learning rate of all parameter groups, or of each
      parameter group respectively.
  :param last_epoch:
      The index of the last epoch.
  :param verbose:
      If ``True``, prints a message to stdout for each update.
docstr_tok: [":","param","optimizer",":","The","associated","optimizer",".",":","param","num_steps",":","The","total","number","of","steps",",","including","warmup",",","over","which","to","decay","the","learning","rate",".",":","param","num_warmup_steps",":","The","number","of","warmup","steps",".",":","param","power",":","The","exponent","of","the","polynomial","used","for","decay",".",":","param","start_lr",":","The","initial","warmup","learning","rate","of","all","parameter","groups",",","or","of","each","parameter","group","respectively",".",":","param","final_lr",":","The","final","learning","rate","of","all","parameter","groups",",","or","of","each","parameter","group","respectively",".",":","param","last_epoch",":","The","index","of","the","last","epoch",".",":","param","verbose",":","If","``","True","``",",","prints","a","message","to","stdout","for","each","update","."]
code: def __init__(
      self,
      optimizer: Optimizer,
      num_steps: int,
      num_warmup_steps: int,
      *,
      power: float = 1.0,
      start_lr: Union[float, Sequence[float]] = 0.0,
      final_lr: Union[float, Sequence[float]] = 0.0,
      last_epoch: int = -1,
      verbose: bool = False,
  ) -> None:
      """
      :param optimizer:
          The associated optimizer.
      :param num_steps:
          The total number of steps, including warmup, over which to decay the
          learning rate.
      :param num_warmup_steps:
          The number of warmup steps.
      :param power:
          The exponent of the polynomial used for decay.
      :param start_lr:
          The initial warmup learning rate of all parameter groups, or of each
          parameter group respectively.
      :param final_lr:
          The final learning rate of all parameter groups, or of each
          parameter group respectively.
      :param last_epoch:
          The index of the last epoch.
      :param verbose:
          If ``True``, prints a message to stdout for each update.
      """
      if num_warmup_steps >= num_steps:
          raise ValueError(
              f"`num_warmup_steps` must be less than `num_steps` ({num_steps}), but is {num_warmup_steps} instead."
          )
  
      self.num_steps = num_steps
      self.num_warmup_steps = num_warmup_steps
      self.power = power
  
      self.start_lrs = _get_per_param_group(
          optimizer, "start_lr", start_lr
      )
      self.final_lrs = _get_per_param_group(
          optimizer, "final_lr", final_lr
      )
  
      super().__init__(optimizer, last_epoch, verbose)
  
imports: import math
  import warnings
  from abc import ABC, abstractmethod
  from typing import List, Sequence, Union, final
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  from typing_extensions import TypeAlias
  from fairseq2.typing import finaloverride
label_desc: Use image node_id 1 to create a new PolynomialDecayLR object from inherited base classes: LRSchedulerBase with example: obj = PolynomialDecayLR(optimizer, num_steps, num_warmup_steps)