GLoRA
4 memberslucid.peft.tuners.gloralucid.peft.tuners.glora — GLoRA: learned corrections to both the weight and the bias of a layer.
GLoRA (Chavan et al., 2023, arXiv:2306.07967 — Generalized LoRA) corrects the weight and the bias of a layer with five learned support tensors, and , each a low-rank product, a vector, a scalar or off, so one family covers LoRA-like, scale-and-shift and prompt-like adapters. The update reads the weight and the bias, so a merge keeps the values it was folded into and an unmerge gives them back exactly. Pick it for a search space of adapter shapes, or an adapter that also moves the bias.
Where the reference library keeps them, so isinstance(m, GloraLayer) and from lucid.peft.tuners.glora import GloraConfig, Linear read as they do there. One layer type for the
one module the method adapts, nn.Linear. GloraConfig and GloraModel are here and
exported from lucid.peft. Importing the package registers the method (its config under
PeftType.GLORA, its tuner and layer), which is what makes get_peft_model and
PeftModel.from_pretrained know it.
Chavan, Arnav, et al. "One-for-All: Generalized LoRA for Parameter-Efficient Fine-tuning." [arXiv:2306.07967](https://arxiv.org/abs/2306.07967), 2023.
GLoRA (Chavan et al., 2023, arXiv:2306.07967 — Generalized LoRA) corrects the weight and the bias of a layer with learned terms,
Classes
GloraConfig9 methodsHow lucid.peft.get_peft_model adapts a model with GLoRA.
GloraLayer20 methodsAdapter bookkeeping and the corrections shared by the GLoRA layers.
LinearAn nn.Linear with a GLoRA update: .
GloraModel15 methodsA model with GLoRA layers in it, and the tools to take them out again.