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: Perform optimization.
  
  Args:
      inputs (list[numpy.ndarray]): List of input values.
      extra_inputs (list[numpy.ndarray]): List of extra input values.
      name (str): Name scope.
  
  Raises:
      Exception: If loss function is None, i.e. not defined.
docstr_tok: ["Perform","optimization",".","Args",":","inputs","(","list","[","numpy.ndarray","]",")",":","List","of","input","values",".","extra_inputs","(","list","[","numpy.ndarray","]",")",":","List","of","extra","input","values",".","name","(","str",")",":","Name","scope",".","Raises",":","Exception",":","If","loss","function","is","None",",","i.e",".","not","defined","."]
code: def optimize(self, inputs, extra_inputs=None, name="optimize"):
      """Perform optimization.
  
      Args:
          inputs (list[numpy.ndarray]): List of input values.
          extra_inputs (list[numpy.ndarray]): List of extra input values.
          name (str): Name scope.
  
      Raises:
          Exception: If loss function is None, i.e. not defined.
  
      """
      if self._opt_fun is None:
          raise Exception(
              "Use update_opt() to setup the loss function first."
          )
  
      with tf.name_scope(name):
          f_opt = self._opt_fun["f_opt"]
  
          if extra_inputs is None:
              extra_inputs = list()
  
          def f_opt_wrapper(flat_params):
              """Helper function to set parameters values.
  
              Args:
                  flat_params (numpy.ndarray): Flattened parameter values.
  
              Returns:
                  list[tf.Tensor]: Loss and gradient tensor.
  
              """
              self._target.set_param_values(flat_params)
              ret = f_opt(*inputs)
              return ret
  
          itr = [0]
          start_time = time.time()
  
          if self._callback:
  
              def opt_callback(params):
                  """Callback function wrapper.
  
                  Args:
                      params (numpy.ndarray): Parameters.
  
                  """
                  loss = self._opt_fun["f_loss"](
                      *(inputs + extra_inputs)
                  )
                  elapsed = time.time() - start_time
                  self._callback(
                      dict(
                          loss=loss,
                          params=params,
                          itr=itr[0],
                          elapsed=elapsed,
                      )
                  )
                  itr[0] += 1
  
          else:
              opt_callback = None
  
          scipy.optimize.fmin_l_bfgs_b(
              func=f_opt_wrapper,
              x0=self._target.get_param_values(),
              maxiter=self._max_opt_itr,
              callback=opt_callback,
          )
  
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 4 for calling the LBFGSOptimizer obj's underlying member method code with example usage: obj.optimize(inputs, extra_inputs, name) and returns: ret