speechbrain.nnet.loss.stoi_loss 模块
用于计算STOI的库。 参考:“端到端波形语句增强用于直接评估指标优化通过全卷积神经网络”,TASLP,2018年
- Authors:
Szu-Wei, Fu 2020
摘要
函数:
从STOI计算中移除静音帧。 |
|
计算STOI分数并返回-1乘以该分数。 |
|
返回1/3倍频带矩阵。 |
参考
- speechbrain.nnet.loss.stoi_loss.removeSilentFrames(x, y, dyn_range=40, N=256, K=128)[source]
从STOI计算中移除静音帧。
此函数可用作基于SGD更新的训练损失函数。
- speechbrain.nnet.loss.stoi_loss.stoi_loss(y_pred_batch, y_true_batch, lens, reduction='mean')[source]
计算STOI分数并返回-1乘以该分数。
此函数可用作基于SGD更新的训练损失函数。
- Parameters:
y_pred_batch (torch.Tensor) – 退化(增强)的波形。
y_true_batch (torch.Tensor) – 干净的(参考)波形。
lens (torch.Tensor) – 批次中波形的相对长度。
reduction (str) – 使用的减少类型(“mean”或“batch”)。
- Return type:
计算出的STOI损失。
Example
>>> a = torch.sin(torch.arange(16000, dtype=torch.float32)).unsqueeze(0) >>> b = a + 0.001 >>> -stoi_loss(b, a, torch.ones(1)) tensor(0.7...)