pyFDN.matrix_module#

pyFDN.matrix_module(values, nfft, *, matrix_type='orthogonal', device=None, dtype=None, alias_decay_db=0, requires_grad=False)[source]#

Build a FLAMO Matrix initialized to values under a parametrization.

Unlike gain_module() (a plain value container), this preserves the flamo map that constrains the trainable matrix: "orthogonal" keeps it on the SO(N) manifold during optimization, "random" is unconstrained.

Parameters:
  • values (ndarray) – Square (N, N) initial feedback matrix.

  • nfft (int) – FFT size for the FLAMO module.

  • matrix_type (str) – "orthogonal" or "random".

  • device (Any) – Device; default is cuda if available else cpu.

  • dtype (Any) – Module dtype; defaults to float32.

  • alias_decay_db (float) – FLAMO alias decay in dB.

  • requires_grad (bool) – Whether the matrix is trainable.

Returns:

Matrix whose realized value (map(param)) equals values (within the parametrization; an SO(N) projection may apply for orthogonal).

Return type:

flamo.processor.dsp.Matrix