code: def _spectral_mixture(
      self, logits, locs, scales, x, y, feature_ndims
  ):
      dims = tuple(range(-feature_ndims, 0, 1))
      summand = (np.pi * scales * (x - y)) ** 2
      summand = np.exp(-2 * np.sum(summand, axis=dims))
  
      cos_coeffs = np.cos(2 * np.pi * (x - y) * locs)
      cos_coeffs = np.reshape(cos_coeffs, [np.shape(cos_coeffs)[0], -1])
      cos_coeffs = np.prod(cos_coeffs, axis=-1)
      return np.sum(np.exp(logits) * summand * cos_coeffs)
  
file_path: probability/tensorflow_probability/python/math/psd_kernels/spectral_mixture_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import spectral_mixture
label_desc: Use image node_id 1 for calling the SpectralMixtureTest obj's underlying member method code with example usage: obj._spectral_mixture(logits, locs, scales, x, y, feature_ndims) and returns: np