    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
Update the learning rate after each update.
fairseq/optim/lr_scheduler/step_lr_scheduler.py