class_docstr: Limited-memory BFGS (L-BFGS) optimizer.
  
  Performs unconstrained optimization via L-BFGS.
  
  Args:
      max_opt_itr (int): Maximum iteration for update.
      callback (callable): Function to call during optimization.
class_docstr_tok: ["Limited-memory","BFGS","(","L-BFGS",")","optimizer",".","Performs","unconstrained","optimization","via","L-BFGS",".","Args",":","max_opt_itr","(","int",")",":","Maximum","iteration","for","update",".","callback","(","callable",")",":","Function","to","call","during","optimization","."]
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.
      name (str): Name scope.
      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",".","name","(","str",")",":","Name","scope",".","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,
      name="LBFGSOptimizer",
      **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.
          name (str): Name scope.
          kwargs (dict): Extra unused keyword arguments. Some optimizers
              have extra input, e.g. KL constraint.
  
      """
      del kwargs
      self._target = target
      params = target.get_params()
      with tf.name_scope(name):
  
          def get_opt_output():
              """Helper function to construct graph.
  
              Returns:
                  list[tf.Tensor]: Loss and gradient tensor.
  
              """
              with tf.name_scope("get_opt_output"):
                  flat_grad = flatten_tensor_variables(
                      tf.gradients(loss, params)
                  )
                  return [
                      tf.cast(loss, tf.float64),
                      tf.cast(flat_grad, tf.float64),
                  ]
  
          if extra_inputs is None:
              extra_inputs = list()
  
          self._opt_fun = LazyDict(
              f_loss=lambda: compile_function(
                  inputs + extra_inputs, loss
              ),
              f_opt=lambda: compile_function(
                  inputs=inputs + extra_inputs,
                  outputs=get_opt_output(),
              ),
          )
  
file_path: garage/src/garage/tf/optimizers/lbfgs_optimizer.py
imports: import time
  import scipy.optimize
  import tensorflow
  from garage.tf import compile_function, flatten_tensor_variables
  from garage.tf.optimizers._dtypes import LazyDict
label_desc: Use image node_id 2 for calling the LBFGSOptimizer obj's underlying member method code with example usage: obj.update_opt(loss, target, inputs, extra_inputs, name) and returns: list