pdft.bases.fit_to_dct

Contents

pdft.bases.fit_to_dct#

pdft.bases.fit_to_dct(basis_factory, *, n_steps=2000, lr=0.02)[source]#

Fit a parametric basis so its forward circuit ≈ DCT_2D.

Parameters:
  • basis_factory (callable) – Zero-argument callable returning a basis instance. Must expose .m, .n, .tensors, .code (any pdft basis class). The returned tensor list has the same shapes as basis_factory().tensors and can be passed back as tensors=... for a DCT warm-start.

  • n_steps (int) – Adam steps. 2000 is a generous default; convergence is typically much faster when DCT lies in the parametric family.

  • lr (float) – Adam learning rate.

  • on (The loss is the Frobenius² distance between the circuit's action)

  • does (a complete basis and DCT_{2^m} ⊗ DCT_{2^n}. If the family)

  • DCT (not contain)

  • distance. (the loss plateaus at the closest reachable)

Return type:

list[Array]