Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 15, 2022
1 parent fa4e458 commit 4e93ce7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ludwig/utils/loss_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@


def rmspe_loss(targets: torch.Tensor, predictions: torch.Tensor) -> torch.Tensor:
"""
Root mean square percentage error.
Bad predictions can lead to arbitrarily large RMSPE values,
especially if some values of targets are very close to zero.
We return a large value instead of inf when (some) targets are zero.
"""Root mean square percentage error.
Bad predictions can lead to arbitrarily large RMSPE values, especially if some values of targets are very close to
zero. We return a large value instead of inf when (some) targets are zero.
"""
epsilon = 1e-4
# add epsilon if targets are zero to avoid division by zero
Expand Down

0 comments on commit 4e93ce7

Please sign in to comment.