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_factordepending on theunitgiven.As input to
forwardandupdatethe metric accepts the following input:preds (
Tensor): Predictions from modeltarget (
Tensor): Ground truth values
As output of
forwardandcomputethe metric returns the following output:mean_absolute_inverse_error (
Tensor): A tensor with the mean absolute error over the state
- Parameters:
unit (
Literal['mm','m','km']) – Unit for the computation of the metric. Must be one of"mm","m","km". Defaults to"km".kwargs – Additional keyword arguments.