class_docstr: This class represent a multi-class inverse-link function. Given a vector
  :math:`f=[f_1, f_2, ... f_k]`, the result of the mapping is
  
  .. math::
  
     y = [y_1 ... y_k]
  
  with
  
  .. math::
  
     y_i = \left\{
     \begin{array}{ll}
         (1-\varepsilon)   & \textrm{if} \ i = \textrm{argmax}(f) \\
         \varepsilon/(k-1) & \textrm{otherwise}
     \end{array}
     \right.
  
  where :math:`k` is the number of classes.
class_docstr_tok: ["This","class","represent","a","multi-class","inverse-link","function",".","Given","a","vector",":","math",":","`","f=","[","f_1",",","f_2",",","...","f_k","]","`",",","the","result","of","the","mapping","is","..","math",":",":","y","=","[","y_1","...","y_k","]","with","..","math",":",":","y_i","=","\\left\\","{","\\begin","{","array","}","{","ll","}","(","1-\\varepsilon",")","&","\\textrm","{","if","}","\\","i","=","\\textrm","{","argmax","}","(","f",")","\\\\","\\varepsilon\/","(","k-1",")","&","\\textrm","{","otherwise","}","\\end","{","array","}","\\right",".","where",":","math",":","`","k","`","is","the","number","of","classes","."]
code: def prob_is_largest(
      self,
      Y: TensorType,
      mu: TensorType,
      var: TensorType,
      gh_x: TensorType,
      gh_w: TensorType,
  ) -> tf.Tensor:
      Y = to_default_int(Y)
      # work out what the mean and variance is of the indicated latent function.
      oh_on = tf.cast(
          tf.one_hot(tf.reshape(Y, (-1,)), self.num_classes, 1.0, 0.0),
          dtype=mu.dtype,
      )
      mu_selected = tf.reduce_sum(oh_on * mu, 1)
      var_selected = tf.reduce_sum(oh_on * var, 1)
  
      # generate Gauss Hermite grid
      X = tf.reshape(mu_selected, (-1, 1)) + gh_x * tf.reshape(
          self.safe_sqrt(2.0 * var_selected), (-1, 1)
      )
  
      # compute the CDF of the Gaussian between the latent functions and the grid (including the selected function)
      dist = (
          tf.expand_dims(X, 1) - tf.expand_dims(mu, 2)
      ) / tf.expand_dims(self.safe_sqrt(var), 2)
      cdfs = 0.5 * (1.0 + tf.math.erf(dist / np.sqrt(2.0)))
  
      cdfs = cdfs * (1 - 2 * self._squash) + self._squash
  
      # blank out all the distances on the selected latent function
      oh_off = tf.cast(
          tf.one_hot(tf.reshape(Y, (-1,)), self.num_classes, 0.0, 1.0),
          dtype=mu.dtype,
      )
      cdfs = cdfs * tf.expand_dims(oh_off, 2) + tf.expand_dims(oh_on, 2)
  
      # take the product over the latent functions, and the sum over the GH grid.
      return tf.reduce_prod(cdfs, axis=[1]) @ tf.reshape(
          gh_w / np.sqrt(np.pi), (-1, 1)
      )
  
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 5 for calling the RobustMax obj's underlying member method code with example usage: obj.prob_is_largest(Y, mu, var, gh_x, gh_w) and returns: unknown