class_docstr: Adding a linear layer to a classifier model after the model is
  trained and train this new layer until convergence.
  Together with the linear layer, the model is now calibrated.
  Source: https://arxiv.org/abs/1910.12656
  Code inspired from: https://github.com/dirichletcal/experiments_neurips
  
  References:
      @article{kullbeyond,
              title={Beyond temperature scaling: Obtaining well-calibrated multi-class
               probabilities with Dirichlet calibration Supplementary material},
              author={Kull, Meelis and Perello-Nieto,
               Miquel and K{"a}ngsepp, Markus and Silva Filho,
                Telmo and Song, Hao and Flach, Peter}
              }
  
  Args:
  
      wrapper (ModelWrapper): Provides training and testing methods.
      num_classes (int): Number of classes in classification task.
      lr (float): Learning rate.
      reg_factor (float): Regularization factor for the linear layer weights.
      mu (float): Regularization factor for the linear layer biases.
          If not given, will be initialized by "l".
class_docstr_tok: ["Adding","a","linear","layer","to","a","classifier","model","after","the","model","is","trained","and","train","this","new","layer","until","convergence",".","Together","with","the","linear","layer",",","the","model","is","now","calibrated",".","Source",":","https",":","\/\/arxiv.org\/abs\/1910.12656","Code","inspired","from",":","https",":","\/\/github.com\/dirichletcal\/experiments_neurips","References",":","@","article","{","kullbeyond",",","title=","{","Beyond","temperature","scaling",":","Obtaining","well-calibrated","multi-class","probabilities","with","Dirichlet","calibration","Supplementary","material","}",",","author=","{","Kull",",","Meelis","and","Perello-Nieto",",","Miquel","and","K","{","``","a","}","ngsepp",",","Markus","and","Silva","Filho",",","Telmo","and","Song",",","Hao","and","Flach",",","Peter","}","}","Args",":","wrapper","(","ModelWrapper",")",":","Provides","training","and","testing","methods",".","num_classes","(","int",")",":","Number","of","classes","in","classification","task",".","lr","(","float",")",":","Learning","rate",".","reg_factor","(","float",")",":","Regularization","factor","for","the","linear","layer","weights",".","mu","(","float",")",":","Regularization","factor","for","the","linear","layer","biases",".","If","not","given",",","will","be","initialized","by","``","l","''","."]
code: def metrics(self):
      return self.wrapper.metrics
  
file_path: baal/baal/calibration/calibration.py
imports: from copy import deepcopy
  import structlog
  import torch
  from baal.active.dataset.base import Dataset
  from torch import nn
  from torch.optim import Adam
  from baal import ModelWrapper
  from baal.utils.metrics import ECE, ECE_PerCLs
label_desc: Use image node_id 5 for calling the DirichletCalibrator obj's underlying member method code with example usage: obj.metrics() and returns: self