class_docstr: Uses Adam to minimize the CW L2 objective function
  
  Paper link: https://arxiv.org/abs/1608.04644
class_docstr_tok: ["Uses","Adam","to","minimize","the","CW","L2","objective","function","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1608.04644"]
docstr: use CW attack on an original image for a
  limited number of iterations
  :return l2, img_adv
docstr_tok: ["use","CW","attack","on","an","original","image","for","a","limited","number","of","iterations",":","return","l2",",","img_adv"]
code: def _cwb(self, img, c, attack_steps):
      """
      use CW attack on an original image for a
      limited number of iterations
      :return l2, img_adv
      """
      smallest_l2 = None
      corresponding_constrained = None
      # inital data
      screen_nontarget_logit = np.zeros(
          shape=[self._dim], dtype="float32"
      )
      screen_nontarget_logit[self._adversary.target_label] = 1
  
      feeder = fluid.DataFeeder(
          feed_list=["img_data_scaled", "target", "c"],
          place=self.place,
          program=self.attack_main_program,
      )
  
      # img normalization
      img_0_1 = self._process_input(img)
      # calculate adv and l2
      for i in range(attack_steps):
          result = self.exe.run(
              self.attack_main_program,
              feed=feeder.feed([(img_0_1, screen_nontarget_logit, c)]),
              fetch_list=[
                  self.constrained,
                  self.distance_L2,
                  self.loss,
                  self.logits,
                  self.softmax,
              ],
          )
  
          pred = result[3][0]
          pre_index = np.argmax(pred)
          softmax = result[4][0]
          l2 = result[1][0]
  
          # logging.info("distance_L2:{} pred:{} softmax:{}".format(l2,pre_index,softmax[pre_index]))
          # Validation using inference models
          adv_label, adv_score = self._predict_adv(result[0])
          logging.info(
              "distance_L2:{} pred:{} softmax:{}".format(
                  l2, adv_label, adv_score
              )
          )
  
          if (
              adv_label == self._adversary.target_label
              and adv_score > self.confidence
          ):
              if smallest_l2 == None or l2 < smallest_l2:
                  smallest_l2 = l2
                  corresponding_constrained = result[0]
          ######
      # output result for this c
      if smallest_l2 != None:
          adv_label, adv_score = self._predict_adv(
              corresponding_constrained
          )
          print("Checking if {0:f} is a successful c.".format(c))
          print(
              "label:{} softmax:{} L2:{}".format(
                  adv_label, adv_score, smallest_l2
              )
          )
      else:
          print("Checking if {0:f} is a unsuccessful c.".format(c))
  
      return smallest_l2, corresponding_constrained
  
file_path: AdvBox/adversarialbox/attacks/cw.py
imports: from __future__ import division
  from __future__ import print_function
  from builtins import range
  import logging
  import numpy
  import paddle.fluid
  from .base import Attack
label_desc: Use image node_id 3 for calling the CW_L2_Attack obj's underlying member method code with example usage: obj._cwb(img, c, attack_steps) and returns: smallest_l2,  corresponding_constrained