class_docstr: Decay the LR on a fixed schedule.
class_docstr_tok: ["Decay","the","LR","on","a","fixed","schedule","."]
code: def __init__(self, cfg: PolynomialDecayLRScheduleConfig, optimizer):
      super().__init__(cfg, optimizer)
  
      assert cfg.total_num_update > 0
  
      self.lr = cfg.lr[0]
      if cfg.warmup_updates > 0:
          self.warmup_factor = 1.0 / cfg.warmup_updates
      else:
          self.warmup_factor = 1
      self.end_learning_rate = cfg.end_learning_rate
      self.total_num_update = cfg.total_num_update
      self.power = cfg.power
      self.optimizer.set_lr(self.warmup_factor * self.lr)
  
file_path: fairseq/fairseq/optim/lr_scheduler/polynomial_decay_schedule.py
imports: from dataclasses import dataclass, field
  from typing import Optional, List
  from omegaconf import II
  from fairseq.dataclass import FairseqDataclass
  from fairseq.optim.lr_scheduler import FairseqLRScheduler, register_lr_scheduler
label_desc: Use image node_id 1 to create a new PolynomialDecayLRSchedule object from inherited base classes: FairseqLRScheduler with example: obj = PolynomialDecayLRSchedule(cfg, optimizer)