    def step_update(self, num_updates):
        """
        Update the learning rate after each update."""
        # if there is warmup
        if self.cfg.warmup_updates > 0:
            if num_updates <= self.cfg.warmup_updates:
                self.lr = self.cfg.warmup_init_lr + num_updates * self.lr_step
                self.optimizer.set_lr(self.lr)
            else:
                if self.warmup_end is False:
                    self.warmup_end = True
        # else do nothing
        return self.optimizer.get_lr()
Update the learning rate after each update.
fairseq/optim/lr_scheduler/reduce_lr_on_plateau.py