AggregationMetric

class pytorch_forecasting.metrics.AggregationMetric(metric: pytorch_forecasting.metrics.Metric, **kwargs)[source]

Bases: pytorch_forecasting.metrics.Metric

Calculate metric on mean prediction and actuals.

Parameters

metric (Metric) – metric which to calculate on aggreation.

Methods

compute()

Abstract method that calcualtes metric

update(y_pred, y_actual)

Calculate composite metric

compute()[source]

Abstract method that calcualtes metric

Should be overriden in derived classes

Parameters
  • y_pred – network output

  • y_actual – actual values

Returns

metric value on which backpropagation can be applied

Return type

torch.Tensor

update(y_pred: torch.Tensor, y_actual: torch.Tensor) torch.Tensor[source]

Calculate composite metric

Parameters
  • y_pred – network output

  • y_actual – actual values

Returns

metric value on which backpropagation can be applied

Return type

torch.Tensor