code: def get_optimizer(params, *args):
      """Get optimizer."""
      learning_rate = learning_rate_schedule(params, *args)
  
      if params["optimizer"].lower() == "sgd":
          logging.info("Use SGD optimizer")
          optimizer = tf.keras.optimizers.legacy.SGD(
              learning_rate, momentum=params["momentum"]
          )
      elif params["optimizer"].lower() == "adam":
          logging.info("Use Adam optimizer")
          optimizer = tf.keras.optimizers.legacy.Adam(learning_rate)
      else:
          raise ValueError("optimizers should be adam or sgd")
      return optimizer
  
file_path: DALI/docs/examples/use_cases/tensorflow/efficientdet/model/utils/optimizers.py
imports: from absl import logging
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: get_optimizer(params) and returns: optimizer