MeanAbsoluteErrorInverse#
- class torch_uncertainty.metrics.regression.MeanAbsoluteErrorInverse(unit='km', **kwargs)[source]#
Mean Absolute Error of the inverse predictions (iMAE).
\[\text{iMAE} = \frac{1}{N}\sum_i^N \left| \frac{1}{y_i} - \frac{1}{\hat{y_i}} \right|\]Where \(y\) is a tensor of target values, and \(\hat{y}\) is a tensor of predictions. Both are scaled by a factor of
unit_factor
depending on theunit
given.As input to
forward
andupdate
the metric accepts the following input:preds (
Tensor
): Predictions from modeltarget (
Tensor
): Ground truth values
As output of
forward
andcompute
the metric returns the following output:mean_absolute_inverse_error (
Tensor
): A tensor with the mean absolute error over the state
- Parameters:
unit – Unit for the computation of the metric. Must be one of ‘mm’, ‘m’, ‘km’. Defauts to ‘km’.
kwargs – Additional keyword arguments.