def __init__(self, optimizer, warmup_epochs, total_epochs, steps_per_epoch, init_lr, max_lr, final_lr):
    '\n        Initializes the learning rate scheduler.\n\n        :param optimizer: A PyTorch optimizer.\n        :param warmup_epochs: The number of epochs during which to linearly increase the learning rate.\n        :param total_epochs: The total number of epochs.\n        :param steps_per_epoch: The number of steps (batches) per epoch.\n        :param init_lr: The initial learning rate.\n        :param max_lr: The maximum learning rate (achieved after warmup_epochs).\n        :param final_lr: The final learning rate (achieved after total_epochs).\n        '
    assert (len(optimizer.param_groups) == len(warmup_epochs) == len(total_epochs) == len(init_lr) == len(max_lr) == len(final_lr))
    self.num_lrs = len(optimizer.param_groups)
    self.optimizer = optimizer
    self.warmup_epochs = np.array(warmup_epochs)
    self.total_epochs = np.array(total_epochs)
    self.steps_per_epoch = steps_per_epoch
    self.init_lr = np.array(init_lr)
    self.max_lr = np.array(max_lr)
    self.final_lr = np.array(final_lr)
    self.current_step = 0
    self.lr = init_lr
    self.warmup_steps = (self.warmup_epochs * self.steps_per_epoch).astype(int)
    self.total_steps = (self.total_epochs * self.steps_per_epoch)
    self.linear_increment = ((self.max_lr - self.init_lr) / self.warmup_steps)
    self.exponential_gamma = ((self.final_lr / self.max_lr) ** (1 / (self.total_steps - self.warmup_steps)))
    super(NoamLR, self).__init__(optimizer)
Initializes the learning rate scheduler.

:param optimizer: A PyTorch optimizer.
:param warmup_epochs: The number of epochs during which to linearly increase the learning rate.
:param total_epochs: The total number of epochs.
:param steps_per_epoch: The number of steps (batches) per epoch.
:param init_lr: The initial learning rate.
:param max_lr: The maximum learning rate (achieved after warmup_epochs).
:param final_lr: The final learning rate (achieved after total_epochs).
def __init__(self, optimizer, warmup_epochs, total_epochs, steps_per_epoch, init_lr, max_lr, final_lr):
    '\n        Initializes the learning rate scheduler.\n\n        :param optimizer: A PyTorch optimizer.\n        :param warmup_epochs: The number of epochs during which to linearly increase the learning rate.\n        :param total_epochs: The total number of epochs.\n        :param steps_per_epoch: The number of steps (batches) per epoch.\n        :param init_lr: The initial learning rate.\n        :param max_lr: The maximum learning rate (achieved after warmup_epochs).\n        :param final_lr: The final learning rate (achieved after total_epochs).\n        '
    assert (len(optimizer.param_groups) == len(warmup_epochs) == len(total_epochs) == len(init_lr) == len(max_lr) == len(final_lr))
    self.num_lrs = len(optimizer.param_groups)
    self.optimizer = optimizer
    self.warmup_epochs = np.array(warmup_epochs)
    self.total_epochs = np.array(total_epochs)
    self.steps_per_epoch = steps_per_epoch
    self.init_lr = np.array(init_lr)
    self.max_lr = np.array(max_lr)
    self.final_lr = np.array(final_lr)
    self.current_step = 0
    self.lr = init_lr
    self.warmup_steps = (self.warmup_epochs * self.steps_per_epoch).astype(int)
    self.total_steps = (self.total_epochs * self.steps_per_epoch)
    self.linear_increment = ((self.max_lr - self.init_lr) / self.warmup_steps)
    self.exponential_gamma = ((self.final_lr / self.max_lr) ** (1 / (self.total_steps - self.warmup_steps)))
    super(NoamLR, self).__init__(optimizer)