code: def create_optimizer(config, parameter_list=None):
      """
      Create an optimizer using config, usually including
      learning rate and regularization.
  
      Args:
          config(dict):  such as
          {
              'LEARNING_RATE':
                  {'function': 'Cosine',
                   'params': {'lr': 0.1}
                  },
              'OPTIMIZER':
                  {'function': 'Momentum',
                   'params':{'momentum': 0.9},
                   'regularizer':
                      {'function': 'L2', 'factor': 0.0001}
                  }
          }
  
      Returns:
          an optimizer instance
      """
      # create learning_rate instance
      lr_config = config["LEARNING_RATE"]
      lr_config["params"].update(
          {
              "epochs": config["epoch"],
              "step_each_epoch": config["total_images"]
              // config["TRAIN"]["batch_size"],
          }
      )
      lr = LearningRateBuilder(**lr_config)()
  
      # create optimizer instance
      opt_config = deepcopy(config["OPTIMIZER"])
  
      opt = OptimizerBuilder(**opt_config)
      return opt(lr, parameter_list), lr
  
imports: import sys
  import math
  from paddle.optimizer.lr import LinearWarmup
  from paddle.optimizer.lr import PiecewiseDecay
  from paddle.optimizer.lr import CosineAnnealingDecay
  from paddle.optimizer.lr import ExponentialDecay
  import paddle
  import paddle.regularizer
  from copy import deepcopy
label_desc: Use image node_id 1 for calling a global function with example usage: create_optimizer(config, parameter_list) and returns: opt,  lr