code: def fmin_golden_search(
      f, minstep=1e-5, maxstep=50.0, maxiter=1024, tol=1e-5
  ):
      """
      Minimize scalar function using Golden Search.
  
      Parameters
      ----------
      f : func
          Function that needs to be minimized. Function has
          to return the scalar.
  
          .. code-block:: python
  
              def f(x):
                  return x ** 2
  
      minstep : float
          Minimum step value. Defaults to ``1e-5``.
  
      maxstep : float
          Maximum step size. Defaults to ``50``.
  
      maxiter : int
          Maximum number of itrations. Defaults to ``1024``.
  
      tol : float
          Defaults to ``1e-5``.
  
      Returns
      -------
      object
          Returns the Tensorfow instance that finally should produce
          best possible step for specified function.
      """
      params = (
          ("maxiter", maxiter),
          ("minstep", minstep),
          ("maxstep", maxstep),
          ("tol", tol),
      )
  
      for param_name, param_value in params:
          if param_value <= 0:
              raise ValueError(
                  "Parameter `{}` should be greater than zero."
                  "".format(param_name)
              )
  
      if minstep >= maxstep:
          raise ValueError("`minstep` should be smaller than `maxstep`")
  
      maxstep = interval_location(f, minstep, maxstep, maxiter)
      best_step = golden_search(f, maxstep, maxiter, tol)
  
      return best_step
  
imports: import math
  import numpy
  import tensorflow
  from neupy.utils import asfloat
label_desc: Use image node_id 3 for calling a global function with example usage: fmin_golden_search(f, minstep, maxstep, maxiter, tol) and returns: best_step