docstr: A likelihood for multi-way classification.  Currently the only valid
  choice of inverse-link function (invlink) is an instance of RobustMax.
  
  For most problems, the stochastic `Softmax` likelihood may be more
  appropriate (note that you then cannot use Scipy optimizer).
docstr_tok: ["A","likelihood","for","multi-way","classification",".","Currently","the","only","valid","choice","of","inverse-link","function","(","invlink",")","is","an","instance","of","RobustMax",".","For","most","problems",",","the","stochastic","`","Softmax","`","likelihood","may","be","more","appropriate","(","note","that","you","then","can","not","use","Scipy","optimizer",")","."]
code: def __init__(
      self,
      num_classes: int,
      invlink: Optional[RobustMax] = None,
      **kwargs: Any,
  ) -> None:
      """
      A likelihood for multi-way classification.  Currently the only valid
      choice of inverse-link function (invlink) is an instance of RobustMax.
  
      For most problems, the stochastic `Softmax` likelihood may be more
      appropriate (note that you then cannot use Scipy optimizer).
      """
      super().__init__(
          input_dim=None,
          latent_dim=num_classes,
          observation_dim=None,
          **kwargs,
      )
      self.num_classes = num_classes
      self.num_gauss_hermite_points = 20
  
      if invlink is None:
          invlink = RobustMax(self.num_classes)
  
      if not isinstance(invlink, RobustMax):
          raise NotImplementedError
  
      self.invlink = invlink
  
imports: from typing import Any, Optional
  import numpy
  import tensorflow
  import tensorflow_probability
  from check_shapes import check_shapes, inherit_check_shapes
  from ..base import MeanAndVariance, Module, Parameter, TensorType
  from ..config import default_float
  from ..quadrature import hermgauss
  from ..utilities import to_default_float, to_default_int
  from .base import Likelihood, MonteCarloLikelihood
label_desc: Use image node_id 1 to create a new MultiClass object from inherited base classes: Likelihood with example: obj = MultiClass(num_classes, invlink)