class_docstr: Decay learning rate every k updates by a fixed factor
class_docstr_tok: ["Decay","learning","rate","every","k","updates","by","a","fixed","factor"]
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 num_updates < self.cfg.warmup_updates:
          self.lr = (
              self.warmup_init_lr + num_updates * self.warmup_lr_step
          )
      else:
          curr_updates = num_updates - self.cfg.warmup_updates
          lr_mult = self.lr_decay ** (
              curr_updates // self.lr_deacy_period
          )
          self.lr = max(self.max_lr * lr_mult, self.min_lr)
  
      self.optimizer.set_lr(self.lr)
      return self.lr
  
file_path: fairseq/fairseq/optim/lr_scheduler/step_lr_scheduler.py
imports: from collections.abc import Collection
  from dataclasses import dataclass, field
  from typing import 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 3 for calling the StepLRSchedule obj's underlying member method code with example usage: obj.step_update(num_updates) and returns: self