class_docstr: Implements NES Attack https://arxiv.org/abs/1804.08598
  
  Employs Natural Evolutionary Strategies for Gradient Estimation.
  Generates Adversarial Examples using Projected Gradient Descent.
  
  Disclaimer: Computations are broadcasted, so it is advisable to use
  smaller batch sizes when nb_samples is large.
  
  :param predict: forward pass function.
  :param loss_fn: loss function.
  :param eps: maximum distortion.
  :param nb_samples: number of samples to use for gradient estimation
  :param fd_eta: step-size used for Finite Difference gradient estimation
  :param nb_iter: number of iterations.
  :param eps_iter: attack step size.
  :param rand_init: (optional bool) random initialization.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param targeted: if the attack is targeted.
code: def __init__(
      self,
      predict,
      loss_fn=None,
      eps=0.3,
      nb_samples=100,
      fd_eta=1e-2,
      nb_iter=40,
      eps_iter=0.01,
      rand_init=True,
      clip_min=0.0,
      clip_max=1.0,
      targeted=False,
  ):
      super(NESAttack, self).__init__(
          predict=predict,
          loss_fn=loss_fn,
          eps=eps,
          nb_iter=nb_iter,
          eps_iter=eps_iter,
          rand_init=rand_init,
          clip_min=clip_min,
          clip_max=clip_max,
          targeted=targeted,
      )
  
      self.nb_samples = nb_samples
      self.fd_eta = fd_eta
  
file_path: advertorch/advertorch/attacks/blackbox/iterative_gradient_approximation.py
imports: import torch
  import torch.nn
  from advertorch.utils import clamp
  from advertorch.attacks.utils import rand_init_delta
  from advertorch.attacks.iterative_projected_gradient import LinfPGDAttack
  from advertorch.attacks.iterative_projected_gradient import perturb_iterative
  from .estimators import NESWrapper
  from .utils import _flatten
label_desc: Use image node_id 1 to create a new NESAttack object from inherited base classes: LinfPGDAttack with example: obj = NESAttack(predict, loss_fn, eps, nb_samples, fd_eta, nb_iter, eps_iter, rand_init, clip_min, clip_max, targeted)