class_docstr: Decay the LR on a fixed schedule.
class_docstr_tok: ["Decay","the","LR","on","a","fixed","schedule","."]
docstr: Update the learning rate after each update.
docstr_tok: ["Update","the","learning","rate","after","each","update","."]
code: def step_update(self, num_updates):
      """Update the learning rate after each update."""
      if (
          self.cfg.warmup_updates > 0
          and num_updates <= self.cfg.warmup_updates
      ):
          self.warmup_factor = num_updates / float(
              self.cfg.warmup_updates
          )
          lr = self.warmup_factor * self.lr
      elif num_updates >= self.total_num_update:
          lr = self.end_learning_rate
      else:
          warmup = self.cfg.warmup_updates
          lr_range = self.lr - self.end_learning_rate
          pct_remaining = 1 - (num_updates - warmup) / (
              self.total_num_update - warmup
          )
          lr = (
              lr_range * pct_remaining ** (self.power)
              + self.end_learning_rate
          )
      self.optimizer.set_lr(lr)
      return self.optimizer.get_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 4 for calling the PolynomialDecayLRSchedule obj's underlying member method code with example usage: obj.step_update(num_updates) and returns: self