meddlr.ops.logits_to_prob#

meddlr.ops.logits_to_prob(logits, activation, channel_dim: int = 1)[source]#

Converts logits to probabilities.

Parameters
  • logits (torch.Tensor | np.ndarray) – The logits.

  • activation (str) – Activation to use. One of 'sigmoid', 'softmax'.

  • channel_dim (int, optional) – The channel dimension.

Returns

The probabilities.

Return type

torch.Tensor | np.ndarray