class_docstr: Fast attack against a target internal representation of a model using
  gradient descent (Sabour et al. 2016).
  Paper: https://arxiv.org/abs/1511.05122
  
  :param predict: forward pass function.
  :param loss_fn: loss function.
  :param eps: maximum distortion.
  :param eps_iter: attack step size.
  :param nb_iter: number of iterations
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
class_docstr_tok: ["Fast","attack","against","a","target","internal","representation","of","a","model","using","gradient","descent","(","Sabour","et","al",".","2016",")",".","Paper",":","https",":","\/\/arxiv.org\/abs\/1511.05122",":","param","predict",":","forward","pass","function",".",":","param","loss_fn",":","loss","function",".",":","param","eps",":","maximum","distortion",".",":","param","eps_iter",":","attack","step","size",".",":","param","nb_iter",":","number","of","iterations",":","param","clip_min",":","mininum","value","per","input","dimension",".",":","param","clip_max",":","maximum","value","per","input","dimension","."]
docstr: Given source, returns their adversarial counterparts
  with representations close to that of the guide.
  
  :param source: input tensor which we want to perturb.
  :param guide: targeted input.
  :param delta: tensor contains the random initialization.
  :return: tensor containing perturbed inputs.
docstr_tok: ["Given","source",",","returns","their","adversarial","counterparts","with","representations","close","to","that","of","the","guide",".",":","param","source",":","input","tensor","which","we","want","to","perturb",".",":","param","guide",":","targeted","input",".",":","param","delta",":","tensor","contains","the","random","initialization",".",":","return",":","tensor","containing","perturbed","inputs","."]
code: def perturb(self, source, guide, delta=None):
      """
      Given source, returns their adversarial counterparts
      with representations close to that of the guide.
  
      :param source: input tensor which we want to perturb.
      :param guide: targeted input.
      :param delta: tensor contains the random initialization.
      :return: tensor containing perturbed inputs.
      """
      # Initialization
      if delta is None:
          delta = torch.zeros_like(source)
          if self.rand_init:
              delta = delta.uniform_(-self.eps, self.eps)
      else:
          delta = delta.detach()
  
      delta.requires_grad_()
  
      source = replicate_input(source)
      guide = replicate_input(guide)
      guide_ftr = self.predict(guide).detach()
  
      xadv = perturb_iterative(
          source,
          guide_ftr,
          self.predict,
          self.nb_iter,
          eps_iter=self.eps_iter,
          loss_fn=self.loss_fn,
          minimize=True,
          ord=np.inf,
          eps=self.eps,
          clip_min=self.clip_min,
          clip_max=self.clip_max,
          delta_init=delta,
      )
  
      xadv = clamp(xadv, self.clip_min, self.clip_max)
  
      return xadv.data
  
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 2 for calling the FastFeatureAttack obj's underlying member method code with example usage: obj.perturb(source, guide, delta) and returns: xadv