Skip to content

Commit

Permalink
Merge pull request #565 from c-lyu/fix/quantile-loss
Browse files Browse the repository at this point in the history
Fix CRPS loss calculation
  • Loading branch information
WenjieDu authored Feb 19, 2025
2 parents a8d8edd + a3deb7d commit f5d4e24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypots/utils/metrics/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def calc_quantile_crps(
for j in range(len(predictions)):
q_pred.append(torch.quantile(predictions[j : j + 1], quantiles[i], dim=1))
q_pred = torch.cat(q_pred, 0)
q_loss = calc_quantile_loss(targets, q_pred, quantiles[i], masks)
q_loss = calc_quantile_loss(q_pred, targets, quantiles[i], masks)
CRPS += q_loss / denominator
return CRPS.item() / len(quantiles)

Expand Down

0 comments on commit f5d4e24

Please sign in to comment.