class_docstr: The Linf Momentum Iterative Attack
  Paper: https://arxiv.org/pdf/1710.06081.pdf
  
  :param predict: forward pass function.
  :param loss_fn: loss function.
  :param eps: maximum distortion.
  :param nb_iter: number of iterations
  :param decay_factor: momentum decay factor.
  :param eps_iter: attack step size.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param targeted: if the attack is targeted.
class_docstr_tok: ["The","Linf","Momentum","Iterative","Attack","Paper",":","https",":","\/\/arxiv.org\/pdf\/1710.06081.pdf",":","param","predict",":","forward","pass","function",".",":","param","loss_fn",":","loss","function",".",":","param","eps",":","maximum","distortion",".",":","param","nb_iter",":","number","of","iterations",":","param","decay_factor",":","momentum","decay","factor",".",":","param","eps_iter",":","attack","step","size",".",":","param","clip_min",":","mininum","value","per","input","dimension",".",":","param","clip_max",":","maximum","value","per","input","dimension",".",":","param","targeted",":","if","the","attack","is","targeted","."]
docstr: Create an instance of the MomentumIterativeAttack.
docstr_tok: ["Create","an","instance","of","the","MomentumIterativeAttack","."]
code: def __init__(
      self,
      predict,
      loss_fn=None,
      eps=0.3,
      nb_iter=40,
      decay_factor=1.0,
      eps_iter=0.01,
      clip_min=0.0,
      clip_max=1.0,
      targeted=False,
  ):
      """Create an instance of the MomentumIterativeAttack."""
      ord = np.inf
      super(LinfMomentumIterativeAttack, self).__init__(
          predict,
          loss_fn,
          eps,
          nb_iter,
          decay_factor,
          eps_iter,
          clip_min,
          clip_max,
          targeted,
          ord,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import torch
  import torch.nn
  from advertorch.utils import clamp
  from advertorch.utils import normalize_by_pnorm
  from advertorch.utils import clamp_by_pnorm
  from advertorch.utils import is_float_or_torch_tensor
  from advertorch.utils import batch_multiply
  from advertorch.utils import batch_clamp
  from advertorch.utils import replicate_input
  from advertorch.utils import batch_l1_proj
  from .base import Attack
  from .base import LabelMixin
  from .utils import rand_init_delta
label_desc: Use image node_id 1 to create a new LinfMomentumIterativeAttack object from inherited base classes: MomentumIterativeAttack with example: obj = LinfMomentumIterativeAttack(predict, loss_fn, eps, nb_iter, decay_factor, eps_iter, clip_min, clip_max, targeted)