pyFDN.MatchMagnitude#

class pyFDN.MatchMagnitude(target, *, channels='none')[source]#

Mean squared error of \(|H|\) against a reference impulse response.

The magnitude-only sibling of MatchImpulseResponse: fits the spectral envelope while ignoring phase.

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’s nfft.

  • channels (Literal['sum', 'mean', 'none']) – How the output channels are combined before the comparison. "none" (default) fits each input/output pair on its own.

__init__(target, *, channels='none')[source]#

Methods

__init__(target, *[, channels])

check(model)

Preflight against the model it will train, before the first step.

terms()

Flatten into (weight, loss) leaves.

Attributes

name

Short label, used as the key in pyFDN.TrainLog.loss_log.