class_docstr: Runs GenAttack https://arxiv.org/abs/1805.11090
  
  Disclaimers: Note that GenAttack assumes the model outputs
  normalized probabilities.  Moreover, computations are broadcasted,
  so it is advisable to use smaller batch sizes when nb_samples is
  large.
  
  Hyperparams: alpha (mutation range), rho (mutation probability),
  and tau (temperature) all control exploration.
  
  Alpha and rho are adapted using GenAttackScheduler.
  
  :param predict: forward pass function.
  :param eps: maximum distortion.
  :param order: the order of maximum distortion (inf or 2)
  :param loss_fn: loss function (default None, GenAttack uses its own loss)
  :param nb_samples: population size (default 100)
  :param nb_iter: number of iterations (default 40)
  :param tau: sampling temperature (default 0.1)
  :param alpha_init: initial mutation range (default 0.4)
  :param rho_init: initial probability for mutation (default 0.5)
  :param decay: decay param for scheduler (default 0.9)
  :param clip_min: mininum value per input dimension (default 0.)
  :param clip_max: mininum value per input dimension (default 1.)
  :param targeted: if the attack is targeted (default False)
code: def __init__(
      self,
      predict,
      eps: float,
      order,
      loss_fn=None,
      nb_samples=100,
      nb_iter=40,
      tau=0.1,
      alpha_init=0.4,
      rho_init=0.5,
      decay=0.9,
      clip_min=0.0,
      clip_max=1.0,
      targeted: bool = False,
  ):
      if loss_fn is not None:
          import warnings
  
          warnings.warn(
              "This Attack currently do not support a different loss"
              " function other than the default. Setting loss_fn manually"
              " is not effective."
          )
  
      super().__init__(predict, gen_attack_score, clip_min, clip_max)
  
      self.eps = eps
      self.order = order
      self.nb_samples = nb_samples
      self.nb_iter = nb_iter
      self.targeted = targeted
  
      self.alpha_init = alpha_init
      self.rho_init = rho_init
      self.decay = decay
      self.tau = tau
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from typing import Optional
  from math import inf
  import torch
  import torch.nn.functional
  from advertorch.attacks.base import Attack
  from advertorch.attacks.base import LabelMixin
  from .utils import _check_param, _flatten, _make_projector
label_desc: Use image node_id 1 to create a new GenAttack object from inherited base classes: Attack, LabelMixin with example: obj = GenAttack(predict, eps, order, loss_fn, nb_samples, nb_iter, tau, alpha_init, rho_init, decay, clip_min, clip_max, targeted)