class_docstr: CAV class contains methods for concept activation vector (CAV).
  
  CAV represents semenatically meaningful vector directions in
  network's embeddings (bottlenecks).
class_docstr_tok: ["CAV","class","contains","methods","for","concept","activation","vector","(","CAV",")",".","CAV","represents","semenatically","meaningful","vector","directions","in","network","'s","embeddings","(","bottlenecks",")","."]
docstr: Make a perturbation of act with a direction of this CAV.
  
  Args:
    act: activations to be perturbed
    concept: the concept to perturb act with.
    operation: the operation will be ran to perturb.
    alpha: size of the step.
  
  Returns:
    perturbed activation: same shape as act
docstr_tok: ["Make","a","perturbation","of","act","with","a","direction","of","this","CAV",".","Args",":","act",":","activations","to","be","perturbed","concept",":","the","concept","to","perturb","act","with",".","operation",":","the","operation","will","be","ran","to","perturb",".","alpha",":","size","of","the","step",".","Returns",":","perturbed","activation",":","same","shape","as","act"]
code: def perturb_act(self, act, concept, operation=np.add, alpha=1.0):
      """Make a perturbation of act with a direction of this CAV.
  
      Args:
        act: activations to be perturbed
        concept: the concept to perturb act with.
        operation: the operation will be ran to perturb.
        alpha: size of the step.
  
      Returns:
        perturbed activation: same shape as act
      """
      flat_act = np.reshape(act, -1)
      pert = operation(flat_act, alpha * self.get_direction(concept))
      return np.reshape(pert, act.shape)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os.path
  import pickle
  import numpy
  from six.moves import range
  from sklearn import linear_model
  from sklearn import metrics
  from sklearn.model_selection import train_test_split
  from tcav import utils
  import tensorflow
label_desc: Use image node_id 8 for calling the CAV obj's underlying member method code with example usage: obj.perturb_act(act, concept, operation, alpha) and returns: np