MeanSquaredErrorInverse#
- class torch_uncertainty.metrics.regression.MeanSquaredErrorInverse(squared=True, num_outputs=1, unit='km', **kwargs)[source]#
Mean Squared Error of the inverse predictions (iMSE).
\[\text{iMSE} = \frac{1}{N}\sum_i^N(\frac{1}{y_i} - \frac{1}{\hat{y_i}})^2\]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_squared_error (
Tensor): A tensor with the mean squared error
- Parameters:
squared (
bool) – IfTrue, returns MSE. IfFalse, returns RMSE.num_outputs (
int) – Number of outputs in multioutput setting.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.