csteinmetz1 / auraloss

Collection of audio-focused loss functions in PyTorch
Apache License 2.0
695 stars 66 forks source link

Feature: pass distance string from STFTLoss to STFTMagnitudeLoss #52

Closed ben-hayes closed 1 year ago

ben-hayes commented 1 year ago

Just a little quality of life tweak — currently, there's no way to pass the desired distance function down the call-stack from freq.STFTLoss (or, by extension, from freq.MultiResolutionSTFTLoss, etc.) to reach STFTMagnitudeLoss.

In the spirit of the change to include w_sc, w_lin_mag, etc. I think it would be helpful to be able to specify this as an optional argument — even if just to select between L1/L2 as already afforded by STFTMagnitudeLoss.