class_docstr: Base implementation for KL Divergence metric.
  
  The KL divergence is measured between probability distributions
  of class predictions returned by a pre-trained audio classification model.
  When the KL-divergence is low, the generated audio is expected to
  have similar acoustic characteristics as the reference audio,
  according to the classifier.
class_docstr_tok: ["Base","implementation","for","KL","Divergence","metric",".","The","KL","divergence","is","measured","between","probability","distributions","of","class","predictions","returned","by","a","pre-trained","audio","classification","model",".","When","the","KL-divergence","is","low",",","the","generated","audio","is","expected","to","have","similar","acoustic","characteristics","as","the","reference","audio",",","according","to","the","classifier","."]
code: def __init__(self):
      super().__init__()
      self.add_state(
          "kld_pq_sum", default=torch.tensor(0.0), dist_reduce_fx="sum"
      )
      self.add_state(
          "kld_qp_sum", default=torch.tensor(0.0), dist_reduce_fx="sum"
      )
      self.add_state(
          "kld_all_sum", default=torch.tensor(0.0), dist_reduce_fx="sum"
      )
      self.add_state(
          "weight", default=torch.tensor(0), dist_reduce_fx="sum"
      )
  
imports: import contextlib
  from functools import partial
  import logging
  import os
  import typing
  import torch
  import torchmetrics
  from ..data.audio_utils import convert_audio
label_desc: Use image node_id 1 to create a new KLDivergenceMetric object from inherited base classes: torchmetrics with example: obj = KLDivergenceMetric()