FourierFT
4 memberslucid.peft.tuners.fourierftlucid.peft.tuners.fourierft — FourierFT: the weight update as a few frequency coefficients.
FourierFT (Gao et al., 2024, arXiv:2405.03003) learns n_frequency coefficients of a
spectrum at fixed pseudo-random locations; the inverse 2-D Fourier
transform of that sparse spectrum, times scaling, is the update. The locations come from
random_loc_seed alone, so an adapter holds just the coefficients. Pick it for an adapter
smaller than LoRA's whose update has no low-rank structure.
Where the reference library keeps them, so isinstance(m, FourierFTLayer) and from lucid.peft.tuners.fourierft import FourierFTConfig, Linear read as they do there. One layer type
for the one module the method adapts, nn.Linear. FourierFTConfig and FourierFTModel are
here and exported from lucid.peft. Importing the package registers the method (its config under
PeftType.FOURIERFT, its tuner and layer), which is what makes get_peft_model and
PeftModel.from_pretrained know it.
Gao, Ziqi, et al. "Parameter-Efficient Fine-Tuning with Discrete Fourier Transform." [arXiv:2405.03003](https://arxiv.org/abs/2405.03003), 2024.
FourierFT (Gao et al., 2024, arXiv:2405.03003) learns the weight update in the frequency domain: a handful of coefficients of a spectrum, at fixed pseudo-random locations, and the inverse 2-D Fourier transform of that sparse spectrum is the update,
Classes
FourierFTConfig9 methodsHow lucid.peft.get_peft_model adapts a model with FourierFT.
FourierFTLayer20 methodsAdapter bookkeeping and the spectrum-to-weight map shared by the FourierFT layers.
LinearAn nn.Linear with a FourierFT update: .
FourierFTModel15 methodsA model with FourierFT layers in it, and the tools to take them out again.