class_docstr: Implementation of Completeness test by Kindermans et al., 2017.
  
  To test for input invariance, we add a constant shift to the input data and a mean shift to the model bias,
  so that the output of the original model on the original data is equal to the output of the changed model
  on the shifted data. The metric returns True if batch attributions stayed unchanged too. Currently only
  supporting constant values for the shift.
  
  References:
      Pieter-Jan Kindermans et al.: "The (Un)reliability of Saliency Methods." Explainable AI (2019): 267-280
  
  Attributes:
      -  _name: The name of the metric.
      - _data_applicability: The data types that the metric implementation currently supports.
      - _models: The model types that this metric can work with.
      - score_direction: How to interpret the scores, whether higher/ lower values are considered better.
class_docstr_tok: ["Implementation","of","Completeness","test","by","Kindermans","et","al.",",","2017",".","To","test","for","input","invariance",",","we","add","a","constant","shift","to","the","input","data","and","a","mean","shift","to","the","model","bias",",","so","that","the","output","of","the","original","model","on","the","original","data","is","equal","to","the","output","of","the","changed","model","on","the","shifted","data",".","The","metric","returns","True","if","batch","attributions","stayed","unchanged","too",".","Currently","only","supporting","constant","values","for","the","shift",".","References",":","Pieter-Jan","Kindermans","et","al",".",":","``","The","(","Un",")","reliability","of","Saliency","Methods",".","''","Explainable","AI","(","2019",")",":","267-280","Attributes",":","-","_name",":","The","name","of","the","metric",".","-","_data_applicability",":","The","data","types","that","the","metric","implementation","currently","supports",".","-","_models",":","The","model","types","that","this","metric","can","work","with",".","-","score_direction",":","How","to","interpret","the","scores",",","whether","higher\/","lower","values","are","considered","better","."]
docstr: Additional explain_func assert, as the one in prepare() won't be executed when `a_batch != None.`
docstr_tok: ["Additional","explain_func","assert",",","as","the","one","in","prepare","(",")","wo","n't","be","executed","when","`","a_batch","!","=","None.","`"]
code: def custom_preprocess(self, **kwargs) -> None:
      """Additional explain_func assert, as the one in prepare() won't be executed when `a_batch != None.`"""
      asserts.assert_explain_func(explain_func=self.explain_func)
  
file_path: Quantus/quantus/metrics/axiomatic/input_invariance.py
imports: import sys
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  from quantus.functions.perturb_func import baseline_replacement_by_shift, perturb_batch
  from quantus.helpers import asserts, warn
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.helpers.perturbation_utils import make_perturb_func
  from quantus.metrics.base import Metric
label_desc: Use image node_id 4 for calling the InputInvariance obj's underlying member method code with example usage: obj.custom_preprocess() without return types