class_docstr: The SpectralMixture kernel.
  
  This kernel is derived from parameterizing the spectral density of a
  stationary kernel by a mixture of `m` diagonal multivariate normal
  distributions [1].
  
  This in turn parameterizes the following kernel:
  
    ```none
    k(x, y) = sum_j w[j] (prod_i
        exp(-2 * (pi * (x[i] - y[i]) * s[j][i])**2) *
        cos(2 * pi * (x[i] - y[i]) * m[j][i]))
    ```
  
  where:
    * `j` is the number of mixtures (as mentioned above).
    * `w[j]` are the mixture weights.
    * `m[j]` and `s[j]` parameterize a `MultivariateNormalDiag(m[j], s[j])`.
      In other words, they are the mean and diagonal scale for each mixture
      component.
  
  NOTE: This kernel can result in negative off-diagonal entries.
  
  #### References
  [1]: A. Wilson, R. P. Adams.
       Gaussian Process Kernels for Pattern Discovery and Extrapolation.
       https://arxiv.org/abs/1302.4245
class_docstr_tok: ["The","SpectralMixture","kernel",".","This","kernel","is","derived","from","parameterizing","the","spectral","density","of","a","stationary","kernel","by","a","mixture","of","`","m","`","diagonal","multivariate","normal","distributions","[","1","]",".","This","in","turn","parameterizes","the","following","kernel",":","``","`","none","k","(","x",",","y",")","=","sum_j","w","[","j","]","(","prod_i","exp","(","-2","*","(","pi","*","(","x","[","i","]","-","y","[","i","]",")","*","s","[","j","]","[","i","]",")","*","*","2",")","*","cos","(","2","*","pi","*","(","x","[","i","]","-","y","[","i","]",")","*","m","[","j","]","[","i","]",")",")","``","`","where",":","*","`","j","`","is","the","number","of","mixtures","(","as","mentioned","above",")",".","*","`","w","[","j","]","`","are","the","mixture","weights",".","*","`","m","[","j","]","`","and","`","s","[","j","]","`","parameterize","a","`","MultivariateNormalDiag","(","m","[","j","]",",","s","[","j","]",")","`",".","In","other","words",",","they","are","the","mean","and","diagonal","scale","for","each","mixture","component",".","NOTE",":","This","kernel","can","result","in","negative","off-diagonal","entries",".","#","#","#","#","References","[","1","]",":","A.","Wilson",",","R.","P.","Adams",".","Gaussian","Process","Kernels","for","Pattern","Discovery","and","Extrapolation",".","https",":","\/\/arxiv.org\/abs\/1302.4245"]
docstr: Construct a SpectralMixture kernel instance.
  
  Args:
    logits: Floating-point `Tensor` of shape `[..., M]`, whose softmax
      represents the mixture weights for the spectral density. Must
      be broadcastable with `locs` and `scales`.
    locs: Floating-point `Tensor` of shape `[..., M, F1, F2, ... FN]`, which
      represents the location parameter of each of the `M` mixture components.
      `N` is `feature_ndims`. Must be broadcastable with `logits` and
      `scales`.
    scales: Positive Floating-point `Tensor` of shape
      `[..., M, F1, F2, ..., FN]`, which represents the scale parameter of
      each of the `M` mixture components. `N` is `feature_ndims`. Must be
      broadcastable with `locs` and `logits`. These parameters act like
      inverse length scale parameters.
    feature_ndims: Python `int` number of rightmost dims to include in the
      squared difference norm in the exponential.
    validate_args: If `True`, parameters are checked for validity despite
      possibly degrading runtime performance
    name: Python `str` name prefixed to Ops created by this class.
docstr_tok: ["Construct","a","SpectralMixture","kernel","instance",".","Args",":","logits",":","Floating-point","`","Tensor","`","of","shape","`","[","...",",","M","]","`",",","whose","softmax","represents","the","mixture","weights","for","the","spectral","density",".","Must","be","broadcastable","with","`","locs","`","and","`","scales","`",".","locs",":","Floating-point","`","Tensor","`","of","shape","`","[","...",",","M",",","F1",",","F2",",","...","FN","]","`",",","which","represents","the","location","parameter","of","each","of","the","`","M","`","mixture","components",".","`","N","`","is","`","feature_ndims","`",".","Must","be","broadcastable","with","`","logits","`","and","`","scales","`",".","scales",":","Positive","Floating-point","`","Tensor","`","of","shape","`","[","...",",","M",",","F1",",","F2",",","...",",","FN","]","`",",","which","represents","the","scale","parameter","of","each","of","the","`","M","`","mixture","components",".","`","N","`","is","`","feature_ndims","`",".","Must","be","broadcastable","with","`","locs","`","and","`","logits","`",".","These","parameters","act","like","inverse","length","scale","parameters",".","feature_ndims",":","Python","`","int","`","number","of","rightmost","dims","to","include","in","the","squared","difference","norm","in","the","exponential",".","validate_args",":","If","`","True","`",",","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class","."]
code: def __init__(
      self,
      logits,
      locs,
      scales,
      feature_ndims=1,
      validate_args=False,
      name="SpectralMixture",
  ):
      """Construct a SpectralMixture kernel instance.
  
      Args:
        logits: Floating-point `Tensor` of shape `[..., M]`, whose softmax
          represents the mixture weights for the spectral density. Must
          be broadcastable with `locs` and `scales`.
        locs: Floating-point `Tensor` of shape `[..., M, F1, F2, ... FN]`, which
          represents the location parameter of each of the `M` mixture components.
          `N` is `feature_ndims`. Must be broadcastable with `logits` and
          `scales`.
        scales: Positive Floating-point `Tensor` of shape
          `[..., M, F1, F2, ..., FN]`, which represents the scale parameter of
          each of the `M` mixture components. `N` is `feature_ndims`. Must be
          broadcastable with `locs` and `logits`. These parameters act like
          inverse length scale parameters.
        feature_ndims: Python `int` number of rightmost dims to include in the
          squared difference norm in the exponential.
        validate_args: If `True`, parameters are checked for validity despite
          possibly degrading runtime performance
        name: Python `str` name prefixed to Ops created by this class.
      """
      parameters = dict(locals())
      with tf.name_scope(name):
          dtype = util.maybe_get_common_dtype([logits, locs, scales])
          self._logits = tensor_util.convert_nonref_to_tensor(
              logits, name="logits", dtype=dtype
          )
          self._locs = tensor_util.convert_nonref_to_tensor(
              locs, name="locs", dtype=dtype
          )
          self._scales = tensor_util.convert_nonref_to_tensor(
              scales, name="scales", dtype=dtype
          )
          super(SpectralMixture, self).__init__(
              feature_ndims,
              dtype=dtype,
              name=name,
              validate_args=validate_args,
              parameters=parameters,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import generic
  from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel
  from tensorflow_probability.python.math.psd_kernels.internal import util
label_desc: Use image node_id 1 to create a new SpectralMixture object from inherited base classes: psd_kernel with example: obj = SpectralMixture(logits, locs, scales, feature_ndims, validate_args, name)