class_docstr: Implementation of the Efficient MPRT by Hedström et al., 2023.
  
  The Efficient MPRT measures replaces the layer-by-layer pairwise comparison
  between e and ˆe of MPRT by instead computing the relative rise in explanation complexity using only
  two model states, i.e., the original- and fully randomised model version
  
  References:
      1) Hedström, Anna, et al. "Sanity Checks Revisited: An Exploration to Repair the Model Parameter
      Randomisation Test." XAI in Action: Past, Present, and Future Applications. 2023.
  
  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","Efficient","MPRT","by","Hedstr\u00f6m","et","al.",",","2023",".","The","Efficient","MPRT","measures","replaces","the","layer-by-layer","pairwise","comparison","between","e","and","\u02c6e","of","MPRT","by","instead","computing","the","relative","rise","in","explanation","complexity","using","only","two","model","states",",","i.e.",",","the","original-","and","fully","randomised","model","version","References",":","1",")","Hedstr\u00f6m",",","Anna",",","et","al",".","``","Sanity","Checks","Revisited",":","An","Exploration","to","Repair","the","Model","Parameter","Randomisation","Test",".","''","XAI","in","Action",":","Past",",","Present",",","and","Future","Applications",".","2023",".","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: Iterate over dataset in batches and generate explanations for complete dataset.
  
  Parameters
  ----------
  model: ModelInterface
      A ModelInterface that is subject to explanation.
  x_batch: np.ndarray
      A np.ndarray which contains the input data that are explained.
  y_batch: np.ndarray
      A np.ndarray which contains the output labels that are explained.
  kwargs: optional, dict
      List of hyperparameters.
  
  Returns
  -------
  a_batch:
      Batch of explanations ready to be evaluated.
docstr_tok: ["Iterate","over","dataset","in","batches","and","generate","explanations","for","complete","dataset",".","Parameters","--","--","--","--","--","model",":","ModelInterface","A","ModelInterface","that","is","subject","to","explanation",".","x_batch",":","np.ndarray","A","np.ndarray","which","contains","the","input","data","that","are","explained",".","y_batch",":","np.ndarray","A","np.ndarray","which","contains","the","output","labels","that","are","explained",".","kwargs",":","optional",",","dict","List","of","hyperparameters",".","Returns","--","--","--","-","a_batch",":","Batch","of","explanations","ready","to","be","evaluated","."]
code: def generate_explanations(
      self,
      model: ModelInterface,
      x_batch: np.ndarray,
      y_batch: np.ndarray,
      batch_size: int,
  ) -> Generator[np.ndarray, None, None]:
      """
      Iterate over dataset in batches and generate explanations for complete dataset.
  
      Parameters
      ----------
      model: ModelInterface
          A ModelInterface that is subject to explanation.
      x_batch: np.ndarray
          A np.ndarray which contains the input data that are explained.
      y_batch: np.ndarray
          A np.ndarray which contains the output labels that are explained.
      kwargs: optional, dict
          List of hyperparameters.
  
      Returns
      -------
      a_batch:
          Batch of explanations ready to be evaluated.
      """
      for i in gen_batches(len(x_batch), batch_size):
          x = x_batch[i.start : i.stop]
          y = y_batch[i.start : i.stop]
          a = self.explain_batch(model, x, y)
          yield a
  
imports: import sys
  from typing import Any, Callable, Collection, Dict, List, Optional, Union, Tuple, Generator, Iterable
  import numpy
  from tqdm.auto import tqdm
  from sklearn.utils import gen_batches
  from quantus.functions.similarity_func import correlation_spearman
  from quantus.functions.complexity_func import discrete_entropy, entropy
  from quantus.functions.normalise_func import normalise_by_average_second_moment_estimate
  from quantus.functions import n_bins_func
  from quantus.helpers import asserts, warn, utils
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.metrics.base import Metric
label_desc: Use image node_id 5 for calling the EfficientMPRT obj's underlying member method code with example usage: obj.generate_explanations(model, x_batch, y_batch, batch_size) without return types