class_docstr: This is a modified version of the L_2 optimized attack of Carlini and Wagner (2016). It controls the L_Inf
  norm, i.e. the maximum perturbation applied to each pixel.
docstr: Compute the objective function value.
  
  :param x_adv: An array with the adversarial examples.
  :param target: An array with the target class (one-hot encoded).
  :param x: Benign samples.
  :param  const: Current constant `c`.
  :param tau: Current limit `tau`.
  :return: A tuple of current predictions, total loss, logits loss and regularisation loss.
docstr_tok: ["Compute","the","objective","function","value",".",":","param","x_adv",":","An","array","with","the","adversarial","examples",".",":","param","target",":","An","array","with","the","target","class","(","one-hot","encoded",")",".",":","param","x",":","Benign","samples",".",":","param","const",":","Current","constant","`","c","`",".",":","param","tau",":","Current","limit","`","tau","`",".",":","return",":","A","tuple","of","current","predictions",",","total","loss",",","logits","loss","and","regularisation","loss","."]
code: def _loss(
      self, x_adv: np.ndarray, target: np.ndarray, x, const, tau
  ) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
      """
      Compute the objective function value.
  
      :param x_adv: An array with the adversarial examples.
      :param target: An array with the target class (one-hot encoded).
      :param x: Benign samples.
      :param  const: Current constant `c`.
      :param tau: Current limit `tau`.
      :return: A tuple of current predictions, total loss, logits loss and regularisation loss.
      """
      z_predicted = self.estimator.predict(
          np.array(x_adv, dtype=ART_NUMPY_DTYPE),
          batch_size=self.batch_size,
      )
      z_target = np.sum(z_predicted * target, axis=1)
      z_other = np.max(
          z_predicted * (1 - target)
          + (np.min(z_predicted, axis=1) - 1)[:, np.newaxis] * target,
          axis=1,
      )
  
      if self.targeted:
          # if targeted, optimize for making the target class most likely
          loss_1 = np.maximum(
              z_other - z_target + self.confidence,
              np.zeros(x_adv.shape[0]),
          )
      else:
          # if untargeted, optimize for making any other class most likely
          loss_1 = np.maximum(
              z_target - z_other + self.confidence,
              np.zeros(x_adv.shape[0]),
          )
  
      loss_2 = np.sum(np.maximum(0.0, np.abs(x_adv - x) - tau))
  
      loss = loss_1 * const + loss_2
  
      return z_predicted, loss, loss_1, loss_2
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.optimizers import Adam
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.attacks.attack import EvasionAttack
  from art.utils import compute_success, get_labels_np_array, tanh_to_original, original_to_tanh
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 2 for calling the CarliniLInfMethod obj's underlying member method code with example usage: obj._loss(x_adv, target, x, const, tau) and returns: z_predicted,  loss,  loss_1,  loss_2