code: def generate_PP(
      self, img_mask, orig_img, orig_class, model, mask_size, mask_mat
  ):
      def model_prediction(model, inputs):
          prob = model.model.predict(inputs)
          predicted_class = np.argmax(prob)
          prob_str = np.array2string(prob).replace("\n", "")
          return prob, predicted_class, prob_str  # ranking
  
      success = False
      print("Start ranking:")
      mask_vec = img_mask.reshape(-1)
      sort_idx = np.argsort(mask_vec)
      total_nonezero = len(np.argsort(mask_vec > 0))
      working_mask = np.zeros((1,) + (mask_size, mask_size) + (1,))
      for i in range(1, total_nonezero):
          temp_index = sort_idx[-i]
          mask_position = np.argwhere(mask_mat[temp_index] == 1)
          for index in mask_position:
              working_mask[(0,) + tuple(index) + (0,)] = 1
          adv_img = working_mask * orig_img
          img_prob, img_class, img_prob_str = model_prediction(
              model, adv_img
          )
          print(
              "i:{}, index:{}, value:{}, class:{}".format(
                  i, temp_index, mask_vec[temp_index], img_class
              )
          )
          if img_class == orig_class:
              success = True
              break
  
      return adv_img, success
  
file_path: AIX360/aix360/algorithms/contrastive/CEM_MAF_aen_PP.py
imports: import sys, os
  import tensorflow
  import numpy
  from tensorflow.contrib.keras.api.keras.models import Model, Sequential, model_from_json
  from tensorflow.contrib.keras.api.keras.callbacks import ModelCheckpoint
label_desc: Use image node_id 3 for calling the AEADEN obj's underlying member method code with example usage: obj.generate_PP(img_mask, orig_img, orig_class, model, mask_size, mask_mat) and returns: adv_img,  success, prob,  predicted_class,  prob_str