class_docstr: Expected Calibration Error (ECE)
  
  Args:
      n_cls (int): number of existing target classes
      n_bins (int): number of bins to discretize the uncertainty.
  
  References:
      https://arxiv.org/pdf/1706.04599.pdf
class_docstr_tok: ["Expected","Calibration","Error","(","ECE",")","Args",":","n_cls","(","int",")",":","number","of","existing","target","classes","n_bins","(","int",")",":","number","of","bins","to","discretize","the","uncertainty",".","References",":","https",":","\/\/arxiv.org\/pdf\/1706.04599.pdf"]
code: def __init__(self, n_cls, n_bins=10, **kwargs):
      self.n_bins = n_bins
      self.n_cls = n_cls
      self.samples = np.zeros([self.n_cls, self.n_bins], dtype=int)
      self.tp = np.zeros([self.n_cls, self.n_bins], dtype=int)
      self.conf_agg = np.zeros([self.n_cls, self.n_bins])
      super().__init__(average=False)
  
imports: import dataclasses
  import math
  import warnings
  from collections import defaultdict
  import numpy
  import torch
  from sklearn.metrics import confusion_matrix, auc
  from baal.utils.array_utils import to_prob
label_desc: Use image node_id 1 to create a new ECE_PerCLs object from inherited base classes: Metrics with example: obj = ECE_PerCLs(n_cls, n_bins)