docstr: Compute log probability of a batch of instances using the log_prob function
  defined by the user.
  
  Parameters
  ----------
  model
      Trained model.
  X
      Batch of instances.
  return_per_feature
      Return log probability per feature.
  batch_size
      Batch size for the generative model evaluations.
  
  Returns
  -------
  Log probabilities.
docstr_tok: ["Compute","log","probability","of","a","batch","of","instances","using","the","log_prob","function","defined","by","the","user",".","Parameters","--","--","--","--","--","model","Trained","model",".","X","Batch","of","instances",".","return_per_feature","Return","log","probability","per","feature",".","batch_size","Batch","size","for","the","generative","model","evaluations",".","Returns","--","--","--","-","Log","probabilities","."]
code: def logp_alt(
      self,
      model: tf.keras.Model,
      X: np.ndarray,
      return_per_feature: bool = False,
      batch_size: int = int(1e10),
  ) -> np.ndarray:
      """
      Compute log probability of a batch of instances using the log_prob function
      defined by the user.
  
      Parameters
      ----------
      model
          Trained model.
      X
          Batch of instances.
      return_per_feature
          Return log probability per feature.
      batch_size
          Batch size for the generative model evaluations.
  
      Returns
      -------
      Log probabilities.
      """
      if self.sequential:
          y, X = X[:, 1:], X[:, :-1]
      else:
          y = X.copy()
      y_preds = predict_batch(X, model, batch_size=batch_size)
      logp = self.log_prob(y, y_preds).numpy()
      if return_per_feature:
          return logp
      else:
          axis = tuple(np.arange(len(logp.shape))[1:])
          return np.mean(logp, axis=axis)
  
imports: from functools import partial
  import logging
  import numpy
  import tensorflow
  from tensorflow.keras.layers import Input
  from tensorflow.keras.models import Model
  from tensorflow_probability.python.distributions.distribution import Distribution
  from typing import Callable, Dict, Tuple, Union
  from alibi_detect.models.tensorflow.pixelcnn import PixelCNN
  from alibi_detect.models.tensorflow.trainer import trainer
  from alibi_detect.base import BaseDetector, FitMixin, ThresholdMixin, outlier_prediction_dict
  from alibi_detect.utils.tensorflow.prediction import predict_batch
  from alibi_detect.utils.tensorflow.perturbation import mutate_categorical
  from alibi_detect.utils._types import OptimizerTF
label_desc: Use image node_id 5 for calling the LLR obj's underlying member method code with example usage: obj.logp_alt(model, X, return_per_feature, batch_size) and returns: logp, np