docstr: Initializes gradient-based TensorFLow optimizers.
docstr_tok: ["Initializes","gradient-based","TensorFLow","optimizers","."]
code: def do_optimizer_initializations(self, optimizer, learning_rate):
      """Initializes gradient-based TensorFLow optimizers."""
      opt_method = optimizer.split(":")[1]
  
      # optimizater initialization
      if opt_method == "adam":
          self.optimizer = tf.compat.v1.train.AdamOptimizer(
              learning_rate=learning_rate
          )
      elif opt_method == "rmsprop":
          self.optimizer = tf.compat.v1.train.RMSPropOptimizer(
              learning_rate=learning_rate
          )
  
imports: import copy
  import random
  import timeit
  import numpy
  import tensorflow
  from dice_ml import diverse_counterfactuals
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
label_desc: Use image node_id 8 for calling the DiceTensorFlow2 obj's underlying member method code with example usage: obj.do_optimizer_initializations(optimizer, learning_rate) without return types