class_docstr: Uses L-BFGS-B to minimize the cross-entropy and the distance between the
  original and the adversary.
  
  Paper link: https://arxiv.org/abs/1510.05328
class_docstr_tok: ["Uses","L-BFGS-B","to","minimize","the","cross-entropy","and","the","distance","between","the","original","and","the","adversary",".","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1510.05328"]
code: def _lbfgsb(self, x0, c, maxiter):
      min_, max_ = self.model.bounds()
      bounds = [(min_, max_)] * len(x0)
      approx_grad_eps = (max_ - min_) / 100.0
      x, f, d = fmin_l_bfgs_b(
          self._loss,
          x0,
          args=(c,),
          bounds=bounds,
          maxiter=maxiter,
          epsilon=approx_grad_eps,
      )
      if np.amax(x) > max_ or np.amin(x) < min_:
          x = np.clip(x, min_, max_)
      shape = self._adversary.original.shape
      adv_label = np.argmax(self.model.predict(x.reshape(shape)))
      logging.info(
          "pre_label = {}, adv_label={}".format(
              self._adversary.target_label, adv_label
          )
      )
      return self._adversary.try_accept_the_example(
          x.reshape(shape), adv_label
      )
  
file_path: AdvBox/adversarialbox/attacks/lbfgs.py
imports: from __future__ import division
  from builtins import range
  import logging
  import numpy
  from scipy.optimize import fmin_l_bfgs_b
  from .base import Attack
label_desc: Use image node_id 5 for calling the LBFGSAttack obj's underlying member method code with example usage: obj._lbfgsb(x0, c, maxiter) and returns: self