class_docstr: Wrapper around tensorflow optimizer.
class_docstr_tok: ["Wrapper","around","tensorflow","optimizer","."]
docstr: Initialize the tensorflow Optimizer and wraps it so that it can be used with graph partitioning.
  
  Parameters
  ----------
  optimizer: str (name of optimizer) or optimizer instance.
      See `tf.keras.optimizers <https://www.tensorflow.org/api_docs/python/tf/keras/optimizers>`.
docstr_tok: ["Initialize","the","tensorflow","Optimizer","and","wraps","it","so","that","it","can","be","used","with","graph","partitioning",".","Parameters","--","--","--","--","--","optimizer",":","str","(","name","of","optimizer",")","or","optimizer","instance",".","See","`","tf.keras.optimizers","<","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/keras\/optimizers",">","`","."]
code: def __init__(self, optimizer=None):
      """Initialize the tensorflow Optimizer and wraps it so that it can be used with graph partitioning.
  
      Parameters
      ----------
      optimizer: str (name of optimizer) or optimizer instance.
          See `tf.keras.optimizers <https://www.tensorflow.org/api_docs/python/tf/keras/optimizers>`.
      """
      self.optimizer = optimizer
      self.num_optimized_vars = 0
      # number of optimizer hpyerparams - adam has 2 if amsgrad is false
      self.number_hyperparams = 1
      self.is_partitioned_training = False
  
      # workaround for Adagrad/Adadelta/Ftrl optimizers to work on gpu
      self.gpu_workaround = False
      if (
          isinstance(self.optimizer, tf.keras.optimizers.Adadelta)
          or isinstance(self.optimizer, tf.keras.optimizers.Adagrad)
          or isinstance(self.optimizer, tf.keras.optimizers.Ftrl)
      ):
          self.gpu_workaround = True
  
      if isinstance(self.optimizer, tf.keras.optimizers.Adam):
          self.number_hyperparams = 2
  
file_path: AmpliGraph/ampligraph/latent_features/optimizers.py
imports: import abc
  import logging
  import six
  import tensorflow
label_desc: Use image node_id 1 to create a new OptimizerWrapper object from inherited base classes: abc with example: obj = OptimizerWrapper(optimizer)