pyFDN.AsymmetricFlatMagnitude#
- class pyFDN.AsymmetricFlatMagnitude(*, peak_power=4.0)[source]#
Flatness that punishes peaks far harder than dips – colorless.
The asymmetric sibling of
FlatMagnitude: a resonant peak rings audibly at its own pitch while a dip of the same size is largely inaudible, so this measures \(|H|\) against the response’s own RMS and raises the two sides of the deviation to different powers,\[d[f] = \frac{|H[f]|}{\sqrt{\langle |H|^2 \rangle_f}} - 1, \qquad \mathcal{L} = \Big\langle \big(d^{+}\big)^{p} + \big(d^{-}\big)^{2} \Big\rangle_f,\]with
peak_power\(p \ge 2\). Flat stays the unique minimum at everypeak_powerand the loss is gain-invariant (addEnergyto pin the level). The exponent, not a weight, is what makes it bite, and the linear magnitude (not dB) is deliberate; see the design note for why, and for what a higher exponent costs in convergence.- Parameters:
peak_power (
float) – Exponent on the peak side; dips are always quadratic. Must be at least 2 (the symmetric-shape reference, still peak-biased since a peak is unbounded and a dip is not). 4 is the default; 6 is slower but steadier. The advantage overFlatMagnitudeis not unconditional – measure your own case. Loss values are not comparable acrosspeak_poweror withFlatMagnitude; compare the responses.
Notes
A lossless FDN has every pole exactly on the unit circle, where the frequency-domain evaluation breaks down;
check()warns if the model was built without thealias_decay_dbthat avoids it.Methods
__init__(*[, peak_power])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.