class_docstr: Chroma cosine similarity metric.
  
  This metric extracts a chromagram for a reference waveform and
  a generated waveform and compares each frame using the cosine similarity
  function. The output is the mean cosine similarity.
  
  Args:
      sample_rate (int): Sample rate used by the chroma extractor.
      n_chroma (int): Number of chroma used by the chroma extractor.
      radix2_exp (int): Exponent for the chroma extractor.
      argmax (bool): Whether the chroma extractor uses argmax.
      eps (float): Epsilon for cosine similarity computation.
code: def __init__(
      self,
      sample_rate: int,
      n_chroma: int,
      radix2_exp: int,
      argmax: bool,
      eps: float = 1e-8,
  ):
      super().__init__()
      self.chroma_sample_rate = sample_rate
      self.n_chroma = n_chroma
      self.eps = eps
      self.chroma_extractor = ChromaExtractor(
          sample_rate=self.chroma_sample_rate,
          n_chroma=self.n_chroma,
          radix2_exp=radix2_exp,
          argmax=argmax,
      )
      self.add_state(
          "cosine_sum", default=torch.tensor(0.0), dist_reduce_fx="sum"
      )
      self.add_state(
          "weight", default=torch.tensor(0.0), dist_reduce_fx="sum"
      )
  
file_path: audiocraft/audiocraft/metrics/chroma_cosinesim.py
imports: import torch
  import torchmetrics
  from ..data.audio_utils import convert_audio
  from ..modules.chroma import ChromaExtractor
label_desc: Use image node_id 1 to create a new ChromaCosineSimilarityMetric object from inherited base classes: torchmetrics with example: obj = ChromaCosineSimilarityMetric(sample_rate, n_chroma, radix2_exp, argmax, eps)