class_docstr: Implements the Saliency Map Attack.
  The Jacobian-based Saliency Map Approach (Papernot et al. 2016).
  Paper link: https://arxiv.org/pdf/1511.07528.pdf
class_docstr_tok: ["Implements","the","Saliency","Map","Attack",".","The","Jacobian-based","Saliency","Map","Approach","(","Papernot","et","al",".","2016",")",".","Paper","link",":","https",":","\/\/arxiv.org\/pdf\/1511.07528.pdf"]
docstr: Draw random target labels all of which are different and not the original label.
  Args:
      original_label(int): Original label.
  Return:
      target_labels(list): random target labels
docstr_tok: ["Draw","random","target","labels","all","of","which","are","different","and","not","the","original","label",".","Args",":","original_label","(","int",")",":","Original","label",".","Return",":","target_labels","(","list",")",":","random","target","labels"]
code: def _generate_random_target(self, original_label):
      """
      Draw random target labels all of which are different and not the original label.
      Args:
          original_label(int): Original label.
      Return:
          target_labels(list): random target labels
      """
      num_random_target = 1
      num_classes = self.model.num_classes()
      assert num_random_target <= num_classes - 1
  
      target_labels = random.sample(
          list(range(num_classes)), num_random_target + 1
      )
      target_labels = [t for t in target_labels if t != original_label]
      target_labels = target_labels[:num_random_target]
  
      return target_labels
  
file_path: AdvBox/adversarialbox/attacks/saliency.py
imports: from __future__ import division
  from builtins import range
  import logging
  import random
  import numpy
  from .base import Attack
label_desc: Use image node_id 2 for calling the SaliencyMapAttack obj's underlying member method code with example usage: obj._generate_random_target(original_label) and returns: target_labels