class_docstr: The black-box zeroth-order optimization attack from Pin-Yu Chen et al. (2018). This attack is a variant of the
  C&W attack which uses ADAM coordinate descent to perform numerical estimation of gradients.
  
  | Paper link: https://arxiv.org/abs/1708.03999
class_docstr_tok: ["The","black-box","zeroth-order","optimization","attack","from","Pin-Yu","Chen","et","al",".","(","2018",")",".","This","attack","is","a","variant","of","the","C","&","W","attack","which","uses","ADAM","coordinate","descent","to","perform","numerical","estimation","of","gradients",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1708.03999"]
docstr: Update constant `c_batch` from the ZOO objective. This characterizes the trade-off between attack strength and
  amount of noise introduced.
  
  :param y_batch: A batch of targets (0-1 hot).
  :param best_label: A batch of best labels.
  :param c_batch: A batch of constants.
  :param c_lower_bound: A batch of lower bound constants.
  :param c_upper_bound: A batch of upper bound constants.
  :return: A tuple of three batches of updated constants and lower/upper bounds.
docstr_tok: ["Update","constant","`","c_batch","`","from","the","ZOO","objective",".","This","characterizes","the","trade-off","between","attack","strength","and","amount","of","noise","introduced",".",":","param","y_batch",":","A","batch","of","targets","(","0-1","hot",")",".",":","param","best_label",":","A","batch","of","best","labels",".",":","param","c_batch",":","A","batch","of","constants",".",":","param","c_lower_bound",":","A","batch","of","lower","bound","constants",".",":","param","c_upper_bound",":","A","batch","of","upper","bound","constants",".",":","return",":","A","tuple","of","three","batches","of","updated","constants","and","lower\/upper","bounds","."]
code: def _update_const(
      self,
      y_batch: np.ndarray,
      best_label: np.ndarray,
      c_batch: np.ndarray,
      c_lower_bound: np.ndarray,
      c_upper_bound: np.ndarray,
  ) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
      """
      Update constant `c_batch` from the ZOO objective. This characterizes the trade-off between attack strength and
      amount of noise introduced.
  
      :param y_batch: A batch of targets (0-1 hot).
      :param best_label: A batch of best labels.
      :param c_batch: A batch of constants.
      :param c_lower_bound: A batch of lower bound constants.
      :param c_upper_bound: A batch of upper bound constants.
      :return: A tuple of three batches of updated constants and lower/upper bounds.
      """
  
      comparison = [
          self._compare(best_label[i], np.argmax(y_batch[i]))
          and best_label[i] != -np.inf
          for i in range(len(c_batch))
      ]
      for i, comp in enumerate(comparison):
          if comp:
              # Successful attack
              c_upper_bound[i] = min(c_upper_bound[i], c_batch[i])
              if c_upper_bound[i] < 1e9:
                  c_batch[i] = (c_lower_bound[i] + c_upper_bound[i]) / 2
          else:
              # Failure attack
              c_lower_bound[i] = max(c_lower_bound[i], c_batch[i])
              c_batch[i] = (
                  (c_lower_bound[i] + c_upper_bound[i]) / 2
                  if c_upper_bound[i] < 1e9
                  else c_batch[i] * 10
              )
  
      return c_batch, c_lower_bound, c_upper_bound
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, Any, TYPE_CHECKING
  import numpy
  from scipy.ndimage import zoom
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 5 for calling the ZooAttack obj's underlying member method code with example usage: obj._update_const(y_batch, best_label, c_batch, c_lower_bound, c_upper_bound) and returns: c_batch,  c_lower_bound,  c_upper_bound