class_docstr: SDR loss.
  
  filter_length: int
      The length of the distortion filter allowed (default: ``512``)
  use_cg_iter:
      If provided, an iterative method is used to solve for the distortion
      filter coefficients instead of direct Gaussian elimination.
      This can speed up the computation of the metrics in case the filters
      are long. Using a value of 10 here has been shown to provide
      good accuracy in most cases and is sufficient when using this
      loss to train neural separation networks.
  clamp_db: float
      clamp the output value in  [-clamp_db, clamp_db]
  zero_mean: bool
      When set to True, the mean of all signals is subtracted prior.
  load_diag:
      If provided, this small value is added to the diagonal coefficients of
      the system metrices when solving for the filter coefficients.
      This can help stabilize the metric in the case where some of the reference
      signals may sometimes be zero
class_docstr_tok: ["SDR","loss",".","filter_length",":","int","The","length","of","the","distortion","filter","allowed","(","default",":","``","512","``",")","use_cg_iter",":","If","provided",",","an","iterative","method","is","used","to","solve","for","the","distortion","filter","coefficients","instead","of","direct","Gaussian","elimination",".","This","can","speed","up","the","computation","of","the","metrics","in","case","the","filters","are","long",".","Using","a","value","of","10","here","has","been","shown","to","provide","good","accuracy","in","most","cases","and","is","sufficient","when","using","this","loss","to","train","neural","separation","networks",".","clamp_db",":","float","clamp","the","output","value","in","[","-clamp_db",",","clamp_db","]","zero_mean",":","bool","When","set","to","True",",","the","mean","of","all","signals","is","subtracted","prior",".","load_diag",":","If","provided",",","this","small","value","is","added","to","the","diagonal","coefficients","of","the","system","metrices","when","solving","for","the","filter","coefficients",".","This","can","help","stabilize","the","metric","in","the","case","where","some","of","the","reference","signals","may","sometimes","be","zero"]
docstr: SDR forward.
  
  Args:
      ref: Tensor, (..., n_samples)
          reference signal
      est: Tensor (..., n_samples)
          estimated signal
  
  Returns:
      loss: (...,)
          the SDR loss (negative sdr)
docstr_tok: ["SDR","forward",".","Args",":","ref",":","Tensor",",","(","...",",","n_samples",")","reference","signal","est",":","Tensor","(","...",",","n_samples",")","estimated","signal","Returns",":","loss",":","(","...",",",")","the","SDR","loss","(","negative","sdr",")"]
code: def forward(
      self, ref: torch.Tensor, est: torch.Tensor
  ) -> torch.Tensor:
      """SDR forward.
  
      Args:
          ref: Tensor, (..., n_samples)
              reference signal
          est: Tensor (..., n_samples)
              estimated signal
  
      Returns:
          loss: (...,)
              the SDR loss (negative sdr)
      """
  
      sdr_loss = fast_bss_eval.sdr_loss(
          est=est,
          ref=ref,
          filter_length=self.filter_length,
          use_cg_iter=self.use_cg_iter,
          zero_mean=self.zero_mean,
          clamp_db=self.clamp_db,
          load_diag=self.load_diag,
          pairwise=False,
      )
  
      return sdr_loss
  
imports: import logging
  import math
  from abc import ABC
  import ci_sdr
  import fast_bss_eval
  import torch
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.loss.criterions.abs_loss import AbsEnhLoss
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 2 for calling the SDRLoss obj's underlying member method code with example usage: obj.forward(ref, est) and returns: sdr_loss