Skip to content

Commit

Permalink
Ran run_code_style.sh fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekrom-7780 committed Nov 11, 2023
1 parent 82a647e commit 8d626dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ignite/contrib/metrics/ExpectedCalibrationError.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import torch
from ignite.metrics import Metric

from ignite.exceptions import NotComputableError
from ignite.metrics import Metric


class ExpectedCalibrationError(Metric):
def __init__(self, num_bins=10, device=None):
Expand All @@ -26,7 +28,9 @@ def update(self, output):

def compute(self):
if self.confidences.numel() == 0:
raise NotComputableError("ExpectedCalibrationError must have at least one example before it can be computed.")
raise NotComputableError(
"ExpectedCalibrationError must have at least one example before it can be computed."
)

bin_edges = torch.linspace(0, 1, self.num_bins + 1, device=self.device)

Expand Down

0 comments on commit 8d626dd

Please sign in to comment.