code: def get_polynomial_decay_schedule_with_warmup(
      optimizer,
      num_warmup_steps,
      num_training_steps,
      lr_end=1e-7,
      power=1.0,
      last_epoch=-1,
  ):
      """Create a schedule with a learning rate that decreases as a polynomial decay from the initial lr set in the
      optimizer to end lr defined by *lr_end*, after a warmup period during which it increases linearly from 0 to the
      initial lr set in the optimizer.
      Note: *power* defaults to 1.0 as in the fairseq implementation, which in turn is based on the original BERT
      implementation at
      https://github.com/google-research/bert/blob/f39e881b169b9d53bea03d2d341b31707a6c052b/optimization.py#L37
  
      This function is borrowed from transformers/optimization.py. We make the function pickleble.
  
      Parameters
      ----------
      optimizer
          The optimizer for which to schedule the learning rate.
      num_warmup_steps
          The number of steps for the warmup phase.
      num_training_steps
          The total number of training steps.
      lr_end
          The end LR.
      power
          Power factor.
      last_epoch
          The index of the last epoch when resuming training.
  
      Returns
      -------
      lr_schedule
          `torch.optim.lr_scheduler.LambdaLR` with the appropriate schedule.
      """
  
      lr_init = optimizer.defaults["lr"]
      if not (lr_init >= lr_end):
          raise ValueError(
              f"lr_end ({lr_end}) must not be larger than initial lr ({lr_init})"
          )
      lr_lambda = functools.partial(
          _poly_decay_lr_lambda,
          num_warmup_steps=num_warmup_steps,
          num_training_steps=num_training_steps,
          lr_init=lr_init,
          lr_end=lr_end,
          power=power,
      )
      return LambdaLR(optimizer, lr_lambda, last_epoch)
  
file_path: autogluon/multimodal/src/autogluon/multimodal/optimization/lr_scheduler.py
imports: import functools
  import math
  from torch.optim.lr_scheduler import LambdaLR
label_desc: Use image node_id 4 for calling a global function with example usage: get_polynomial_decay_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, lr_end, power, last_epoch) and returns: LambdaLR