Shortcuts

SILog

class torch_uncertainty.metrics.regression.SILog(sqrt=False, lmbda=1.0, **kwargs)[source]

The Scale-Invariant Logarithmic Loss metric.

\[\text{SILog} = \frac{1}{N} \sum_{i=1}^{N} \left(\log(y_i) - \log(\hat{y_i})\right)^2 - \left(\frac{1}{N} \sum_{i=1}^{N} \log(y_i) \right)^2,\]

where \(N\) is the batch size, \(y_i\) is a tensor of target values and \(\hat{y_i}\) is a tensor of prediction. Return the square root of SILog by setting sqrt to True.

Parameters:
  • sqrt – If True, return the square root of the metric. Defaults to False.

  • lmbda – The regularization parameter on the variance of error. Defaults to 1.0.

  • kwargs – Additional keyword arguments, see Advanced metric settings.

Reference:

Depth Map Prediction from a Single Image using a Multi-Scale Deep Network. David Eigen, Christian Puhrsch, Rob Fergus. NeurIPS 2014. From Big to Small: Multi-Scale Local Planar Guidance for Monocular Depth Estimation. Jin Han Lee, Myung-Kyu Han, Dong Wook Ko and Il Hong Suh. (For lmbda)

compute()[source]

Compute the Scale-Invariant Logarithmic Loss.

update(pred, target)[source]

Update state with predictions and targets.

Parameters:
  • pred (Tensor) – A prediction tensor of shape (batch)

  • target (Tensor) – A tensor of ground truth labels of shape (batch)