Shortcuts

DistributionNLLLoss

class torch_uncertainty.losses.DistributionNLLLoss(reduction='mean')[source]

Negative Log-Likelihood loss using given distributions as inputs.

Parameters:
  • reduction (str, optional) – specifies the reduction to apply to the

  • output'none' | 'mean' | 'sum'. Defaults to “mean”.

forward(dist, targets)[source]

Compute the NLL of the targets given predicted distributions.

Parameters:
  • dist (Distribution) – The predicted distributions

  • targets (Tensor) – The target values