pytorch_forecasting.metrics.
Metric
Bases: pytorch_lightning.metrics.metric.Metric
pytorch_lightning.metrics.metric.Metric
Base metric class that has basic functions that can handle predicting quantiles and operate in log space. See the Lightning documentation for details of how to implement a new metric
Other metrics should inherit from this base class
Initialize metric
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
compute()
compute
Abstract method that calcualtes metric
to_prediction(y_pred)
to_prediction
Convert network prediction into a point prediction.
to_quantiles(y_pred)
to_quantiles
Convert network prediction into a quantile prediction.
update(y_actual)
update
Override this method to update the state variables of your metric class.
Should be overriden in derived classes
y_pred – network output
y_actual – actual values
metric value on which backpropagation can be applied
torch.Tensor
y_pred – prediction output of network
point prediction
prediction quantiles