RMSE#

class pytorch_forecasting.metrics.point.RMSE(reduction='sqrt-mean', **kwargs)[source]#

Bases: MultiHorizonMetric

Root mean square error

Defined as (y_pred - target)**2

Initialize metric

Parameters:
  • name (str) – metric name. Defaults to class name.

  • quantiles (List[float], optional) – quantiles for probability range. Defaults to None.

  • reduction (str, optional) – Reduction, “none”, “mean” or “sqrt-mean”. Defaults to “mean”.

Methods

loss(y_pred, target)

Calculate loss without reduction.

loss(y_pred: Dict[str, Tensor], target)[source]#

Calculate loss without reduction. Override in derived classes

Parameters:
  • y_pred – network output

  • y_actual – actual values

Returns:

loss/metric as a single number for backpropagation

Return type:

torch.Tensor