class_docstr: A likelihood for doing ordinal regression.
  
  The data are integer values from 0 to k, and the user must specify (k-1)
  'bin edges' which define the points at which the labels switch. Let the bin
  edges be [a₀, a₁, ... aₖ₋₁], then the likelihood is
  
  p(Y=0|F) = ɸ((a₀ - F) / σ)
  p(Y=1|F) = ɸ((a₁ - F) / σ) - ɸ((a₀ - F) / σ)
  p(Y=2|F) = ɸ((a₂ - F) / σ) - ɸ((a₁ - F) / σ)
  ...
  p(Y=K|F) = 1 - ɸ((aₖ₋₁ - F) / σ)
  
  where ɸ is the cumulative density function of a Gaussian (the inverse probit
  function) and σ is a parameter to be learned.
  
  A reference is :cite:t:`chu2005gaussian`.
code: def _scalar_log_prob(
      self, X: TensorType, F: TensorType, Y: TensorType
  ) -> tf.Tensor:
      Y = to_default_int(Y)
      scaled_bins_left = tf.concat(
          [self.bin_edges / self.sigma, np.array([np.inf])], 0
      )
      scaled_bins_right = tf.concat(
          [np.array([-np.inf]), self.bin_edges / self.sigma], 0
      )
      selected_bins_left = tf.gather(scaled_bins_left, Y)
      selected_bins_right = tf.gather(scaled_bins_right, Y)
  
      return tf.math.log(
          inv_probit(selected_bins_left - F / self.sigma)
          - inv_probit(selected_bins_right - F / self.sigma)
          + 1e-6
      )
  
imports: from typing import Any, Callable
  import numpy
  import tensorflow
  from check_shapes import check_shapes, inherit_check_shapes
  from ..None import logdensities
  from ..base import AnyNDArray, MeanAndVariance, Parameter, TensorType
  from ..config import default_float
  from ..utilities import positive, to_default_int
  from .base import ScalarLikelihood
  from .utils import inv_probit
label_desc: Use image node_id 2 for calling the Ordinal obj's underlying member method code with example usage: obj._scalar_log_prob(X, F, Y) and returns: tf