class_docstr: First order optimier.
  
  Performs (stochastic) gradient descent, possibly using fancier methods like
  ADAM etc.
  
  Args:
      optimizer (tf.Optimizer): Optimizer to be used.
      learning_rate (dict): learning rate arguments.
          learning rates are our main interest parameters to tune optimizers.
      max_optimization_epochs (int): Maximum number of epochs for update.
      tolerance (float): Tolerance for difference in loss during update.
      batch_size (int): Batch size for optimization.
      callback (callable): Function to call during each epoch. Default is
          None.
      verbose (bool): If true, intermediate log message will be printed.
      name (str): Name scope of the optimizer.
class_docstr_tok: ["First","order","optimier",".","Performs","(","stochastic",")","gradient","descent",",","possibly","using","fancier","methods","like","ADAM","etc",".","Args",":","optimizer","(","tf.Optimizer",")",":","Optimizer","to","be","used",".","learning_rate","(","dict",")",":","learning","rate","arguments",".","learning","rates","are","our","main","interest","parameters","to","tune","optimizers",".","max_optimization_epochs","(","int",")",":","Maximum","number","of","epochs","for","update",".","tolerance","(","float",")",":","Tolerance","for","difference","in","loss","during","update",".","batch_size","(","int",")",":","Batch","size","for","optimization",".","callback","(","callable",")",":","Function","to","call","during","each","epoch",".","Default","is","None",".","verbose","(","bool",")",":","If","true",",","intermediate","log","message","will","be","printed",".","name","(","str",")",":","Name","scope","of","the","optimizer","."]
docstr: Construct operation graph for the optimizer.
  
  Args:
      loss (tf.Tensor): Loss objective to minimize.
      target (object): Target object to optimize. The object should
          implemenet `get_params()` and `get_param_values`.
      inputs (list[tf.Tensor]): List of input placeholders.
      extra_inputs (list[tf.Tensor]): List of extra input placeholders.
      kwargs (dict): Extra unused keyword arguments. Some optimizers
          have extra input, e.g. KL constraint.
docstr_tok: ["Construct","operation","graph","for","the","optimizer",".","Args",":","loss","(","tf.Tensor",")",":","Loss","objective","to","minimize",".","target","(","object",")",":","Target","object","to","optimize",".","The","object","should","implemenet","`","get_params","(",")","`","and","`","get_param_values","`",".","inputs","(","list","[","tf.Tensor","]",")",":","List","of","input","placeholders",".","extra_inputs","(","list","[","tf.Tensor","]",")",":","List","of","extra","input","placeholders",".","kwargs","(","dict",")",":","Extra","unused","keyword","arguments",".","Some","optimizers","have","extra","input",",","e.g",".","KL","constraint","."]
code: def update_opt(
      self, loss, target, inputs, extra_inputs=None, **kwargs
  ):
      """Construct operation graph for the optimizer.
  
      Args:
          loss (tf.Tensor): Loss objective to minimize.
          target (object): Target object to optimize. The object should
              implemenet `get_params()` and `get_param_values`.
          inputs (list[tf.Tensor]): List of input placeholders.
          extra_inputs (list[tf.Tensor]): List of extra input placeholders.
          kwargs (dict): Extra unused keyword arguments. Some optimizers
              have extra input, e.g. KL constraint.
  
      """
      del kwargs
      with tf.name_scope(self._name):
          self._target = target
          tf_optimizer = make_optimizer(
              self._tf_optimizer, **self._learning_rate
          )
          self._train_op = tf_optimizer.minimize(
              loss, var_list=target.get_params()
          )
  
          if extra_inputs is None:
              extra_inputs = list()
          self._input_vars = inputs + extra_inputs
          self._opt_fun = LazyDict(
              f_loss=lambda: compile_function(
                  inputs + extra_inputs, loss
              ),
          )
  
file_path: garage/src/garage/tf/optimizers/first_order_optimizer.py
imports: import time
  import click
  from dowel import logger
  import tensorflow
  from garage import _Default, make_optimizer
  from garage.np.optimizers import BatchDataset
  from garage.tf import compile_function
  from garage.tf.optimizers._dtypes import LazyDict
label_desc: Use image node_id 2 for calling the FirstOrderOptimizer obj's underlying member method code with example usage: obj.update_opt(loss, target, inputs, extra_inputs) without return types