docstr: Compute outlier scores.
  
  Parameters
  ----------
  X
      Uniformly sampled time series instances.
  t
      Equidistant timestamps corresponding to each input instances (i.e, the array should contain
      numerical values in increasing order). If not provided, the timestamps will be replaced by an array of
      integers `[0, 1, ... , N - 1]`, where `N` is the size of the input time series.
  
  Returns
  -------
  Array with outlier scores for each instance in the batch.
docstr_tok: ["Compute","outlier","scores",".","Parameters","--","--","--","--","--","X","Uniformly","sampled","time","series","instances",".","t","Equidistant","timestamps","corresponding","to","each","input","instances","(","i.e",",","the","array","should","contain","numerical","values","in","increasing","order",")",".","If","not","provided",",","the","timestamps","will","be","replaced","by","an","array","of","integers","`","[","0",",","1",",","...",",","N","-","1","]","`",",","where","`","N","`","is","the","size","of","the","input","time","series",".","Returns","--","--","--","-","Array","with","outlier","scores","for","each","instance","in","the","batch","."]
code: def score(self, X: np.ndarray, t: np.ndarray = None) -> np.ndarray:
      """
      Compute outlier scores.
  
      Parameters
      ----------
      X
          Uniformly sampled time series instances.
      t
          Equidistant timestamps corresponding to each input instances (i.e, the array should contain
          numerical values in increasing order). If not provided, the timestamps will be replaced by an array of
          integers `[0, 1, ... , N - 1]`, where `N` is the size of the input time series.
  
      Returns
      -------
      Array with outlier scores for each instance in the batch.
      """
      if t is None:
          t = np.arange(X.shape[0])
  
      if len(X.shape) == 2:
          n_samples, n_dim = X.shape
          X = X.reshape(
              -1,
          )
          if X.shape[0] != n_samples:
              raise ValueError(
                  "Only uni-variate time series allowed for SR method. Received a time "
                  f"series with {n_dim} features."
              )
  
      X_pad = self.add_est_points(X, t)  # add padding
      sr = self.saliency_map(X_pad)  # compute saliency map
      sr = sr[: -self.n_est_points]  # remove padding again
  
      if X.shape[0] <= self.window_local:
          raise ValueError(
              "The length of the time series should be greater than the local window. "
              f"Received an input time series of length {X.shape[0]} and a local "
              f"window of {self.window_local}."
          )
  
      # pad the spectral residual before convolving. By applying `replicate` or `reflect` padding we can
      # remove some of the bias/outliers introduced at the beginning of the saliency map by a naive zero padding
      # performed by numpy. The reason for left padding is explained in a comment in the constructor.
      padded_sr = SpectralResidual.pad_same(
          X=sr,
          W=self.conv_local,
          method=self.padding_local_method,
          side=Side.LEFT,
      )
      ma_sr = np.convolve(padded_sr, self.conv_local, "valid")
      assert (
          sr.shape[0] == ma_sr.shape[0]
      ), "`ma_sr` size does not match `sr` size."
  
      # compute the outlier score
      iscore = (sr - ma_sr) / (ma_sr + EPSILON)
      return iscore
  
imports: import enum
  import logging
  import numpy
  from typing import Dict
  from alibi_detect.base import BaseDetector, ThresholdMixin, outlier_prediction_dict
  from alibi_detect.utils._types import Literal
label_desc: Use image node_id 7 for calling the SpectralResidual obj's underlying member method code with example usage: obj.score(X, t) and returns: iscore