speechbrain.inference.metrics module

Specifies the inference interfaces for metric estimation modules.

Authors:
  • Aku Rouhe 2021

  • Peter Plantinga 2021

  • Loren Lugosch 2020

  • Mirco Ravanelli 2020

  • Titouan Parcollet 2021

  • Abdel Heba 2021

  • Andreas Nautsch 2022, 2023

  • Pooneh Mousavi 2023

  • Sylvain de Langen 2023

  • Adel Moumen 2023

  • Pradnya Kandarkar 2023

Summary

Classes:

SNREstimator

A "ready-to-use" SNR estimator.

Reference

class speechbrain.inference.metrics.SNREstimator(modules=None, hparams=None, run_opts=None, freeze_params=True)[source]

Bases: Pretrained

A “ready-to-use” SNR estimator.

MODULES_NEEDED = ['encoder', 'encoder_out']
HPARAMS_NEEDED = ['stat_pooling', 'snrmax', 'snrmin']
estimate_batch(mix, predictions)[source]

Run SI-SNR estimation on the estimated sources, and mixture.

Parameters:
  • mix (torch.Tensor) – The mixture of sources of shape B X T

  • predictions (torch.Tensor) –

    of size (B x T x C), where B is batch size

    T is number of time points C is number of sources

Returns:

Estimate of SNR

Return type:

tensor

forward(mix, predictions)[source]

Just run the batch estimate

gettrue_snrrange(inp)[source]

Convert from 0-1 range to true snr range

training: bool