docstr: Get the optimizer from tf.keras.optimizers.
docstr_tok: ["Get","the","optimizer","from","tf.keras.optimizers","."]
code: def _get_optimizer(self, optimizer, optim_params):
      """Get the optimizer from tf.keras.optimizers."""
      learning_rate = optim_params.get("lr", 0.001)
      del optim_params["lr"]
  
      if optimizer == "adam":
          optim = tf.keras.optimizers.Adam(
              learning_rate=learning_rate, **optim_params
          )
          status = True
      elif optimizer == "adagrad":
          optim = tf.keras.optimizers.Adagrad(
              learning_rate=learning_rate, **optim_params
          )
          status = True
      elif optimizer == "sgd":
          optim = tf.keras.optimizers.SGD(
              learning_rate=learning_rate, **optim_params
          )
          status = True
      else:
          optim = get_optimizer(optimizer)
          status = False
  
      optim_params["lr"] = learning_rate
      return optim, status
  
imports: import numpy
  import tensorflow
  from ampligraph.latent_features.loss_functions import get
  from ampligraph.latent_features.models import ScoringBasedEmbeddingModel
  from ampligraph.latent_features.optimizers import get
  from ampligraph.latent_features.regularizers import get
label_desc: Use image node_id 2 for calling the ScoringModelBase obj's underlying member method code with example usage: obj._get_optimizer(optimizer, optim_params) and returns: optim,  status