docstr: Compute likelihood ratios.
  
  Parameters
  ----------
  X
      Batch of instances.
  return_per_feature
      Return likelihood ratio per feature.
  batch_size
      Batch size for the generative model evaluations.
  
  Returns
  -------
  Likelihood ratios.
docstr_tok: ["Compute","likelihood","ratios",".","Parameters","--","--","--","--","--","X","Batch","of","instances",".","return_per_feature","Return","likelihood","ratio","per","feature",".","batch_size","Batch","size","for","the","generative","model","evaluations",".","Returns","--","--","--","-","Likelihood","ratios","."]
code: def llr(
      self,
      X: np.ndarray,
      return_per_feature: bool,
      batch_size: int = int(1e10),
  ) -> np.ndarray:
      """
      Compute likelihood ratios.
  
      Parameters
      ----------
      X
          Batch of instances.
      return_per_feature
          Return likelihood ratio per feature.
      batch_size
          Batch size for the generative model evaluations.
  
      Returns
      -------
      Likelihood ratios.
      """
      logp_fn = self.logp if not isinstance(self.log_prob, Callable) else self.logp_alt  # type: ignore
      logp_s = logp_fn(
          self.dist_s,
          X,
          return_per_feature=return_per_feature,
          batch_size=batch_size,
      )
      logp_b = logp_fn(
          self.dist_b,
          X,
          return_per_feature=return_per_feature,
          batch_size=batch_size,
      )
      return logp_s - logp_b
  
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 6 for calling the LLR obj's underlying member method code with example usage: obj.llr(X, return_per_feature, batch_size) and returns: unknown