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 asbasis_factory().tensorsand can be passed back astensors=...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: