asteroid.losses.multi_scale_spectral module¶
-
class
asteroid.losses.multi_scale_spectral.
SingleSrcMultiScaleSpectral
(n_filters=None, windows_size=None, hops_size=None, alpha=1.0)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Measure multi-scale spectral loss as described in [1]
Parameters: - Shape:
- est_targets (
torch.Tensor
): Expected shape [batch, time]. - Batch of target estimates.
- targets (
torch.Tensor
): Expected shape [batch, time]. - Batch of training targets.
alpha (float) : Weighting factor for the log term
- est_targets (
Returns: torch.Tensor
– with shape [batch]Examples
>>> import torch >>> targets = torch.randn(10, 32000) >>> est_targets = torch.randn(10, 32000) >>> # Using it by itself on a pair of source/estimate >>> loss_func = SingleSrcMultiScaleSpectral() >>> loss = loss_func(est_targets, targets)
>>> import torch >>> from asteroid.losses import PITLossWrapper >>> targets = torch.randn(10, 2, 32000) >>> est_targets = torch.randn(10, 2, 32000) >>> # Using it with PITLossWrapper with sets of source/estimates >>> loss_func = PITLossWrapper(SingleSrcMultiScaleSpectral(), >>> pit_from='pw_pt') >>> loss = loss_func(est_targets, targets)
References
[1] Jesse Engel and Lamtharn (Hanoi) Hantrakul and Chenjie Gu and Adam Roberts DDSP: Differentiable Digital Signal Processing International Conference on Learning Representations ICLR 2020 $