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`.
docstr: bin_edges is a numpy array specifying at which function value the
  output label should switch. If the possible Y values are 0...K, then
  the size of bin_edges should be (K-1).
docstr_tok: ["bin_edges","is","a","numpy","array","specifying","at","which","function","value","the","output","label","should","switch",".","If","the","possible","Y","values","are","0","...","K",",","then","the","size","of","bin_edges","should","be","(","K-1",")","."]
code: def __init__(self, bin_edges: AnyNDArray, **kwargs: Any) -> None:
      """
      bin_edges is a numpy array specifying at which function value the
      output label should switch. If the possible Y values are 0...K, then
      the size of bin_edges should be (K-1).
      """
      super().__init__(**kwargs)
      self.bin_edges = bin_edges
      self.num_bins = bin_edges.size + 1
      self.sigma = Parameter(1.0, transform=positive())
  
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 1 to create a new Ordinal object from inherited base classes: ScalarLikelihood with example: obj = Ordinal(bin_edges)