class_docstr: Class defining ordinal distribution type functionality
docstr: Shifts and converts the original cumulative probabilities to probabilities.
  
  Args:
      X_hat: The reconstructed data.
  
  Returns:
      Tensor of ordered class probabilities.
code: def _get_probs(self, X_hat: torch.Tensor) -> torch.Tensor:
      """
      Shifts and converts the original cumulative probabilities to probabilities.
  
      Args:
          X_hat: The reconstructed data.
  
      Returns:
          Tensor of ordered class probabilities.
      """
      # convert to torch tensor
      log_cum_odds = torch.as_tensor(
          self.log_cum_odds, device=X_hat.device
      )
      # shift the log probs by the NEGATIVE of the regression coefficient
      # the reason for negativity is explained p386 of Statistical Rethinking
      log_cum_odds = (
          torch.unsqueeze(log_cum_odds, dim=0) - X_hat[:, [self.idx]]
      )
      # recover the cumulative probabilities
      cum_prob = torch.sigmoid(log_cum_odds)
  
      # allocate class probability vector with extra space for top class
      probs = torch.zeros(
          (cum_prob.shape[0], cum_prob.shape[1] + 1),
          device=X_hat.device,
      )
      # handle first and last class cumprobs to probs conversion
      probs[:, 0] = cum_prob[:, 0]
      probs[:, -1] = 1 - cum_prob[:, -1]
      # handle main cumprob conversion
      probs[:, 1:-1] = cum_prob[:, 1:] - cum_prob[:, 0:-1]
  
      return probs
  
file_path: causalnex/causalnex/structure/pytorch/dist_type/ordinal.py
imports: from copy import deepcopy
  import numpy
  import torch
  from sklearn.preprocessing import OrdinalEncoder
  from causalnex.structure.pytorch.dist_type._base import DistTypeBase
label_desc: Use image node_id 2 for calling the DistTypeOrdinal obj's underlying member method code with example usage: obj._get_probs(X_hat) and returns: probs