Source code for ignite.metrics.root_mean_squared_error

import math
from typing import Union

import torch

from ignite.metrics.mean_squared_error import MeanSquaredError

__all__ = ["RootMeanSquaredError"]

[docs]class RootMeanSquaredError(MeanSquaredError): r"""Calculates the `root mean squared error <>`_. .. math:: \text{RMSE} = \sqrt{ \frac{1}{N} \sum_{i=1}^N \left(y_{i} - x_{i} \right)^2 } where :math:`y_{i}` is the prediction tensor and :math:`x_{i}` is ground true tensor. - ``update`` must receive output of the form (y_pred, y) or `{'y_pred': y_pred, 'y': y}`. """ def compute(self) -> Union[torch.Tensor, float]: mse = super(RootMeanSquaredError, self).compute() return math.sqrt(mse)

© Copyright 2023, PyTorch-Ignite Contributors. Last updated on 06/01/2023, 1:33:59 PM.

Built with Sphinx using a theme provided by Read the Docs.