def lr_step(self, epoch, val_loss=None):
        """Adjust the learning rate based on the validation loss."""
        self.lr_scheduler.step(epoch, val_loss)
        # prefer updating the LR based on the number of steps
        return self.lr_step_update()
Adjust the learning rate based on the validation loss.
infoxlm/fairseq/fairseq/trainer.py