class_docstr: CEM_MAFImageExplainer is a Contrastive Image explainer that leverages Monotonic
  Attribute Functions. The main idea here is to explain images using high level semantically meaningful attributes 
  that may either be directly available or learned through supervised or unsupervised methods. [#]_
  
  References:
      .. [#] `Ronny Luss, Pin-Yu Chen, Amit Dhurandhar, Prasanna Sattigeri,
         Karthikeyan Shanmugam, Chun-Chen Tu, "Generating Contrastive
         Explanations with Monotonic Attribute Functions," 2019.
         <https://arxiv.org/abs/1905.12698>`_
class_docstr_tok: ["CEM_MAFImageExplainer","is","a","Contrastive","Image","explainer","that","leverages","Monotonic","Attribute","Functions",".","The","main","idea","here","is","to","explain","images","using","high","level","semantically","meaningful","attributes","that","may","either","be","directly","available","or","learned","through","supervised","or","unsupervised","methods",".","[","#","]","_","References",":","..","[","#","]","`","Ronny","Luss",",","Pin-Yu","Chen",",","Amit","Dhurandhar",",","Prasanna","Sattigeri",",","Karthikeyan","Shanmugam",",","Chun-Chen","Tu",",","``","Generating","Contrastive","Explanations","with","Monotonic","Attribute","Functions",",","''","2019",".","<","https",":","\/\/arxiv.org\/abs\/1905.12698",">","`","_"]
docstr: Load attribute classifiers and check which attributes in original image x
  are modified in adversarial image y
  
  Args:
      attributes (str list): list of attributes to load attribute classifiers for
      x (numpy.ndarray): original image
      y (numpy.ndarray): adversarial image
  
  Returns:
      str: string detailing which attributes were added to (or removed from)
      x resulting in y
docstr_tok: ["Load","attribute","classifiers","and","check","which","attributes","in","original","image","x","are","modified","in","adversarial","image","y","Args",":","attributes","(","str","list",")",":","list","of","attributes","to","load","attribute","classifiers","for","x","(","numpy.ndarray",")",":","original","image","y","(","numpy.ndarray",")",":","adversarial","image","Returns",":","str",":","string","detailing","which","attributes","were","added","to","(","or","removed","from",")","x","resulting","in","y"]
code: def check_attributes_celebA(self, attributes, x, y):
      """
      Load attribute classifiers and check which attributes in original image x
      are modified in adversarial image y
  
      Args:
          attributes (str list): list of attributes to load attribute classifiers for
          x (numpy.ndarray): original image
          y (numpy.ndarray): adversarial image
  
      Returns:
          str: string detailing which attributes were added to (or removed from)
          x resulting in y
      """
  
      orig_attr_score = np.zeros((len(attributes), 1))
      adv_attr_score = np.zeros((len(attributes), 1))
      for i in range(len(attributes)):
          attr = attributes[i]
          # load json and create model
          json_file_name = (
              "../../aix360/models/CEM_MAF/simple_{}_model.json".format(
                  attr
              )
          )
          json_file = open(json_file_name, "r")
          loaded_model_json = json_file.read()
          json_file.close()
          loaded_model = model_from_json(loaded_model_json)
          # load weights into new model
          weight_file_name = (
              "../../aix360/models/CEM_MAF/simple_{}_weights.h5".format(
                  attr
              )
          )
          loaded_model.load_weights(weight_file_name)
  
          orig_attr_score[i] = loaded_model.predict(x)[0]
          adv_attr_score[i] = loaded_model.predict(y)[0]
  
      # pre-determined thresholds for changes in prediction values
      thresh_pos = np.zeros((len(attributes), 1))
      thresh_pos[0] = 0.15
      thresh_pos[1] = 0.15
      thresh_pos[2] = 0.15
      thresh_pos[3] = 0.15
      thresh_pos[4] = 0.15
      thresh_pos[5] = 0.15
      thresh_pos[6] = 0.1
      thresh_pos[7] = 0.25
      thresh_pos[8] = 0.1
      thresh_pos[9] = 0.15
      thresh_pos[10] = 0.15
      thresh_pos[11] = 0.15
  
      thresh_neg = np.zeros((len(attributes), 1))
      thresh_neg[0] = -0.25
      thresh_neg[1] = -0.25
      thresh_neg[2] = -0.25
      thresh_neg[3] = -0.25
      thresh_neg[4] = -0.35
      thresh_neg[5] = -0.25
      thresh_neg[6] = -0.12
      thresh_neg[7] = -0.25
      thresh_neg[8] = -0.25
      thresh_neg[9] = -0.25
      thresh_neg[10] = -0.25
      thresh_neg[11] = -0.25
  
      changes_abs = adv_attr_score - orig_attr_score
      changes = np.zeros((len(attributes), 1))
      res = ""
      for i in range(len(attributes)):
          if changes_abs[i] >= thresh_pos[i]:
              changes[i] = 1
          elif changes_abs[i] <= thresh_neg[i]:
              changes[i] = -1
      added = np.where(changes == 1)[0]
      for j in range(len(added)):
          res += "Added " + attributes[added[j]] + ","
      removed = np.where(changes[i] == -1)[0]
      for j in range(len(removed)):
          res += "Removed " + attributes[removed[j]] + ","
      return res[:-1]
  
file_path: AIX360/aix360/algorithms/contrastive/CEM_MAF.py
imports: from __future__ import print_function
  from aix360.algorithms.lwbe import LocalWBExplainer
  from aix360.algorithms.contrastive.CEM_MAF_aen_PN import AEADEN
  from aix360.algorithms.contrastive.CEM_MAF_aen_PP import AEADEN
  from tensorflow.contrib.keras.api.keras.models import model_from_json
  import os
  import sys
  import random
  import time
  import numpy
  from skimage.segmentation import slic
label_desc: Use image node_id 4 for calling the CEM_MAFImageExplainer obj's underlying member method code with example usage: obj.check_attributes_celebA(attributes, x, y) and returns: res