class_docstr: The decoupled direction and norm attack (Rony et al, 2018).
  Paper: https://arxiv.org/abs/1811.09600
  
  :param predict: forward pass function.
  :param nb_iter: number of iterations.
  :param gamma: factor to modify the norm at each iteration.
  :param init_norm: initial norm of the perturbation.
  :param quantize: perform quantization at each iteration.
  :param levels: number of quantization levels (e.g. 256 for 8 bit images).
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param targeted: if the attack is targeted.
  :param loss_fn: loss function.
docstr: Decoupled Direction and Norm L2 Attack implementation in pytorch.
docstr_tok: ["Decoupled","Direction","and","Norm","L2","Attack","implementation","in","pytorch","."]
code: def __init__(
      self,
      predict,
      nb_iter=100,
      gamma=0.05,
      init_norm=1.0,
      quantize=True,
      levels=256,
      clip_min=0.0,
      clip_max=1.0,
      targeted=False,
      loss_fn=None,
  ):
      """
      Decoupled Direction and Norm L2 Attack implementation in pytorch.
      """
      if loss_fn is not None:
          import warnings
  
          warnings.warn(
              "This Attack currently does not support a different loss"
              " function other than the default. Setting loss_fn manually"
              " is not effective."
          )
  
      loss_fn = nn.CrossEntropyLoss(reduction="sum")
  
      super(DDNL2Attack, self).__init__(
          predict, loss_fn, clip_min, clip_max
      )
  
      self.nb_iter = nb_iter
      self.gamma = gamma
      self.init_norm = init_norm
      self.quantize = quantize
      self.levels = levels
      self.targeted = targeted
  
file_path: advertorch/advertorch/attacks/decoupled_direction_norm.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import torch
  import torch.nn
  import torch.optim
  from .base import Attack
  from .base import LabelMixin
label_desc: Use image node_id 1 to create a new DDNL2Attack object from inherited base classes: Attack, LabelMixin with example: obj = DDNL2Attack(predict, nb_iter, gamma, init_norm, quantize, levels, clip_min, clip_max, targeted, loss_fn)