class_docstr: Implements the Softmax (multiclass) likelihood used for GP classification.
  
  .. math::
      p(\mathbf y \mid \mathbf f) = \text{Softmax} \left( \mathbf W \mathbf f \right)
  
  :math:`\mathbf W` is a set of linear mixing weights applied to the latent functions :math:`\mathbf f`.
  
  :param num_features: Dimensionality of latent function :math:`\mathbf f`.
  :param num_classes: Number of classes.
  :param mixing_weights: (Default: `True`) Whether to learn a linear mixing weight :math:`\mathbf W` applied to
      the latent function :math:`\mathbf f`. If `False`, then :math:`\mathbf W = \mathbf I`.
  :param mixing_weights_prior: Prior to use over the mixing weights :math:`\mathbf W`.
  
  :ivar torch.Tensor mixing_weights: (Optional) mixing weights.
class_docstr_tok: ["Implements","the","Softmax","(","multiclass",")","likelihood","used","for","GP","classification",".","..","math",":",":","p","(","\\mathbf","y","\\mid","\\mathbf","f",")","=","\\text","{","Softmax","}","\\left","(","\\mathbf","W","\\mathbf","f","\\right",")",":","math",":","`","\\mathbf","W","`","is","a","set","of","linear","mixing","weights","applied","to","the","latent","functions",":","math",":","`","\\mathbf","f","`",".",":","param","num_features",":","Dimensionality","of","latent","function",":","math",":","`","\\mathbf","f","`",".",":","param","num_classes",":","Number","of","classes",".",":","param","mixing_weights",":","(","Default",":","`","True","`",")","Whether","to","learn","a","linear","mixing","weight",":","math",":","`","\\mathbf","W","`","applied","to","the","latent","function",":","math",":","`","\\mathbf","f","`",".","If","`","False","`",",","then",":","math",":","`","\\mathbf","W","=","\\mathbf","I","`",".",":","param","mixing_weights_prior",":","Prior","to","use","over","the","mixing","weights",":","math",":","`","\\mathbf","W","`",".",":","ivar","torch.Tensor","mixing_weights",":","(","Optional",")","mixing","weights","."]
code: def __init__(
      self,
      num_features: Optional[int] = None,
      num_classes: int = None,  # pyre-fixme[9]
      mixing_weights: bool = True,
      mixing_weights_prior: Optional[Prior] = None,
  ) -> None:
      super().__init__()
      if num_classes is None:
          raise ValueError("num_classes is required")
      self.num_classes = num_classes
      if mixing_weights is not None:
          if num_features is None:
              raise ValueError(
                  "num_features is required with mixing weights"
              )
          self.num_features: int = num_features
          self.register_parameter(
              name="mixing_weights",
              parameter=torch.nn.Parameter(
                  torch.randn(num_classes, num_features).div_(
                      num_features
                  )
              ),
          )
          if mixing_weights_prior is not None:
              self.register_prior(
                  "mixing_weights_prior",
                  mixing_weights_prior,
                  "mixing_weights",
              )
      else:
          self.num_features = num_classes
          self.mixing_weights: Optional[torch.nn.Parameter] = None
  
file_path: gpytorch/gpytorch/likelihoods/softmax_likelihood.py
imports: import warnings
  from typing import Any, Optional, Union
  import torch
  from torch import Tensor
  from torch.distributions import Categorical, Distribution
  from ..distributions import base_distributions, MultitaskMultivariateNormal
  from ..priors import Prior
  from .likelihood import Likelihood
label_desc: Use image node_id 1 to create a new SoftmaxLikelihood object from inherited base classes: Likelihood with example: obj = SoftmaxLikelihood(num_features, num_classes, mixing_weights, mixing_weights_prior)