code: def si_sdr_improvement(
      estimate: torch.Tensor,
      reference: torch.Tensor,
      mix: torch.Tensor,
      mask: torch.Tensor,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Compute the improvement of scale-invariant SDR. (SI-SNRi) and bare SDR (SDRi).
  
      Args:
          estimate (torch.Tensor): Estimated source signals.
              Shape: [batch, speakers, time frame]
          reference (torch.Tensor): Reference (original) source signals.
              Shape: [batch, speakers, time frame]
          mix (torch.Tensor): Mixed souce signals, from which the setimated signals were generated.
              Shape: [batch, speakers == 1, time frame]
          mask (torch.Tensor): Mask to indicate padded value (0) or valid value (1).
              Shape: [batch, 1, time frame]
  
  
      Returns:
          torch.Tensor: Improved SI-SDR. Shape: [batch, ]
          torch.Tensor: Absolute SI-SDR. Shape: [batch, ]
  
      References:
          - Conv-TasNet: Surpassing Ideal Time--Frequency Magnitude Masking for Speech Separation
            Luo, Yi and Mesgarani, Nima
            https://arxiv.org/abs/1809.07454
      """
      with torch.no_grad():
          sdri = metrics.sdri(estimate, reference, mix, mask=mask)
  
      estimate = estimate - estimate.mean(axis=2, keepdim=True)
      reference = reference - reference.mean(axis=2, keepdim=True)
      mix = mix - mix.mean(axis=2, keepdim=True)
  
      si_sdri = metrics.sdri(estimate, reference, mix, mask=mask)
      return si_sdri, sdri
  
file_path: audio/examples/source_separation/conv_tasnet/trainer.py
imports: import time
  from collections import namedtuple
  from typing import Tuple
  import torch
  import torch.distributed
  from utils import dist_utils, metrics
label_desc: Use image node_id 1 for calling a global function with example usage: si_sdr_improvement(estimate, reference, mix, mask) and returns: si_sdri,  sdri