pyFDN.MatchMelMagnitude#
- class pyFDN.MatchMelMagnitude(target, *, n_mels=128, f_min=0.0, f_max=None, channels='none')[source]#
Mel-scaled mean squared error of \(|H|\) against a reference.
The mel sibling of
MatchMagnitude: both spectra are reduced ton_melsmel bands (viatorchaudio’s triangular filterbank) before comparing, weighting the fit towards the low frequencies where mel spacing resolves more finely, at the cost of resolution in the high ones.- Parameters:
target (
Any) – Reference IR, shape(n_samples,),(n_samples, n_out)or(n_samples, n_out, n_in). Zero-padded or truncated to the model’snfft.n_mels (
int) – Number of mel bands. Default 128.f_min (
float) – Mel filterbank frequency range in Hz.f_maxdefaults to Nyquist.f_max (
float|None) – Mel filterbank frequency range in Hz.f_maxdefaults to Nyquist.channels (
Literal['sum','mean','none']) – How the output channels are combined before the comparison."none"(default) fits each input/output pair on its own, the well-posed choice for a multi-output FDN.
Methods
__init__(target, *[, n_mels, f_min, f_max, ...])check(model)Preflight against the model it will train, before the first step.
terms()Flatten into
(weight, loss)leaves.Attributes
nameShort label, used as the key in
pyFDN.TrainLog.loss_log.