class_docstr: Implementation of the top-k intersection by Theiner et al., 2021.
  
  The TopKIntersection implements the pixel-wise intersection between a ground truth target object mask and
  an "explainer" mask, the binarized version of the explanation. High scores are desired, as the
  overlap between the ground truth object mask and the attribution mask should be maximal.
  
  References:
      1) Jonas Theiner et al.: "Interpretable Semantic Photo
      Geolocalization." arXiv preprint arXiv:2104.14995 (2021).
  
  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.
      - evaluation_category: What property/ explanation quality that this metric measures.
class_docstr_tok: ["Implementation","of","the","top-k","intersection","by","Theiner","et","al.",",","2021",".","The","TopKIntersection","implements","the","pixel-wise","intersection","between","a","ground","truth","target","object","mask","and","an","``","explainer","''","mask",",","the","binarized","version","of","the","explanation",".","High","scores","are","desired",",","as","the","overlap","between","the","ground","truth","object","mask","and","the","attribution","mask","should","be","maximal",".","References",":","1",")","Jonas","Theiner","et","al",".",":","``","Interpretable","Semantic","Photo","Geolocalization",".","''","arXiv","preprint","arXiv:2104.14995","(","2021",")",".","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",".","-","evaluation_category",":","What","property\/","explanation","quality","that","this","metric","measures","."]
docstr: Implementation of custom_preprocess_batch.
  
  Parameters
  ----------
  x_batch: np.ndarray
      A np.ndarray which contains the input data that are explained.
  a_batch: np.ndarray, optional
      A np.ndarray which contains pre-computed attributions i.e., explanations.
  kwargs:
      Unused.
  
  Returns
  -------
  None
docstr_tok: ["Implementation","of","custom_preprocess_batch",".","Parameters","--","--","--","--","--","x_batch",":","np.ndarray","A","np.ndarray","which","contains","the","input","data","that","are","explained",".","a_batch",":","np.ndarray",",","optional","A","np.ndarray","which","contains","pre-computed","attributions","i.e.",",","explanations",".","kwargs",":","Unused",".","Returns","--","--","--","-","None"]
code: def custom_preprocess(
      self, x_batch: np.ndarray, s_batch: np.ndarray, **kwargs
  ) -> None:
      """
      Implementation of custom_preprocess_batch.
  
      Parameters
      ----------
      x_batch: np.ndarray
          A np.ndarray which contains the input data that are explained.
      a_batch: np.ndarray, optional
          A np.ndarray which contains pre-computed attributions i.e., explanations.
      kwargs:
          Unused.
  
      Returns
      -------
      None
      """
      # Asserts.
      asserts.assert_segmentations(x_batch=x_batch, s_batch=s_batch)
      asserts.assert_value_smaller_than_input_size(
          x=x_batch, value=self.k, value_name="k"
      )
  
file_path: Quantus/quantus/metrics/localisation/top_k_intersection.py
imports: import sys
  from typing import Any, Callable, Dict, List, Optional
  import numpy
  from quantus.helpers import asserts, warn
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.metrics.base import Metric
label_desc: Use image node_id 4 for calling the TopKIntersection obj's underlying member method code with example usage: obj.custom_preprocess(x_batch, s_batch) without return types