docstr: Compute saliency map.
  
  Parameters
  ----------
  X
      Uniformly sampled time series instances.
  
  Returns
  -------
  Array with saliency map values.
docstr_tok: ["Compute","saliency","map",".","Parameters","--","--","--","--","--","X","Uniformly","sampled","time","series","instances",".","Returns","--","--","--","-","Array","with","saliency","map","values","."]
code: def saliency_map(self, X: np.ndarray) -> np.ndarray:
      """
      Compute saliency map.
  
      Parameters
      ----------
      X
          Uniformly sampled time series instances.
  
      Returns
      -------
      Array with saliency map values.
      """
      if X.shape[0] <= self.window_amp:
          raise ValueError(
              "The length of the input time series should be greater than the amplitude window. "
              f"Received an input times series of length {X.shape[0]} and an amplitude "
              f"window of {self.window_amp}."
          )
  
      fft = np.fft.fft(X)
      amp = np.abs(fft)
      log_amp = np.log(amp)
      phase = np.angle(fft)
      # split spectrum into bias term and symmetric frequencies
      bias, sym_freq = log_amp[:1], log_amp[1:]
      # select just the first half of the sym_freq
      freq = sym_freq[: (len(sym_freq) + 1) // 2]
      # apply filter/moving average, but first pad the `freq` array
      padded_freq = SpectralResidual.pad_same(
          X=freq,
          W=self.conv_amp,
          method=self.padding_amp_method,
          side=self.padding_amp_side,
      )
      ma_freq = np.convolve(padded_freq, self.conv_amp, "valid")
      # construct moving average log amplitude spectrum
      ma_log_amp = np.concatenate(
          [
              bias,
              ma_freq,
              (ma_freq[:-1] if len(sym_freq) % 2 == 1 else ma_freq)[
                  ::-1
              ],
          ]
      )
      assert (
          ma_log_amp.shape[0] == log_amp.shape[0]
      ), "`ma_log_amp` size does not match `log_amp` size."
      # compute residual spectrum and transform back to time domain
      res_amp = log_amp - ma_log_amp
      sr = np.abs(np.fft.ifft(np.exp(res_amp + 1j * phase)))
      return sr
  
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 4 for calling the SpectralResidual obj's underlying member method code with example usage: obj.saliency_map(X) and returns: sr