code: def optimizer_factory(model_parameter, optimizer_type, optim_params):
      optimizer_params = optim_params
  
      if optimizer_type == "adadelta":
          return torch.optim.Adadelta(
              model_parameter, **optimizer_params
          )
      elif optimizer_type == "adagrad":
          return torch.optim.Adagrad(
              model_parameter, **optimizer_params
          )
      elif optimizer_type == "adam":
          return torch.optim.Adam(model_parameter, **optimizer_params)
      elif optimizer_type == "adamw":
          return torch.optim.AdamW(model_parameter, **optimizer_params)
      elif optimizer_type == "adamax":
          return torch.optim.Adamax(model_parameter, **optimizer_params)
      elif optimizer_type == "asgd":
          return torch.optim.ASGD(model_parameter, **optimizer_params)
      elif optimizer_type == "nadam":
          return torch.optim.NAdam(model_parameter, **optimizer_params)
      elif optimizer_type == "radam":
          return torch.optim.RAdam(model_parameter, **optimizer_params)
      elif optimizer_type == "rmsprop":
          return torch.optim.RMSprop(
              model_parameter, **optimizer_params
          )
      elif optimizer_type == "rprop":
          return torch.optim.Rprop(model_parameter, **optimizer_params)
      elif optimizer_type == "sgd":
          return torch.optim.SGD(model_parameter, **optimizer_params)
      else:
          raise NotImplementedError(
              "Optimize method cannot be recognized: {}".format(
                  optimizer_type
              )
          )
  
imports: import logging
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: optimizer_factory(model_parameter, optimizer_type, optim_params) and returns: torch, torch, torch, torch, torch, torch, torch, torch, torch, torch, torch