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","."]
code: def __init__(
      self,
      optimizer=None,
      learning_rate=None,
      max_optimization_epochs=1000,
      tolerance=1e-6,
      batch_size=32,
      callback=None,
      verbose=False,
      name="FirstOrderOptimizer",
  ):
      self._opt_fun = None
      self._target = None
      self._callback = callback
      if optimizer is None:
          optimizer = tf.compat.v1.train.AdamOptimizer
      learning_rate = learning_rate or dict(
          learning_rate=_Default(1e-3)
      )
      if not isinstance(learning_rate, dict):
          learning_rate = dict(learning_rate=learning_rate)
  
      self._tf_optimizer = optimizer
      self._learning_rate = learning_rate
      self._max_optimization_epochs = max_optimization_epochs
      self._tolerance = tolerance
      self._batch_size = batch_size
      self._verbose = verbose
      self._input_vars = None
      self._train_op = None
      self._name = name
  
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 1 to create a new FirstOrderOptimizer object  with example: obj = FirstOrderOptimizer(optimizer, learning_rate, max_optimization_epochs, tolerance, batch_size, callback, verbose, name)